ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edwin Park <>
Subject conditional build
Date Sun, 12 Mar 2000 03:56:16 GMT

Can ANT be used to build targets depending on the value of a particular
property?  For instance, I would like to have different build behavior
depending on the value of the java.specification.version property.  There
seem to be only two ways of doing conditional stuff with ANT - using the
'if' property in <target>, and using the <available> task.  Both are
conditional on the existence of a property, not its value.  It seems that
I would have to create my own task in order to implement the behavior I

The following description of the <target> directive seems misleading to

A target has also the ability to perform its execution if a property has
been set. This allows, for example, better control on the building process
depending on the state of the system (java version, OS, command line
properties, etc...). To make target sense this property you should add the
if attribute with the name of the property that the target should react
to, for example...

because control of the build process depending on java version and OS
implies to me 'if prop=val' semantics, rather than merely 'if prop
exists'.  Have I overlooked some other method of doing conditional builds?


View raw message