ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 7046] - Exec doesn't find correct path if using nested ant files.
Date Wed, 13 Mar 2002 16:12:20 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7046>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7046

Exec doesn't find correct path if using nested ant files.





------- Additional Comments From holtdl@yahoo.com  2002-03-13 16:12 -------
Sorry you're having so much trouble -- hopefully this will clear things up some.

You don't need to run executables from a (command) shell -- just batch files 
and built-ins (eg., dir, echo, type, etc.) [use "cmd"], and for shell-scripts 
on Win* running an *nix-type shell (eg., Cygwin) [use "sh"], which I probably 
should've made clearer before (on native *nix, you can run shell-scripts 
directly). But for Win*, the executable needs to be in a dir that's in your env 
%Path% (on *nix, you can do your ./ls, although you don't need the "./" if "." 
is in your $PATH). (I don't have access to a Sun at the moment, but running 
your <exec> for *nix on FreeBSD worked fine for me.)

For example, on Win*, try (in your subdir build.xml):
    <exec dir="." executable="find" os="Windows NT">
      <arg line='" foofile" foo.txt'/>
    </exec>

With foo.txt (in your "subdir" dir) as:
This is a foofile to test
running the find command.

(Note that you don't need the .exe suffix on the command, the way you had it 
for your ls.exe in your example -- it doesn't hurt, you just don't need it.) 
Running 'ant' from your "anttest" build.xml file, should result in:

dist:

dist:
     [exec]
     [exec] ---------- FOO.TXT
     [exec] This is a foofile to test

However, to "cat" out the file on Win* (ie., run 'type foo.txt'), since 'type' 
is a built-in, you'd need to run it from 'cmd' (that's an aspect of Win*, not 
of Ant):
    <exec dir="." executable="cmd" os="Windows NT">
      <arg value="/c"/>
      <arg value="type foo.txt"/>
    </exec>

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message