You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by "Pierre, Sebastien" <sp...@rational.com> on 2000/07/06 21:29:40 UTC

Exec task does not stop after program error.

Hi folks!

Here's a weird stuff : ant doesn't stop when you exec a program that
returns an error.
For example I have a python script that validates a bunch of XML files,
and I'd like my makefile to stop when my script returns an error code -
but ant just doesn't care and continues - which leads to unecessary
processing.

I think it would be cool to have an option in the exec task that would
just let us specify if we care or not about the execution's result [as a
way to set some env vars for the command]. BTW, why do ant need a
platform-dependant shell-script to start a command ???

Thx,
Seb.

-- 
Sebastien Pierre.-  spierre@rational.com \ French gov stole my liberty 
R a t i o n a l   software | XML          \ see why/how on  
. Rational Unified Process | technology    \ <www.altern.org/paradize>
. Vancouver, B.C,  -Canada | intern         \        - R I P -

Re: Exec task does not stop after program error.

Posted by "Pierre, Sebastien" <sp...@rational.com>.
Stefan Bodewig wrote:
> Because there is no way in Java to change the working directory of a
> Process before you start it - contrast this with the dir attribute of
> Exec.

I'm gonna die !!!!!
How is it possible that you cannot change the current dir of a process
????? This is just horrible....I have been looking for something like
that because I have an application that loads external scrips that can
include other scripts with a relative path....so I have to 'cd' to the
script path before loading it to make the script's dependencies
satisfied. 

What about the 'user.dir' property - does it really sets the path for
the whole VM ? Is it a reliable method ?

Thanks,
Seb.
-- 
Sebastien Pierre.-  spierre@rational.com \ French gov stole my liberty 
R a t i o n a l   software | XML          \ see why/how on  
. Rational Unified Process | technology    \ <www.altern.org/paradize>
. Vancouver, B.C,  -Canada | intern         \        - R I P -

Re: Exec task does not stop after program error.

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "PS" == Pierre, Sebastien <sp...@rational.com> writes:

 PS> ant doesn't stop when you exec a program that returns an error.

Yup, going to add an option for that.

 PS> BTW, why do ant need a platform-dependant shell-script to start a
 PS> command ???

Because there is no way in Java to change the working directory of a
Process before you start it - contrast this with the dir attribute of
Exec.

Stefan