ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <jakarta-...@ehatchersolutions.com>
Subject Re: test environment variable and if statement
Date Tue, 05 Feb 2002 02:30:10 GMT

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


Mime
View raw message