ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harkness, David" <DHarkn...@sonypictures.com>
Subject RE: Optional jvmargs ???
Date Wed, 03 Sep 2003 21:06:35 GMT
Hi Rob,

I can't help with the first part of your question, but I can address the
second part. Ant properties are immutable -- the first value they get
assigned is permanent. Thus, you can set the default value in a
<property> task in your build.xml file, and any value the user provides
will override the file's value.

I took it a step farther here. The project's main configuration
properties (debug mode, whether or not to compile tests with the code,
use local or released JARs, etc) are in build.properties. Each
environment can override these in build_<env>.properties. And finally,
the developer can override those by creating build_developer.properties.
The top of the build.xml file reads in the properties:

    <property file="build_developer.properties"/>
    <property file="build_${env}.properties"/>
    <property file="build.properties"/>

Thus, developer properties override environment properties which
override project properties.

So far this has been flexible enough for our projects. The one (most
important) thing it's missing in my view is a level of indirection.
Instead of setting properties for each environment -- duplicating them
where two environments are identical -- the environment should dictate a
configuration file. Thus, the "dev" and "qa" environments would both
specify the "basic" configuration while "stage" and "prod" would use the
"resource-hog" setup.

David Harkness
Sr. Software Engineer
Sony Pictures Digital Networks
(310) 482-4756


-----Original Message-----
From: Rob [mailto:tukhus@yahoo.com] 
Sent: Wednesday, September 03, 2003 1:43 PM
To: user@ant.apache.org
Subject: Optional jvmargs ???


Dear All,

Am new to Ant and trying to define optional JVMARGs only when arguments
have been passed on the Ant command line by the user:

<jvmarg value="-Dopt.1=${opt.1}" if="opt.1" />

...but I get the error:

build.xml:253: Class org.apache.tools.ant.types.Commandline$Argument
doesn't support the "if" attribute.

This is Ant version 1.5.1.  I tried out version 1.5.4 and got the same
error.

Found the 'jvmarg if=' example in... 

http://archives.real-time.com/pipermail/tomcat-devel/2002-October/041850
.html

...and the jvmargset that they were using doesn't work either.  Is this
an extension?

Would also like to define default JVM arguments which can be overridden
by the user; for example:

<property name="myDefault" value="1" />
...
   <jvmarg value="-DmyDefault=${myDefault}" />

What's the rules of precedence on passed-in Ant arguments versus
properties defined in build.xml?

Cheers
Rob
Lowly Consultant, NYC

________________________________________________________________________
Want to chat instantly with your online friends?  Get the FREE Yahoo!
Messenger http://uk.messenger.yahoo.com/

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


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


Mime
View raw message