----- Original Message ----- From: "Duane Mattos" <[EMAIL PROTECTED]> To: "'Ant Users List' (E-mail)" <[EMAIL PROTECTED]> Sent: Tuesday, August 20, 2002 8:14 AM Subject: <target A depends="B,C,D"/> vs. <dependset> (new to ant)
> If I understand correctly <target A depend"B,C,D"/> will execute the B,C & D > unless some 'if' or 'unless' property is set. A target task doesn't know what > it creates, or whether what it creates exists, unless you set a property > 'telling' it so. target dependencies dont worry about the dependencies of 'artifacts', so much as the order things take place. Individual tasks are meant to worry about their own dependency checking. Most tasks -java, ftp, copy, do so, so you dont need to explicitly worry about artifacts. This is upside down from make where you state the dependencies between artifacts and let the runtime decide what gets done. > So it seems that if you want to want to build A if-and-only-if B,C,D are newer > (or don't exist) you need to set a property using <uptodate>. you are still thinking in makefile terms. B, C and D are stages in the build process, like compile, copy, jar; each of which should deal with itself. Usually the only time ot use <uptodate> is when trying to bypass something slow -like not rerunning the unit tests if the source and data files are unchanged. > On the other hand > if B,C,D are newer than A, the most elegant way of deleting A if any of B,C, or > D are new is through the use of a dependset. well 'newer' is the wrong concept here. Ant knows that A must run after B, C and D, so when you run A it calls B C &D in that order, unless they have their own dependency rules. tasks in the target work out dependencies for themselves. > > It feels more natural to me if a target 'knows' what it creates, and that what > it creates, or its product(s), 'belong(s)' to itself. You are clearly an experienced makefile user. Ant has a different philosophy from make, which is often better, though sometimes not as convenient as a few simple rules. > Would it be violating some Ant philosophy if a <target> had some property > indicating what file or fileset it creates? yes, as suddenly you have moved into a file centric view of the world. How you encompass tasks that ftp up to a remote server, or make changes inside a jar, or actually delete files in their process? -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
