ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Donald Strong" <dstr...@agentissoftware.com>
Subject MatchingTask (derivative) doesn't support nested fileset.
Date Thu, 14 Oct 2004 07:22:09 GMT
I am writing a task that will include a fileset.
I extended MatchingTask thinking I would get FileSet
suport for free but Ant is barfing.

I have also had trouble finding any examples of what
to do to process the FileSet. Am I doing the right thing
below?

Any help appreciated.

Regards
Donald.

------------- Output ---------------------------------
$ ant test

... snip

BUILD FAILED
C:\dev\sandbox\buildlog\build.xml:107: The <buildlog> type doesn't 
support the nested "fileset" element.

Total time: 1 second

----------- build.xml -----------------

  <target name="declare" depends="compile">
    <taskdef name="buildlog"
        classname="${buildlog.task}" >
      <classpath refid="runtime.classpath.id"/>
    </taskdef>
  </target>
...
    <buildlog datasource="${dsn}"
              type="junit"
              appserver="${appserver}"
              dbms="${dbms}"
              opsys="${opsys}"
              testtype="${testtype}"
              release="${release}"
              version="${version}"
              timestamp="${timestamp}"
              testgroup="${testgroup}"
              >
      <fileset dir="${data.dir}">
        <include name="${testfile}.xml" />
      </fileset>
    </buildlog>

------------ Java file --------
public class BuildLogTask extends MatchingTask {

...

    protected void processDataFiles() throws BuildException
    {
        DirectoryScanner ds = fileset.getDirectoryScanner(getProject());
        String [] files = ds.getIncludedFiles();

        if (files.length == 0)
            throw new BuildException("<buildlog> task fileset is empty");

        for (int i=0; i<files.length; i++) {

            setDatafile(files[i]);

            // Load the DataFile
            if (!loader.LoadDataFile())
                throw new BuildException("Unable to load data file: " +
                                         files[i]);
        }
    }
--------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message