ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shaikh, Mehmood" <Mehmood.Sha...@ccra-adrc.gc.ca>
Subject RE: Using different compilers?
Date Wed, 02 May 2001 13:49:50 GMT
You can set the property within the target as follows :
<target name="hey" description="hey" >
<property name="cvsmodule" value="thismodule" />
</target>

but unfortunately you cannot set same property twice, the new value will not
override the old value, as in this case :

<target name="hey" description="hey" >
   <property name="build.compiler" value="abc" />
   <echo message="${build.compiler}" />

   <property name="build.compiler" value="xyz" />
   <echo message="${build.compiler}" />
</target>

This will print "abc" twice.

Mehmood


-----Original Message-----
From: Dominic Pilbeam [mailto:dpilbeam@lvi.com]
Sent: May 1, 2001 11:02 PM
To: ant-user@jakarta.apache.org
Subject: Using different compilers?


Hi

I'm a new Ant user so please forgive the naive questions:

I'm attempting to create a build file which compiles Java source from
several different directory trees using different compilers for each tree,
puts all the class files into one directory tree and then jars them all.

So, I have a target, "target1" which compiles one tree using the JDK
compiler, and another target, "target2" which compiles another tree using
the Microsoft compiler.

I could try to get target1 to set the owning project's "build.compile"
property to "classic" and then get target2 to set the property to "jvc". But
how do I set this property from within a target?

Also, I am struggling with the syntax of referencing a target property
within that target. For example, if I want to use the name of a target as
part of an attribute of a nested element of that target how do I achieve
this? i.e.

<target name="aName" depends="previousName"/>
<vssget localPath="${src}" recursive="true" login="${vssLogin}"
  vsspath="$/XXX" ssdir="${ssexe}"/>

I want the vssPath attribute to be the string literal "$/aName".

Thanks for any help,

Dominic

Mime
View raw message