Oops.... correction.... switch the order of two lines:
<property environment="env"/>
<property file="build.properties"/>
<property name="helper.jar" value="${env.HELPER_JAR}"/>
<path id="classpath">
<pathelement location="${helper.jar}"/>
</path>
And, if its not specified in -D, environment, or build.properties then it
will be set to literally "${env.HELPER_JAR}" in this scheme.
----- Original Message -----
From: "Erik Hatcher" <jakarta-ant@ehatchersolutions.com>
To: "Ant Users List" <ant-user@jakarta.apache.org>
Sent: Monday, February 04, 2002 9:30 PM
Subject: Re: test environment variable and if statement
>
> ----- Original Message -----
> From: "Diane Holt" <holtdl@yahoo.com>
> > But you don't really want to rely on environment variables that are just
> > (supposedly) set, do you? IMO, that's even scarier than hard-coding
full
> > paths in the build-file (which I'm also not altogether for, but it's
> > better than going with env vars -- unless they're set in a file
somewhere
> > that's source-controlled).
>
> Fine then! :)
>
> <property environment="env"/>
> <property name="helper.jar" value="${env.HELPER_JAR}"/>
> <property file="build.properties"/>
> <path id="classpath">
> <pathelement location="${helper.jar}"/>
> </path>
>
> Where build.properties is platform-specific, if you like. Or load by
> machine name (and yes, you can get a common property for the machine name
> using a couple of tricks too) <property
file="${machine.name}.properties"/>
> so that you can have them all under source code control and such. (BTW,
> Gump uses machine name for its workspace setting).
>
> So, in the above, helper.jar can be defined in this order: -D,
environment,
> or build.properties, whichever defines it first of those.
>
> Erik
>
>
>
> --
> 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>
|