ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Seeger" <rsee...@nortelnetworks.com>
Subject Re: Javascript errors
Date Wed, 26 Sep 2001 16:58:55 GMT
The classpath will be used in conjunction with any java tasks. The basic
concept is that the main build.xml (the one included by all the sub
projects) sets up the classpath to a union of:
- directories and jars that every project will use
- directories and jars that the current subproject will use

The DEPENDENCIES is used in some other places as well, but I'm not sure
what they are right now, since I'm not looking at the makefiles (there are
a lot of them).

Does this help at all?

At 09:23 AM 9/26/01 -0700, you wrote:
>Robert,
>
>What do the DEPENDENCIES property and classpath you're setting actually do
>for you in your process? That is, what are they used for once they're set?
>I suspect you may not actually need them, but that's just a guess at this
>point until I know more about what you're using them for.
>
>Diane
> 
>--- Robert Seeger <rseeger@nortelnetworks.com> wrote:
>> Unfortunately, this defeats the idea of what I'm trying to do. The basic
>> concept comes down to, which I'll describe:
>> 
>> - There are many subprojects of a large project, each with their own
>> build.xml file
>> - There is a primary build.xml file that is included by all the sub
>> probject's build.xml files
>> - Each sub build.xml includes the main build.xml file and then "depends"
>> on
>> "init", which is defined in the main file
>> - Each sub build.xml defines a variable DEPENDENCIES, which is a list of
>> other subpackages it depends on
>> - The init target in the main build.xml uses this variable to construct
>> things like the classpath, the various dependencies, and the like
>> 
>> As an example, here's some pseudo code showing whatI want to do:
>> 
>> ---- Sub project build.xml ---
>> <include file="main.xml"/>
>> <property name="DEPENDECIES" value="package1,package2,package3"/>
>> <target name="build" depends="init">
>>   <do somestuff/>
>> </target>
>> 
>> ---- Main build.xml ----------
>> <target name="init">
>>   <property name="basePkgPath" value="/base/pkg/path"
>>   <path>
>>     <foreach elem in "${DEPENDENCIES}">
>>       <pathelement location="${basePkgPath}/${elem}/java"/>
>>     </foreach>
>>   </path>
>> </target>
>> 
>> Since there isn't a foreach task in Ant, I'm using javascript to obtain
>> this functionality. If anyone can come up with a better way to do this,
>> I'll happily listen. I'm converting things over from a fairly complex
>> makefile system, so it's possible I'm not thinking about it all in the
>> right way for Ant.
>> 
>> Thanks again,
>> Rob Seeger
>> 
>> 
>> At 03:03 PM 9/25/01 -0400, you wrote:
>> >Put it in it's own .xml file.  Each xml file has it's own
>> >project name.  You can then use the "<ant>" task to call a
>> >task from another build file.
>> >
>> >ie.
>> >
>> >build.xml
>> >--------------
>> >
>> ><target name="calltest">
>> > <ant antfile="common.xml" target="test" basedir="." />
>> ></target>
>> >
>> >common.xml
>> >-------------
>> >
>> ><project name="Common" ... >
>> >
>> ><target name="test">
>> > <script language="JavaScript"><![CDATA[
>> >   var val = Common.getProperty("propertyName");
>> >  ]]>
>> > </script>
>> ></target>
>> >
>> >On Tue, 2001-09-25 at 14:31, Robert Seeger wrote:
>> >> Much appreciated. Changing it to use the project name works great.
>> This
>> >> does leave me with one problem however. The code is included in a
>> variety
>> >> of build.xml files, each with a different project name. Is there a
>> way to
>> >> get the current project name from within the javascript code?
>> >> 
>> >> Thanks again,
>> >> Rob Seeger
>> >> 
>> >> At 02:08 PM 9/25/01 -0400, you wrote:
>> >> >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 
>> >> >
>> >> >
>> >> ========================================
>> >> 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 
>> >
>> >
>> ========================================
>> 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
>> ========================================
>
>
>=====
>(holtdl@yahoo.com)
>
>
>
>__________________________________________________
>Do You Yahoo!?
>Get email alerts & NEW webcam video instant messaging with Yahoo!
Messenger. http://im.yahoo.com
>
========================================
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
========================================

Mime
View raw message