ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Klaus Alfert <>
Subject Re: Ant and LaTeX
Date Mon, 06 Nov 2000 07:23:07 GMT
Hi Stefan,

it works now (and out of the box: that was cool). 

>>>>> "S" == Stefan Bodewig <> writes:

>>>>> "KA" == Klaus Alfert <> writes:
KA> My problem was that I want to change the directory before tex is
KA> called. The easiest way was just to use the new API - I just
KA> didn't recognize that this call is not the older API.

S> This is exactly what Execute tries to hide. Basically you do something
S> like

S>   // Create an Execute instance and make sure output gets to Ant's
S>   // logging system. No timeout.
S>   Execute execute = 
S>     new Execute(new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN), null);

I see. My attempt was to use simply new Execute();, but this it is at
least clearer what is happening.  

S>   execute.setCommandline(YOUR_COMMAND_HERE);

S>   // set your working directory
S>   execute.setWorkingDirectory(dir);
S>   // allow Ant to find the antRun script if necessary
S>   execute.setAntRun(project);

This is a nice hint. Thanks.

S>   // run your command
S>   exitValue = execute.execute();

S> This will go a long way to avoid using a helper script (antRun does a
S> cd dir and than invokes the command), taking special measures on JDK
S> 1.3, MacOS (where you can change user.dir), Windows NT/2000 and OS/2.

Thanks for your advice. I will publish the next release this

Klaus Alfert                
Software Technology                   +49+231+755-4812
CS Department, University Dortmund

View raw message