ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craeg K. Strong" <cstr...@arielpartners.com>
Subject Re: [SUBMIT] New <dependset> task, a task to manage arbitrary dependencies between files
Date Thu, 02 Aug 2001 04:37:15 GMT
>
>
>> But I see your point of using a fileset for target files as well,
>> there are situations where you don't know all the names of the target
>> files or it would be cumbersome to list them.
>>
>> Maybe we'd need a targetfileset and a targetfilelist or similar, where
>> a missing file from the targetfilelist would be treated the same way
>> as an out-of-date target file?
>>
Oh-oh.  I just carefully read the source code for DirectoryScanner and 
noticed that
using this class in the usual way:

DirectoryScanner ds = sourceFileSet.getDirectoryScanner(project);
String[] sourceFiles = ds.getIncludedFiles();

will not return files that do not exist even if they were explicitly 
named like so:

<srcfiles dir="foo" includes="this-file-does-not-exist.xml"/>    

Holy incorrect assumptions, batman!

This is why you mentioned the possibility of including both FileSets and 
FileLists, is it?   Now I get it.
OK, this being the case, how to proceed?    There are several options I 
can imagine:

- you could have some sort of option that would make DirectoryScanner 
return explicitly-named
    files even if they did not exist

- you could create a new DataType of ExplicitFileList or something that 
accepted no wildcards

- you could use FileSets, but have them behave a little differently in 
the case of <dependset>

I guess I am leaning towards option "B," based on the principle of least 
surprise...

Something like:

<dependset missingSource="outofdate">
  <srcfile dir="bar" file="common.xsl"/>
   <srcfile dir="bar" file="tables.xsl"/>
  <srcfiles dir="foo" includes="*.xml"/>
   <targetfiles dir="mumble" includes="**/*.html"/>
    <targetfile dir="blat" file="generate-me.txt"/>
</dependset>

...thoughts?

--Craeg





Mime
View raw message