ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <levylamb...@tiscali-dsl.de>
Subject Re: Sample for <exec> task with file attribute
Date Sat, 21 Jun 2003 10:32:02 GMT
Tamas, from the documentation this means the following :
if you do this
<exec executable="myprog">
     <env key="SOME_FILE_LOCATION" file="../../etc/somefile"/>
</exec>
ant will execute myprog with an environment variable called
SOME_FILE_LOCATION, whose value is going to be ../../etc/somefile
resolved according to ant rules, which means that the base directory of the
build file will be prepended to ../../etc/somefile.

So no, this is not a way to import environment variables from a file.

You can invoke a shell script from ant if you want to have your environments
variables in a file.
In this case just pay attention to the fact that for shell scripts, the
executable is your shell interpreter and the shell script an argument.
For instance for a Bourne Shell script, you should do :

<exec executable="/bin/sh">
      <arg value="myscript.sh"/>
</exec>

Antoine

----- Original Message -----
From: "Tamas Nagy" <nagytam@web.de>
To: <user@ant.apache.org>
Sent: Saturday, June 21, 2003 10:57 AM
Subject: Sample for <exec> task with file attribute


> Hello,
>
> I'm looking for a sample for the <exec> task, which shows how to use the
> file attribute. The manual only states:
> "The value for the env. Variables". Will be replaced by the absolute
> filename of the file by Ant"
> Is this allows importing the environment variables from a file?
>
> Thanks,
> Tamas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>



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


Mime
View raw message