ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Ruff ...@marcelruff.info>
Subject Scope of scripts
Date Fri, 28 Apr 2006 13:28:10 GMT
Hi,

i have defined a javascript function in a "pre" task,
but when i want to call it later i get:

   ReferenceError: "doPrecond" is not defined

Here is the xml, i call it with 'ant y':

---------------------
   <target name="pre">
      <script language="javascript">function doPrecond() { project.log("HELLO PRECOND");
}</script>
   </target>

   <target name="y" depends="pre">
      <script language="javascript">doPrecond();</script>
   </target>
---------------------

Any ideas?

Thanks
Marcel
http://www.xmlBlaster.org

Note: This works fine:
    <target name="z">
       <script language="javascript">
          function doPrecond() { project.log("HELLO PRECOND"); }
          doPrecond();
       </script>
    </target>

This fails as well:
    <target name="r">
       <script language="javascript">
          function doPrecond() { project.log("HELLO PRECOND"); }
       </script>
       <script language="javascript">
          doPrecond();
       </script>
    </target>


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


Mime
View raw message