ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Seeger" <>
Subject Javascript errors
Date Tue, 25 Sep 2001 17:38:48 GMT
I'm having a problem with the script task, and I was hoping someone might
be able to point me in the right direction. Since I can't seem to find a
good reference on how to use javascript with ant, I've been pulling pieces
from here and there, with little success.

I downloaded bsf.jar and js.jar and put them in $ANT_HOME/lib. I tried to
find rhino.jar, but js.jar was the best I could come up with (*looks

I then tried a variety of scripting pieces, and came up with the following:

<target name="testme" id="testme">
  <property name="prefix" value="/bin/"/>
  <property name="suffix" value="/notbin/"/>
  <script language="javascript"> <![CDATA[
    function makePath(prefix, path, suffix) {
      var newPath = prefix + path + suffix;
      return makePath;
    var prefix = testme.getProperty("prefix");
    var suffix = testme.getProperty("suffix");
    var path = makePath(prefix, "WUIadmin", suffix);
    path = path + ":" + makePath(prefix, "SLTools", suffix);
    testme.setProperty("pkg.classpath", path);
  ]]> </script>
  <echo message="${pkg.classpath}"/>

However, when I run it, I get the following error message:

d:\Java\TestPrograms\TestAnt\ undefined: getProperty is not a function.
(<ANT>; line 5)

Can anyone either tell me what I'm doing wrong, or point me in the
direction of a source with good information about using javascript from
within Ant?

Thanks in advance,
Rob Seeger
Robert Seeger
Network Engineer
Nortel Networks

Telephone:	(518)237-2087
Pager:		(800)SKY-8888  Pin#1264792
Fax:		(518)237-4190
Address:	224 5th Ave, Apt#2
		Lansingburgh, NY 12182

View raw message