You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Robert Watkins <ro...@mincom.com> on 2000/08/01 03:25:01 UTC

Bug with exec under Windows 2000

The exec task doesn't work correctly under Windows 2000, when using a
directory that is not the local one.

Reading the code, it is clear that for Windows NT, it expects to use the cmd
command to execute commands, and for other Windows (presumably 9x), it uses
the antRun.bat file.

The code does not identify Win2K as a variant of WinNT, and so tries to use
the antRun.bat file.

The problem with this is that the antRun.bat file doesn't work when you are
using commands that (for example) require property definitions (e.g. a
command like: doStuff name=value). This appears to be a problem with the
pattern matching rules used in the batch file, but I'm not familar enough
with the DOS batch file syntax to work out what the solution at that level
is.

Given a sample target like this:
<target name="sample">
  <exec os="Windows 2000" command="echo doStuff name=value" />
  <exec os="Windows 2000" dir="otherDir" command="echo doStuff name=value"
/>
</target>

You get this output:

Buildfile: sample.xml

sample:
     [exec] doStuff name=value
     [exec] doStuff name value
                        ^ <- notice the lack of the = sign.
BUILD SUCCESSFUL


Robert.

--
  /\\\   Robert Watkins                      |   Email: rwatkins@mincom.com
 (  )))  Software Engineer - Technology Dev. |      ph: +61 7 3303 3432
  \///   Mincom Limited                      |     fax: +61 7 3303 3257
 Mincom

This transmission is for the intended addressee only and is confidential
information. If you have received this transmission in error, please delete
it and notify the sender. The contents of this E-mail are the opinion of the
writer only and are not endorsed by Mincom Limited unless expressly stated
otherwise.