ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Hodges" <eric.hod...@mongoosetech.com>
Subject Question about <arg>s in <exec>
Date Wed, 15 Nov 2000 22:23:44 GMT
I have a couple of arguments that I need to use conditionally.  If property
"label" is defined, for instance, I want to do this:

  <target name="fetch">
    <mkdir dir="${fetchToDir}" />
    <exec dir="${src}" executable="ss" >
      <env key="ssdir" value="\\puffnstuff\common\vss"/>
      <env key="ssuser" value="hodges"/>
      <arg value="get"/>
      <arg value="$$\${fetchTarget}"/>
      <arg value="-I-"/>
      <arg value="-V${label}" />
      <arg value="-GL${basedir}\${fetchToDir}"/>
    </exec>
  </target>

Otherwise, I want to do the same thing but without the "-V" argument, like
this:

  <target name="fetch">
    <mkdir dir="${fetchToDir}" />
    <exec dir="${src}" executable="ss" >
      <env key="ssdir" value="\\puffnstuff\common\vss"/>
      <env key="ssuser" value="hodges"/>
      <arg value="get"/>
      <arg value="$$\${fetchTarget}"/>
      <arg value="-I-"/>
      <arg value="-GL${basedir}\${fetchToDir}"/>
    </exec>
  </target>

I've got two of these conditional arguments, so I'd have to make 4 targets
to cover them all.  There must be a better way.  Any wisdom out there?


Mime
View raw message