You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Tommy Nordgren <to...@chello.se> on 2006/01/23 22:05:17 UTC

Problem with exec task

I have a problem with the exec task.
I want to run an executable nested in one of my build directories.
I've tried:
<exec executable="${unittest.build.dir}/TestRequiredInput.pl" />
This executes the command, but the work directory is still the base  
directory of my build.
I want it set to the directory containing the executable.

When I tries:		
<exec dir="${unittest.build.dir}" executable="${unittest.build.dir}/ 
TestRequiredInput.pl" />
exec will just return an error code of 255.

When I try:
<exec dir="${unittest.build.dir}" executable="TestRequiredInput.pl" />
ant will throw an IOException ("File not Found")

What do I need to do to successfully execute in a nested directory.

The first option isn't viable, because I want generated files in the  
same directory as the executable.
-------------------------------------
This sig is dedicated to the advancement of Nuclear Power
Tommy Nordgren
tommy.nordgren@chello.se




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Problem with exec task

Posted by Stefan Bodewig <bo...@apache.org>.
On Mon, 23 Jan 2006, Tommy Nordgren <to...@chello.se> wrote:

> I want to run an executable nested in one of my build directories.
> I've tried:
> <exec executable="${unittest.build.dir}/TestRequiredInput.pl" />
> This executes the command, but the work directory is still the base
> directory of my build.
> I want it set to the directory containing the executable.
> 
> When I tries:		
> <exec dir="${unittest.build.dir}" executable="${unittest.build.dir}/
> TestRequiredInput.pl" />
> exec will just return an error code of 255.

Is ${unittest.build.dir} an absolute path?  I would have expected that
to work.

> When I try: <exec dir="${unittest.build.dir}"
> executable="TestRequiredInput.pl" /> ant will throw an IOException
> ("File not Found")

See exec's manual page, in particular the entry of the vmlauncher
attribute.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re:[solved] Problem with exec task

Posted by Tommy Nordgren <to...@chello.se>.
On Jan 23, 2006, at 10:05 PM, Tommy Nordgren wrote:

> I have a problem with the exec task.
> I want to run an executable nested in one of my build directories.
> I've tried:
> <exec executable="${unittest.build.dir}/TestRequiredInput.pl" />
> This executes the command, but the work directory is still the base  
> directory of my build.
> I want it set to the directory containing the executable.
>
> When I tries:		
> <exec dir="${unittest.build.dir}" executable="${unittest.build.dir}/ 
> TestRequiredInput.pl" />
> exec will just return an error code of 255.
>
> When I try:
> <exec dir="${unittest.build.dir}" executable="TestRequiredInput.pl" />
> ant will throw an IOException ("File not Found")
>
> What do I need to do to successfully execute in a nested directory.
>
> The first option isn't viable, because I want generated files in  
> the same directory as the executable.

	adding the attribute resolveExecutable="yes" did solve my problem  
(On Mac OS X)
-------------------------------------
This sig is dedicated to the advancement of Nuclear Power
Tommy Nordgren
tommy.nordgren@chello.se




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org