Summary: | Add a destfile to the uptodate task | ||
---|---|---|---|
Product: | Ant | Reporter: | Guillaume Cot <cote> |
Component: | Core tasks | Assignee: | Ant Notifications List <notifications> |
Status: | NEW --- | ||
Severity: | enhancement | ||
Priority: | P3 | ||
Version: | 1.7.0 | ||
Target Milestone: | --- | ||
Hardware: | Other | ||
OS: | other |
Description
Guillaume Cot
2002-06-27 14:33:40 UTC
I'm not sure to clearly understand what you want based on your description and your summary. I don't see any relation with some sort of 'destfile' (which name is close to 'targetfile') and a fileset(oldest)/fileset(newest) Maybe it would be more clear with a example. I have a task call ejbdoclet which generate a lot of files base on some javasource. For now, I have the following in my build.xml. <uptodate property="prod.ejbdoclet.notRequired"> <srcfiles refid="prod.ejbdoclet.src.fileset"/> <mapper type="merge" to="${prod.meta.tmp.dir}/ejb-jar.xml"/> </uptodate> For now, I check all my file against a single target file : ejb-jar.xml. What I would like would look like : <uptodate property="prod.ejbdoclet.notRequired"> <srcfiles refid="prod.ejbdoclet.src.fileset"/> <targetfiles dir="${build.dir}"> <include name="metadata/ejb-jar.xml"/> <include name="metadata/weblogic-ejb-jar.xml"/> <include name="metadata/weblogic-cmp-rdbms-jar.xml"/> <include name="gensrc/**/*Remote.java"/> <include name="gensrc/**/*RemoteHome.java"/> <include name="gensrc/**/*Local.java"/> <include name="gensrc/**/*LocalHome.java"/> <include name="gensrc/**/*Data.java"/> </targetfiles> </uptodate> when the property is set only when all the file in targetfiles are newer that the newer file in srcfiles. What would you want to see happen if ${build.dir}/metadata/ejb-jar.xml isn't there at all? The fileset wouldn't mind and uptodate would happily consider the targetfiles up-to-date. No the opposite, the targetfiles are consider update only if they all exist and the oldest targetfile is younger that that the youngest sourcefile. If you assume that nonexisting file are ok, I would have to make and between an available element and an uptodate element. I've not been clear enough. What I described, is the behavior of fileset. Your idea wouldn't catch the missing targetfile as filesets don't care if some include patterns don't match anything. <filelist> may be what you want, but then you don't get any pattern matching. What are you going to do, if you detect that something is not uptodate? May <dependset> help you? You could probably use <dependset> followed by <available> for ejb-jar.xml. If it is still there, things have been up-to-date. Actually, <uptodate> and <dependset> are pretty much superseded by Peter's <outofdate> available from Ant-Contrib on SF.NET. Go get it, and you'll be happy you did ;-) See recent ant-contrib-dev mailing lists for recent posts about it's use. --DD |