Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Ant Wiki" for change 
notification.

The following page has been changed by mmr11408:
http://wiki.apache.org/ant/AntNewbies

------------------------------------------------------------------------------
  
  ----
  
+ ```Question#15```
+ How do I perform a task only if Ant is going to perform a task?
+ 
+ I want to create a file only if and only if at least one of my java source 
files needs to be compiled. I do not want the file created otherwise. Here is 
what I have:
+    <macrodef name="compile.macro" >
+       <attribute name="destination" />
+       <element name="inputfiles" optional="false" />
+       <sequential>
+          <echo file="${basedir}/src/ServiceVersion.java">
+             package mypackage;
+             public final class ServiceVersion
+             {
+                public static String getVersion()
+                   { return "${release.number} ${DSTAMP}"; }
+             }
+          </echo>
+          <javac destdir="@{destination}" deprecation="true" >
+             <inputfiles />
+             <classpath refid="compile.classpath" />
+          </javac>
+       </sequential>
+    </macrodef>
+ 
+ This will create the file every time which is not desirable.
+ 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to