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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]