You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Eric Hodges <er...@mongoosetech.com> on 2000/11/15 23:23:44 UTC

Question about s in

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?