Re: a tricky case of running an executable from an ant build script

Alan Snyder <[email protected]> Thu, 24 Dec 2020 14:01:51 -0800
Newsgroups gmane.comp.jakarta.ant.user
Message-ID <[email protected]>
That’s not the point. I don’t want to change the build script, I want to change the environment in which it is run.

> On Dec 24, 2020, at 12:48 PM, <[email protected]> <[email protected]> wrote:
> 
> If you know where the executable is located, you could set the "executable" attribute of <exec>.
> Or set the "dir" attribute tot he directory containing the executable you want to start.
> Or provide a nested <env key="Path" .../> element.
> 
> Jan
> 
> -----Ursprüngliche Nachricht-----
> Von: Alan Snyder <[email protected]> 
> Gesendet: Samstag, 19. Dezember 2020 22:46
> An: Ant Users List <[email protected]>
> Betreff: a tricky case of running an executable from an ant build script
> 
> I have an ant script that runs an executable without specifying the full path of the executable.
> 
> If I run ant from the shell, then it finds the executable on my $PATH, which is what I want.
> (I do not specify searchpath=“true”, so perhaps I do not understand what that does, or the documentation is wrong.)
> 
> The case of interest is where I perform the build directly within a Java application process.
> When I do this, the $PATH that the build script sees is the $PATH of the application, and presumably that is the $PATH that is used to find the executable.
> 
> Unfortunately, if my application is a bundled macOS application, it has a minimal $PATH:
>   /usr/bin:/bin:/usr/sbin:/sbin 
> 
> Is there a way that within my application I can configure ant with a different $PATH to provide to the build script, so that it will find the executable?
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>