Le Saturday 09 May 2009 13:27:45 Rajesh Kumar (IN4774), vous avez écrit :
> Hi,
>
> I want to set one properties HOMEDIR in build.xml which will be set through
> user logged in the current system..
>
> How to read Unix home directory and put that value in build.xml
>

Use ant's <property> with the environment attribute:

----
<project name="test" default="myhome">
    <property environment="env"/>

    <target name="myhome">
        <echo message="My home is ${env.HOME}"/>
    </target>
</project>
----

As you can see, you can source whatever your environment is with a given 
prefix (here "env", it could have been anything else) and then access any 
defined environment variable with ${env.xxxx}.

HOME is standard on Unix. YMMV.

-- 
Francis Galiegue
f...@one2team.com
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
One2team
40 avenue Raymond Poincaré
75116 Paris

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

Reply via email to