ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ron Coutts" <R...@quadrus.com>
Subject Setting envrionment variables from within build.xml
Date Thu, 06 Dec 2001 22:59:13 GMT
I was wondering if there's any way in Ant to set an environment variable
once before a series of <exec> tasks.  Consider the snippet of build.xml
below that is used to set the environment variable 'CL' before executing
the command line compiler 'msdev.exe'.  This XML works, but is an error
prone maintenace headache because the nested element <env> must be
repeatedly used.  Is there any way around this, such that I can set  the
environment variable 'CL' once before multiple <exec>'s?

Ron Coutts


	<target name="BuildEnvironmentPkg" depends="Init"
if="BuildConfig" >
		<exec executable="msdev.exe">
			<env key="CL" value="${MsdevDefines}" />
			<arg
line="${basedir}/Code/EnvironmentPkg/EnvironmentPkg.dsw /MAKE
'Environment - Win32 ${BuildConfig}'" />
		</exec>
		<exec executable="msdev.exe">
			<env key="CL" value="${MsdevDefines}" />
			<arg
line="${basedir}/Code/EnvironmentPkg/EnvironmentPkg.dsw /MAKE
'EnvironmentAutoTest - Win32 ${BuildConfig}'" />
		</exec>
	</target>

--
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