ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Earl Hood <>
Subject Re: Ant Dependency Management
Date Sat, 28 Oct 2017 22:52:44 GMT
On Sat, Oct 28, 2017 at 5:17 PM, R0b0t1 wrote:

> Is it possible to cache compilation results? I would like to avoid
> lengthy compile times after changing one file.

What I do for these situations is have the task create an empty file
which can then be used on subsequent executions for a modtime check to
determine if the task should execute or not.

I use something like the following general pattern:

  <target name="sometask"
    <!-- Create empty file for subsequent up-to-date checks -->
    <touch file="sometask.time" verbose="false"/>

  <target name="sometask-check">
    <uptodate property="skip.sometask"
      <!-- Pattern/file set(s) here -->

The dependent "sometask-check" will set the "skip.sometask" property if
any files specified in the pattern/file set are newer than the file

I normally put such modtime-check files in a specific directory that
gets removed when doing a "clean".

Unlike `make', Ant does not have implicit modtime dependency checks, so
you have to roll your own utilizing the <uptodate> task to set a
property that can be used to conditionalize the execution of a task.


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

View raw message