ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Viraj Purang" <vpur...@bea.com>
Subject unable to use user properties inside the Javascript task.
Date Sun, 23 Jun 2002 02:27:22 GMT
Hi,
   I am unable to get the properties using projectName.getProperty() unless
the property is defined in the global context right at the top of the Ant
file.

Any property value that I set with the available task is not visible to the
script and it returns a null value if the value is echoed.

Please help ...(The file is attched below for referrence )

Regards,
Viraj Purang


------------------------------------------------------------------------
<project name="projectName" default="script">
<property name="doodle.poodle" value="false" />

   <target name="build-mail"
       description="runs:  [build-mail]">
      <echo message="Mailing Results for all components"/>
      <mail from="vpurang@bea.com" tolist="vpurang@bea.com" subject="Results
of hourly build"
              mailhost="santa-clara.beasys.com" files="c:\changes.txt"/>
   </target>

   <target name="build-set-change"
       description="runs:  [build-mail]">
      <echo message="Checking for existence of change.txt"/>
      <available file="c:\changes.txt" type="file" property="changes"/>


  </target>

<target name="changesset" if="changes" depends="build-set-change" >
  <script language="javascript">
  <![CDATA[
  	status= "true";
       projectName.setProperty("doodle.poodle", "true");

    ]]>
</script>

  </target>


 <target name="script">

  <script language="javascript"> <![CDATA[
	importClass(java.io.File);
	changes = "false";
	val = "true";

	function print(msg) {
            echo = projectName.createTask("echo");
            script.addTask(echo);
            echo.setMessage(msg);
        }
      while (changes == "false")
    {
       antcallTask = projectName.createTask('antcall');
       antcallTask.init();
       antcallTask.setTarget('changesset');
	   antcallTask.execute();
       // main.addTask(antcallTask);
       changes = projectName.getProperty("doodle.poodle");
       print( "####" + changes + "=");


    }

    ]]> </script>

</target>

 <!--target name="main" depends="script" /-->

</project>


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


Mime
View raw message