ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larason, Timothy" <TLara...@Datek.com>
Subject RE: depences?
Date Mon, 05 Nov 2001 22:48:53 GMT
try this...

<target name="javac" depends="prepare" if="javac.flag">
	<property name="build.compiler" value="classic" />
</target>

<target name="jikes" depends="prepare" if="jikes.flag">
	<property name="build.compiler" value="jikes" />
</target>

<target name="compile" depends="javac, jikes">
	<javac ...>
	...
	</javac>
</target>

<target name="jar" depends="compile">
	<jar jarfile="${dir.lib}/${jar.name}.jar">
      ...
      </jar>
</target>

Then you can run :
	ant -Djavac.flag=true jar  (will compile with javac)
	ant -Djikes.flag=true jar  (will compile with jikes)

You could even take it a step further and look at the "unless"
attribute...maybe use that with a default flag, so you don't always have
to type the "-D".

tim



-----Original Message-----
From: Rafal Kedziorski [mailto:rafcio@polonium.de]
Sent: Monday, November 05, 2001 5:39 PM
To: ant-user@jakarta.apache.org
Subject: depences?


hallo,

I have following peoblem.

I can compile my project with javac or jikes.

     <!-- 
=================================================================== -->
     <!-- 
JAVAC                                                               -->
     <!-- 
=================================================================== -->
     <target name="javac" depends="prepare">
         <property name="build.compiler" value="classic"/>
         <javac srcdir="${dir.src}"
           ...
         </javac>
     </target>

     <!-- 
=================================================================== -->
     <!-- 
JIKES                                                               -->
     <!-- 
=================================================================== -->
     <target name="jikes" depends="prepare">
         <property name="build.compiler" value="jikes"/>
         <javac srcdir="${dir.src}"
           ...
         </javac>
     </target>

But how can I make only one target for creating jar which depends on 
"javac" or "jikes" target?

     <!-- 
================================================================== -->
     <!-- Compiles the source directory and creates a .jar 
file              -->
     <!-- 
================================================================== -->
     <target name="jar" depends="?????">
         <jar jarfile="${dir.lib}/${jar.name}.jar">
           ...
         </jar>
     </target>

Is this possible?


Best Regards,
Rafal


--
To unsubscribe, e-mail:
<mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:ant-user-help@jakarta.apache.org>


--
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