You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Diane Holt <ho...@yahoo.com> on 2002/06/22 05:31:59 UTC

Re: unable to use user properties inside the Javascript task.

I didn't get into tracking down whether doodle.poodle should actually be
getting set -- instead, I just got the gist of what you were looking to
do, and I'd shrink it all down (the checking for the file part) to:

  <target name="checkForChanges" depends="script">
    <echo>changes = ${changes}</echo>
    <!-- do whatever you do when a changes.txt file exists -->
  </target>

  <target name="script">
    <script language="javascript"> <![CDATA[
      importClass(java.io.File);
      file = new File("changes.txt");
      for( ;; ) {
        if( file.exists() ) {
          project.setNewProperty("changes", "true");
          break;
        } else { java.lang.Thread.sleep(5000); } // give it a rest :)
      }
      ]]>
    </script>
  </target>

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>