Hi, > -----Original Message----- > From: Phil Surette [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, October 31, 2001 7:32 PM > To: Ant Users List > Subject: Re: script documentation > > > I think this should be possible. I'm actually (slowly, > when I have the time) working on building in support > for this with jython. In Jython (as in Rhinoscript, > I believe) you can compile a python class to a > java class, which can easily subclass an ant Task. > So I'm developing three ant tasks: > > 1)a task for running jython scripts (basically a more > jython-friendly version of Script task) > 2)a task for compiling jython classes to java classes > 3)a task for defining & compiling an ant task from a jython > class > > So far only task 1) is done :) > > I'm planning on submitting these to the jython group > since (from listening to the jython-dev list) this is > not the sort of thing the ant developers want to > encourage or maintain. > > The third task is the interesting one. You should be > able to define a new task inline in your ant build > like this: > > <jytaskdef name="cat"> > def setFile(self, String fileName): > self.fileName = fileName > > def execute(self): > print open(self.fileName).read() > </jytaskdef> > > The above snippet would embed the code in a jython > class which extends org.apache.ant.main.Task, > compile the jython class into a java class, > then define the task. > > One of the (anticipated) beauties of this system > is that you could very rapidly create new tasks > by embedding them in your ant script. There would > be an easy path to convert tasks that > seem to be of more general usage into reusable > tasks; maybe by adding a 'jar' attribute to > the jytaskdef. > > I see no reason why you could not do the same > thing for javascript, and I intend to once/if > I get a workable jython system. > Sounds Great ! This is exactly what I would like to have.
I would anyway like to use jython instead of javascript, but it seemed to me that javascript is better supported at the moment. Regards, Markus -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>