Is there a better way to do what I'm doing?

<project name="test" default="default">
  <property name ="devProperty" value="server1" />
  <property name ="qaProperty" value="server2" />
  <property name ="stageProperty" value="server3" />
  <property name ="prodProperty" value="server4" />

  <target name="default">
    <foreach item="String" 
             in="dev,qa,stage,prod"
             delim="," property="environment">
      <property name="serverNameByEnvironment"
value="${environment}Property"/>
      <property name="ServerName"
value="${property::get-value(serverNameByEnvironment)}"/>
      <echo message="${ServerName}"/>
    </foreach>
  </target>
</project>

Thanks,
Eric

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to