>>> > bat files are not executable, use cmd.exe instead and the bat as
>>> > argument.
>>> > See FAQ and (1.7) manual.
>>>
>>> I've been thinking about this. Why dont we have Exec complain if we
>>> find a .bat or .cmd at the end of an executable on windows?
>>
>> Because one can execute some bat files directly:
>> hello.bat
>> -----------
>> echo "Hello"
>> ------------
>> build.xml
>> ------------
>> <project><exec executable="hello.bat"/></project>
>> ------------
>> Result:
>> Buildfile: build.xml
>> [exec] C:\>echo "Hello"
>> [exec] "Hello"
>> BUILD SUCCESSFUL
>>
>> That is why I said "cannot in general by executed directly"
>> (typo included!)
>> I do not know the (as usual in windows land) crazy rules on
>using .bat
>> files directly.
>
>It probably depends on how ant chooses to run the program, and
>how the JVM works underneath.
Maybe a hint on the fail message?
try {
executeTheCommand(...);
} catch ( ?? ) {
if (executable.endsWith(".bat") || .endsWith(".sh")) {
getProject("Dont execute shell scripts directly use command
interpreter...", MSG_DEBUG);
}
throw new BuildException(...);
}
Jan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]