ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Ellsworth <>
Subject How to set a javac parameter only if a property exists
Date Fri, 21 Dec 2001 01:10:46 GMT
Howdy, all.

The problem: when build.compiler is set to jikes, and there is a 
nonexistent directory in the extensions path, jikes barfs.  MacOS X 
has several directories in the extensions path that do not exist.

The potential hope:
If is set build.compiler to jikes, and then find a way to add the 
parameter extdirs="" to my javac target, then I am told that it works.

The workaround:
If I set build.compiler to jikes, then I will set build.extdirs to "" 
at the same time.  A manual step, but one I can live with.

The icky part I do not know how to handle:
How do I set the parameter only if the property has a value?  The 
rest of the time, it is fine as it is.

Here is my task:
<target name="compile-release" depends="depend-release" 
description="Compile java files into optimized class files">

I could clearly add extdirs=${build.extdirs} right after the includes 
line, but that is really tacky, because then I will need to define it.

I would much rather say something like

if ${build.extdirs} exists, set extdirs=${build.extdirs} endif

so if the property does not exist, I could just get the default 
behavior, and only if I decided to set the property will I see 

How are other people handling this?


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message