ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Inger <>
Subject Re: Conditional ANT building
Date Thu, 09 Aug 2001 19:14:43 GMT
once again, the need for conditionals has been brought up.
You can sort of do what you're looking for by doing the following:

<target name="build" if="build-1.3.0">
 <echo message="building..." />

<target name="default">
 <property name="build-${java.version}" value="true" />
 <antcall target="build" />

however the build target will not execute if you switch to version
1.3.1.   If you want that behavior then you're going to have to use
the optional "<script>" tag (you'll need to download the ibm
bsf.jar, and the netscape rhino js.jar)
or you'll have to develop a custom task to do the conditional.

T Master wrote:

>I was thinking of something within my init target that would check the
>Then I can enforce within my buildfile what jdk version should be used.
>Got a sample tidbit on how to?
>T Master.
>----- Original Message -----
>From: <>
>To: <>
>Sent: Thursday, August 09, 2001 10:01 AM
>Subject: Re: Conditional ANT building
>>Are you looking for something like
>>or ${java.runtime.version}
>>ant -debug | [find|grep] "y: java"

Matt Inger (
Sedona Corporation
455 S. Gulph Road, Suite 300
King of Prussia, PA 19406
(484) 679-2213
"Self-respect - the secure feeling that no one,
 as yet, is suspicious." -H.L. Mencken 

View raw message