ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig Dickson <craig.dick...@kirus.com>
Subject RE: setting property using <script> task
Date Mon, 07 Apr 2003 20:25:42 GMT
2 things:

i have only ever used project.setProperty(...), not the setNewProperty
method you used, so I am not sure what the difference there is.

but what i think is your problem is the use of the antcall task. i would get
rid of that line and change the definition of the default target to be
<target name="default" depends="myFunc">. i dont think properties that are
set inside an antcall task are propagated back out to the calling context.


> -----Original Message-----
> From: Woo, Chen Ching [mailto:cwoo@spss.com]
> Sent: Monday, April 07, 2003 1:26 PM
> To: Ant Users List
> Subject: setting property using <script> task
> 
> 
> I need to do some processing using the <script> task and set 
> a project property at the end, but it doesn't seem to work. 
> Can some one point me to the right direction ?
> 
> Thanks.
> 
> output
> ======
> c:>ant -f bogus.xml
> Buildfile: bogus.xml
> 
> default:
> 
> myFunc:
>      [echo] ${hello}
> 
> BUILD SUCCESSFUL
> Total time: 4 seconds
> 
> bogus.xml file
> ==============
> <?xml version="1.0" encoding="UTF-8"?>
> <project name="test" default="default" basedir="."> 
>   <target name="default">
> 	<antcall target="myFunc"/>
>     <echo message="${hello}"/>
>   </target>
>   <target name="myFunc">
> 	<script language="javascript">
>     <![CDATA[
>       project.setNewProperty("hello", "it's me !");       
>     ]]> 
> 	</script>
>   </target>
>   
> </project>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
View raw message