ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Proper use of <uptodate>
Date Tue, 18 Dec 2001 18:13:07 GMT
I should add one thing - "jar2.jar" is not created using the <jar> task. It's the result
of running a java program using the <java> task. So any dependencies that the <jar>
task can automatically deduce aren't applicable (which is why I want to use <updtodate>).

I'd appreciate any info or docs that can point me in the right direction.



>>> 12/17/01 10:33PM >>>
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:


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" />

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,


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message