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:13:57 GMT
And actually, refactoring my first example with my second one:

    <property environment="env"/>
    <property name="helper.jar" value="${env.HELPER_JAR}"/>
    <path id="classpath">
      <pathelement location="${helper.jar}"/>
    </path>

This hides that you're dealing with environment variables further down, so
you could set it at the command-line much cleaner or load it from a
properties file:

    ant -Dhelper.jar=<path to helper.jar>

Erik



----- Original Message -----
From: "Ray Tayek" <rtayek@mediaone.net>
To: "Ant Users List" <ant-user@jakarta.apache.org>
Sent: Monday, February 04, 2002 8:59 PM
Subject: Re: test environment variable and if statement


> At 08:44 PM 2/4/02 -0500, you wrote:
> >How about using this instead...
> >
> >     <pathelement location="${helper.jar}"/>
> >
> >and define ${helper.jar} either from an always-loaded property file???
>
> i'd much rather pick it up from an environment variable if possible.
>
> >Fixed paths are BAD in build.xml - use properties and other such
techniques
> >and use indirection to make life much more pleasant and controllable!  :)
...
>
> ok
>
> thanks
>
>
>
> >----- Original Message -----
> >From: "Ray Tayek" <rtayek@mediaone.net>
> >To: <ant-user@jakarta.apache.org>
> >Sent: Monday, February 04, 2002 8:36 PM
> >Subject: test environment variable and if statement
> >
> >
> > > hi, can could someone please give me an example of examining an
> >environment
> > > variable and the using an if?
> > >
> > > i am trying to put in different classpaths depending on whether i am
on
> > > windoze or linux.
> > >
> > > something like:
> > >
> > > if ${unix}=true
> > >          then <pathelement location="foo/helper.jar"/>
> > >          else <pathelement location="c:\lbar\helper.jar"/>
> > > fi
> > >
> > > or maybe classpath has an attrubute if or unless that i could use?
where
> > > can i find a list of attributes?
> > >
> > > thanks
> > >
> > > ---
> > > ray tayek http://home.earthlink.net/~rtayek/
> > > actively seeking telecommuting work
> > > orange county java users group http://www.ocjug.org/
> > > hate spam? http://samspade.org/ssw/
> > >
> > >
> > > --
> > > 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>
>
> ---
> ray tayek http://home.earthlink.net/~rtayek/
> actively seeking telecommuting work
> orange county java users group http://www.ocjug.org/
> hate spam? http://samspade.org/ssw/
>
>
> --
> 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