If I've got your requirements straight, try:
<target name="jars" depends="jar1" if="build.jar2">
<java for your jar2.jar.../>
</target>
<target name="jar1">
<jar for your jar1.jar .../>
<uptodate property="build.jar2" targetfile="jar1.jar">
<srcfiles dir="." includes="jar2.jar"/>
</uptodate>
</target>
Diane
--- Donnie Hale <[EMAIL PROTECTED]> wrote:
> I've checked the docs and faq on this and am still a little unsure of
> how
> <uptodate> is intended to be used.
>
> Here's my situation:
>
> src/**/*.java
> classes/**/*.class
> lib/jar1.jar
> lib/jar2.jar
>
> The indentations imply dependencies. I want to make sure that jar2 is
> built
> if jar1 had to have been built, either because it didn't exist or was
> out-of-date with respect to any of the .class files. Importantly, I
> don't
> want jar2 built it exists and if jar1 wasn't rebuilt, as that's a fairly
> expensive step.
>
> As I see it, there are 3 possible situations when the script begins:
>
> 1) jar1 exists but is out of date (jar1 and jar2 should be built)
> 2) jar 2 doesn't exist (jar1 and jar2 should be built)
> 3) jar1 exists and is up-to-date (jar 1 should not be built, jar 2
> should be
> built if it's out-of-date)
>
> So I've tried putting an <uptodate> in my prepare task, and that seems
> to
> make sure jar2 doesn't get built if jar1 is up-to-date. And I have an
> <uptodate> in my jar1 task. But, with "unless" on my jar2 task, that
> doesn't
> ensure that my jar2 task gets run if the jar1 task is run.
>
> My <uptodate> is of the form:
>
> <uptodate property="jar2.notrequired" target="${libdir}/jar2.jar">
> <srcfiles dir="${libdir}" includes="jar1.jar" />
> </uptodate>
>
> The docs on <uptodate> give a completely out-of-context example, so
> that's
> why I'm stuck. Any advice would be helpful. Also, how do "if" and
> "unless"
> interpret (quoting the docs) "the property that must [not] be be set"?
> Does
> that mean set to anything? Or just not set to the value "false"? Lastly,
> is
> there a way to "unset" a property in a task?
>
> Thanks much,
>
> Donnie
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
=====
([EMAIL PROTECTED])
__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>