You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by ro...@elastica.com on 2000/11/01 02:12:31 UTC
Conditionalizing an exec task on something changed.
I'm guessing you cannot do this but I'd like to be able to only
execute my exec tasks if rule the determined it was necessary
to compile something.
so
How can I not do the exec task if no .java files changed.
<target name="compile" depends="init,prepare">
<mkdir dir="${outputDir}"/>
<javac
srcdir="${sourceDir}" destdir="${outputDir}" includes="**/*.java" verbose="true">
<classpath>
<pathelement
location="third_party/sun/servlet.jar"/>
<pathelement
location="third_party/sun/jndi.jar"/>
<pathelement
location="third_party/oracle/classes12_01.zip"/>
<pathelement
location="third_party/oracle/ojsp.jar"/>
<pathelement
location="third_party/cybersource/cdkjava3300.jar"/>
</classpath>
</javac>
<exec executable="net" os="Windows NT">
<arg value="stop"/>
<arg value="JRun Default Server"/>
</exec>
<exec executable="net" os="Windows NT">
<arg value="start"/>
<arg value="JRun Default Server"/>
</exec>
</target>
RE: Conditionalizing an exec task on something changed.
Posted by Conor MacNeill <co...@ebinteractive.com.au>.
Robert,
Have you tried the uptodate task? Checkout the doc for it here
http://jakarta.apache.org/ant/jakarta-ant/docs/#uptodate
You may be able to setup something with it.
--
Conor MacNeill
conor@cortexebusiness.com.au
Cortex eBusiness
http://www.cortexebusiness.com.au
> -----Original Message-----
> From: robert@elastica.com [mailto:robert@elastica.com]
> Sent: Wednesday, 1 November 2000 12:13
> To: ant-user@jakarta.apache.org
> Subject: Conditionalizing an exec task on something changed.
>
>
> I'm guessing you cannot do this but I'd like to be able to only
> execute my exec tasks if rule the determined it was necessary
> to compile something.
>
> so
>
> How can I not do the exec task if no .java files changed.
>
> <target name="compile" depends="init,prepare">
> <mkdir dir="${outputDir}"/>
> <javac
> srcdir="${sourceDir}" destdir="${outputDir}" includes="**/*.java"
> verbose="true">
>
> <classpath>
> <pathelement
> location="third_party/sun/servlet.jar"/>
> <pathelement
> location="third_party/sun/jndi.jar"/>
> <pathelement
> location="third_party/oracle/classes12_01.zip"/>
> <pathelement
> location="third_party/oracle/ojsp.jar"/>
> <pathelement
> location="third_party/cybersource/cdkjava3300.jar"/>
> </classpath>
> </javac>
>
> <exec executable="net" os="Windows NT">
> <arg value="stop"/>
> <arg value="JRun Default Server"/>
> </exec>
> <exec executable="net" os="Windows NT">
> <arg value="start"/>
> <arg value="JRun Default Server"/>
> </exec>
> </target>
>
>
>