ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: Calling targets and passing parms?!
Date Tue, 18 Dec 2007 06:43:29 GMT
> The ${label} parameter becomes set to "Release_2007_12_01_001" when
> the build script is executed. Even better, it cannot be reset via a
> <parameter> task. That means you could have a default value defined in
> your build file, and then have the command line value over ride it.

He meant <property> task instead of <parameter> ;)

> As I said before, you should set a default inside the build file, so
> if you don't provide a command line value, it will still have some
> sort of value.

If you dont know a good default and therefore rely on the "user input",
you could
do a 
   <fail unless="label">You must provide a 'label'</fail>
which causes the build to fail if you dont provide that property.

If you want to use "derived" values you could also provide a bunch of
property files
and load one of them using the given property. Again you should provide
defaults ...
   <property file="${label}.properties"/>
   <property file=""/>

Example: :
       release.manager=John Doe :
       release.manager=${} inc.
       <jar ...>
               <attribute name="Built-By" value="${release.manager}"/>
               <attribute name="Implementation-Vendor"
               <attribute name="Implementation-Title" value="${name}"/>
               <attribute name="Implementation-Version"


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

View raw message