ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wes Moulder" <>
Subject RE: Questions on Exec and stuff
Date Tue, 16 Jan 2001 19:47:35 GMT
1) dir is not an executable, it's an OS internal command.  Try writing a
batch file "dir.bat" containing "dir" as the only line.  Then turn dir
into dir.bat.
2) You cannot get access to System Environments in Java.  The way to do
this is with a -DPATH=%PATH% when you invoke ant.
3) If a target depends on something else, it won't execute until all it
depends on have been executed.  However, targets only get executed once.
Thus, to get them all to execute in a specific order, you've got it
correct.  To get it to execute everything without specifying a target,
change the attribute 'default="test"' to 'default="echo"' in the project

-----Original Message-----
From: Patrick Moylan []
Sent: Tuesday, January 16, 2001 1:32 PM
To: ''
Subject: Questions on Exec and stuff

I am new at this. I am trying to run an exec command using some of the
examples in the docs and it doesnt appear to work. This is on Windows
Here is the script.

<project name="Test" basedir="." default="test">
<target name="init">
<property name="path" value="${PATH}" />
<target name="test" depends="init">
<exec dir="${basedir}" executable="dir" os="windows" output="dir.txt">
<target name="echo" depends="test">
This is a longer message stretching over
two lines.

1.It says it is succesful but does not list the contents of the
in the dir.txt
2. In my target 'init' I am just trying to get the system path of the
OS, is
this correct?
3. The only way I can get all three targets to run is to call the last
target, since I placed a depends there. What is the order of precedence
running these?How can I get it to do all targets?


View raw message