ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Donnie Hale" <don...@haleonline.net>
Subject Proper use of <uptodate>
Date Tue, 18 Dec 2001 03:33:24 GMT
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:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message