ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@bost.de>
Subject Re: Ant and LaTeX
Date Fri, 03 Nov 2000 16:37:37 GMT
>>>>> "KA" == Klaus Alfert <alfert@udo.cs.uni-dortmund.de> 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.

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

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

  execute.setCommandline(YOUR_COMMAND_HERE);

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

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

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

Stefan

Mime
View raw message