All this sounds great Sam,
I had not followed the discussion on scripting and using Rhino seems an
excellent idea: it lets you take a complete control on ant in javascript.
When will all this be available ?
P@
[EMAIL PROTECTED] wrote:
> I put a lot of power into the scripting task, a lot more than I think
> people realize. I wasn't going to discuss it until the time was right, but
> now it does appear that there is enough genuine interest (trust me, it was
> *very* controversial at the time). I present it here to seed discussion -
> if there are things that there is consensus on needing to be changed, then
> I'm OK with change as I doubt that anybody is seriously using it.
>
> The first thing worth mentioning is that scripts have access to everything
> a Java task would have access to. Below is an example of a simple loop
> which actually modifies the build script. Note the use of the name
> "squares" and "main".
>
> <project name="squares" default="main" basedir=".">
>
> <target name="setup">
>
> <script language="javascript"> <![CDATA[
>
> for (i=1; i<=10; i++) {
> echo = squares.createTask("echo");
> main.addTask(echo);
> echo.setMessage(i*i);
> }
>
> ]]> </script>
>
> </target>
>
> <target name="main" depends="setup" />
>
> </project>
>
> And here is the output I get when I run this script on my machine:
>
> Buildfile: build.xml
> Project base dir set to: C:\tmp
> Executing Target: setup
> Executing Target: main
> 1
> 4
> 9
> 16
> 25
> 36
> 49
> 64
> 81
> 100
> Completed in 4 seconds
>
> - Sam Ruby
--
Patrick Chanezon, iPlanet Market Maker- Portal/EServices Technical Lead
Netscape Communications Corp. - http://people.netscape.com/chanezon/
Opinions are my own.
"Two monks were arguing about a flag. One said: `The flag is moving.'
The other said: `The wind is moving.'
The sixth patriach happened to be passing by. He told them: `Not the wind, not
the flag; mind is moving.'"
Zen Koan
begin:vcard
n:Chanezon;Patrick
tel;fax:603.388-9565
tel;work:650.937.6605
x-mozilla-html:TRUE
org:<CENTER><A HREF="http://www.iplanet.com/"><IMG SRC="http://www.iplanet.com/images/header_images/logo.gif" BORDER=0 </A></CENTER>;Vortex
version:2.1
email;internet:[EMAIL PROTECTED]
title:<I>iPlanet Market Maker - Portal Technical Lead</I>
note:<A HREF="http://people.netscape.com/chanezon/"><IMG SRC="http://people.netscape.com/chanezon/patrick_photo_identite.jpg" BORDER=0 HEIGHT=70 WIDTH=49></A><BR>Have Fun with <A HREF="http://www.javasoft.com/"><IMG SRC="http://www.javasoft.com/images/logos/javalogo52x88.gif" border="0" HEIGHT="88" WIDTH="52"></A><BR><hr><BR>
adr;quoted-printable:;;Netscape Communications Corp.=0D=0A501 E. Middlefield Road=0D=0ABuilding 6=0D=0AMV-025;Mountain View;CA;94043;USA
fn:Patrick Chanezon
end:vcard