ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael George <>
Subject a task for selecting among possible options?
Date Fri, 17 Jul 2009 02:44:55 GMT

I'm trying to clean up our build process, and one of the problems is 
that everyone on the team uses a different configuration mechanism 
(environment vars, properties files, manual config,...).  In trying to 
be backwards compatible with everyone's process I find I would like a 
task that sets a property by selecting the first valid item from a list 
of possibilities.  For example, I'd like to able to write something like

<choice property="foo">
  <condition> <available file="@{}/foo.txt" /> </condition>

  <option value="${env.FOO}" />
  <option value="${basedir}/foo" />
    <dirset dir="/usr" includes="**/foo*"/>

To mean "set foo to the first of env.FOO, ${basedir}/foo, and /usr/*/foo 
that contains the file foo.txt."  I'd also like to perhaps have the 
option of prompting the user if multiple valid choices are found (for 
example, with select="first" or select="prompt").

Does anyone know of any tasks that would make this kind of configuration 
easy, before I dive in and try to write one myself?  If not, would 
people find this useful if I code it up and submit it to ant-contrib?



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message