• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ant uptodateTask with single file

 
Greenhorn
Posts: 1
C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm tring to use the ant task uptodate to verify which module need to be compiled for my project.
Now the project uses about 30 modules and alla seems ok using this ant task:

<uptodate property="build.notRequired" targetfile="compiled.jar">
<srcfiles dir="src" includes="**/*.java" />
</uptodate>

<target name="Compile Jar" unless="build.notRequired">
....
</target>

but now i need to compile a module checking single file in this way:

<uptodate property="build.notRequired" srcfile="/source/1_ita.txt" targetfile="compiled.jar"/>

<target name="Compile Jar" unless="build.notRequired">
....
</target>

Also when the compiled.jar is newer than the file /source/1_ita.txt the script launch the target Compile Jar.

Any hints??
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Matteo Gatto wrote:I'm tring to use the ant task uptodate...


Matteo,

I've moved your thread to the appropriate forum. Please check these before you post (there are quite a few ), as you're likely to get your answers a lot quicker if you choose the right one.

Thanks.

Winston
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should not have to do the first <uptodate> that you showed, the javac task automatically compares the .java source files to the compiled .class files and compiles only those that changed. (Unless you are for some reason deleting the .class files after building the JAR...)

Do you have both of these <uptodate> tasks in the same build.xml? Are they perhaps interfering with each other? In Ant, once a property value is set it is immutable, in other words when the first uptodate sets build.notRequired then the second uptodate will have no effect on the value of build.notRequired.
reply
    Bookmark Topic Watch Topic
  • New Topic