ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Gordon" <>
Subject RE: launch interpreter
Date Wed, 04 Jun 2003 14:34:17 GMT
You'd have to talk to someone who knows what BSFManager.execute does -
people have often posted interactive examples written in JavaScript, so
console I/O can obviously be directed to code hosted in script.

The reason you can't use Java and Exec is that the stream handler doesn't
connect the console input from ANT to the spawned Process (at least it
didn't used to - it looks like it might be fixed in 1.6).

-----Original Message-----
From: []On Behalf Of
Sebastien Blanc
Sent: 04 June 2003 14:52
To: Ant Users List
Subject: Re: launch interpreter

Hi !
I was just wondering if this was possible w/ ANT; for instance a java
can do it (i.e. embbed a jython prompt, the interactive console taking care
the i/o reading and interpreting). something like:
PySystemState.initialize(System.getProperties(), System.getProperties(), new
// Create the interpreter.
InteractiveConsole interp = new InteractiveConsole();
I'll try launching the same with BSF jython and see what's possible: is a
thread launch when launchin <script> or not (I guess it wd be better if not
that case) ?

Tim Gordon wrote:

> I think you may be on to a hiding to nothing here
> - ANT will wait for forked JVMs and Exec'd processes to complete before
> will contiunue with the next task
> - Even if you had a Spawn task that would let the spawned process run
> how exactly are you going to maintain in input output streams to your
> spawned process after the launching JVM exits? Have a good read of the
> javadoc for java.lang.Process... You can only really get away with
> form ANT if your i/o doesn't come from console.
> -----Original Message-----
> From: Sebastien Blanc []
> Sent: 04 June 2003 01:05
> To:
> Subject: launch interpreter
> Hello !
> I'm trying to do a startup script with ANT that would launch the jython
> prompt so that the user can launch jython methods when wanted.
> I use the following:
> <java classname="org.python.util.jython"
> argline="-Dpython.home=${vendor.jython.home}
> -Dpython.cachedir=${vendor.jython.cachedir}" >
>              <classpath refid=""/>
> </java>
> and get the following exception:
> java.lang.NullPointerException
>         at<init>(
>         at
>         at
>         at
>         at
>         at
>         at
>         at
>         at
>         at
>         at
>         at
>         at
>         at
>         at
>         at
> if I use fork="true", the jvm hangs and Ctrl+C triggers the prompt (but
> then exit the ANT JVM).
> is there a way to get the jython interpreter (scripting ? parallel ?).
> I'd guess any interpreter launching would lead to the same issue (I know
> that the DOS one for instance wd use exec but I don't see any portable
> equivalent here).
> thanx for help,
> seb.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message