ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Gregoire <paul.grego...@hellonetwork.com>
Subject RE: Environment Variable
Date Thu, 14 Feb 2002 18:15:01 GMT
Heres an example put it at the top of your script..

<project name="myproject" default="compile" basedir=".">
	<property environment="env" />


After putting this line in your scripts you can access environmental vars
like so..

	<target name="init">
		<!-- Create the time stamp -->
		<tstamp />
		<echo message="OS: ${os.name}"/>
		<echo message="${ant.version}"/>
		<!-- Create the build directory structure used by compile
-->
		<mkdir dir="${build}" />
		<mkdir dir="${dist}" />
		<!-- Display java home -->
		<echo message="Java home: ${env.JAVA_HOME}" />
	</target>



-----Original Message-----
From: Pravin Pillai [mailto:ppillai@betasphere.com]
Sent: Wednesday, February 13, 2002 7:18 PM
To: Ant Users List
Subject: Environment Variable



Guys:

Can i access an environment variable using ant???



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

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


Mime
View raw message