ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brown, Michael (Denver)" <>
Subject RE: setting property using <script> task
Date Mon, 07 Apr 2003 20:57:56 GMT
      project.setNewProperty("hello", "it's me !");       

If I read this correctly, you need to use the name of the project you are
setting the property for:

      test.setNewProperty("hello", "it's me !");       
Additionally, I have used the setUserProperty function.  Not this one.  I
would have to research to tell you the difference, but you might try both.
I think the above should work.

Mike B.
-----Original Message-----
From: Woo, Chen Ching []
Sent: Monday, April 07, 2003 2: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 ?


c:>ant -f bogus.xml
Buildfile: bogus.xml


     [echo] ${hello}

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 name="myFunc">
	<script language="javascript">
      project.setNewProperty("hello", "it's me !");       

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

View raw message