ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: How to get env variables from property file
Date Sun, 21 Jul 2002 19:41:13 GMT
Are you going to read this or not???
if it ain't what you want, just say so... --DD

As long as you enable accessing env. vars *before* loading the properties
file, then you're OK.

<target name="test">
  <property environment="env"/>
  <property file="myconfig.properties"/>
  <echo message="${MY_JAVA_HOME}"/>
</target>

with myconfig.properties:
MY_JAVA_HOME = ${env.JAVA_HOME}

will echo either the value of JAVA_HOME is the env. var is set, or
${MY_JAVA_HOME} if it's not. Look at the documentation for <javac> for
compiling with a different JDK. This was also discussed before, so must be
in the archives. --DD

-----Original Message-----
From: Andre Susantin [mailto:andre_susantin@yahoo.com]
Sent: Friday, July 19, 2002 5:02 PM
To: ant-user@jakarta.apache.org
Subject: How to get env variables from property file


I installed jsdk 1.3.1 and 1.4 locally d:\jdk1.3.1 (JAVA_HOME) and d:\jdk1.4
(JAVA_HOME14), and I can get the  the environment
varible to ant.
The question is how, to get the env variables from property file instead of
changing the build script itself?
I want to be able to compile with a different java version based on some
property in property file.
<project name="build">
	<property environment="env" />
	<property name="build.sysclasspath" value="last"/>
	<path id="my.classpath">
		<pathelement location="${srcdir}"/>
	      <fileset dir="${env.JAVA_HOME14}/lib">
        	<include name="**/*.jar"/>
	      </fileset>
       </path>
I could use property name like "MY_JAVA_HOME"
<fileset dir="${MY_JAVA_HOME}/lib">
        	<include name="**/*.jar"/>
	      </fileset>
And override it -DMY_JAVA_HOME=d:/jdk1.4 eg., but I prefer setting it on
property file instead
Any suggestions?


Thanks
asusantin@financialengines.com

       


__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com

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