ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: Proper use of <uptodate> (a little off-topic)
Date Wed, 19 Dec 2001 20:02:27 GMT
--- DONNIE HALE <DHALE@longaberger.com> wrote:
> That makes sense. The only hitch is that my "determining property" is an
> environment variable. So, as you say, I have to jump through a bunch of
> <conditional> hoops to turn that into one of several different
> properties for a <target>'s "if".
> 
> Might I propose that this would be much simpler if <target> had this
> construct:
> 
> <target name="..." depends="..." if="prop.name" equals="prop.value">
>   ...
> </target>

That you won't get -- it's been proposed many times before, and thoroughly
rejected each time.

But, as Steve pointed out, using property files is the way to simplify the
whole thing for you (should've thought of that myself, but brain's not
working too good with this nasty cold)... So, once you have your props
files, you'd just need a single target to figure out which file to read in
and then read that one in. Eg:

  <target name="setProps">
    <condition property="propsFile" value="val1.properties">
      <equals arg1="${determining_property}" arg2="val1"/>
    </condition>
    <condition property="propsFile" value="val2.properties">
      <equals arg1="${determining_property} arg2="val2"/>
    </condition>
    ...
    <property file="${propsFile}"/>
  </target>

Diane


=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.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>


Mime
View raw message