ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KOFFMANN Gilles <Gilles.KOFFM...@totalfinaelf.com>
Subject Réf. : Re: Passing changing values from script toant
Date Wed, 16 Apr 2003 11:47:03 GMT

> Last solution, if you are starting your ant build via the ant Java API, you
> can override properties programmatically.

How do you do that ? As far as I know, once a property's value is set, you can not change
it.

Regards

Gilles KOFFMANN











I do not know beanshell, but generally there are different ways to set
properties.
If beanshell can write files, then write a property file in your beanshell
and load it in your ant build file with
<property file="mygeneratedproperties.properties"/>
If you start ant by issuing a shell command, you can also do
"ant -Dpropertyname=value"; properties defined on the command line override
these defined in the build.xml
Last solution, if you are starting your ant build via the ant Java API, you
can override properties programmatically.
Hope this helps.
Antoine



> Hello,
>
> I'm relying on an xml file describing my build.
> I parse this xml in a beanshell script task thru the Xerces impl. of the
DOM api
>
> What I would like to do is call an ant task from this script passing a new
value each time.
> Since ant properties are immutable, I can't do that.
>
> The result is that my build is only one big task containing only
beanshell script.
>
> Am I missing something ? Is there a workaround ? Is it for next versions ?
>
> Regards
>
> Gilles KOFFMANN
>




Mime
View raw message