ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Inger <ma...@sedonacorp.com>
Subject Re: Javascript errors
Date Tue, 25 Sep 2001 18:08:13 GMT
because you cannot get a property on a target
i believe (correct me if i'm wrong about this
in ant 1.4).  what you really need to do
is to call this:

Project.getProperty(propName)

(of course Project is replaced by the name attribute of
 your project)


On Tue, 2001-09-25 at 13:38, Robert Seeger wrote:
> 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
> confused*)
> 
> 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}"/>
> </target>
> 
> However, when I run it, I get the following error message:
> 
> d:\Java\TestPrograms\TestAnt\tree.slsrc.SLGEN3.java.com.nortelnetworks.servi
> celink.datasource.build.xml:69: 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
> Email:		rseeger@nortelnetworks.com
> Address:	224 5th Ave, Apt#2
> 		Lansingburgh, NY 12182
> ========================================
-- 
Matt Inger (matt.inger@sedonacorp.com)
Sedona Corporation
455 S. Gulph Road, Suite 300
King of Prussia, PA 19406
(484) 679-2213
"Self-respect - the secure feeling that no one,
 as yet, is suspicious." -H.L. Mencken 


Mime
View raw message