ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Hodges <harmo...@swbell.net>
Subject RE: Question about <arg>s in <exec>
Date Thu, 16 Nov 2000 17:46:06 GMT
I figured it out a few minutes after I sent the last e-mail.  I did this:

  <target name="fetch" depends="setUpArgs">
    <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="${versionArgument}" />
      <arg value="-GL${basedir}\${fetchToDir}"/>
    </exec>
  </target>

  <target name="setUpArgs" if="label">
      <property name="versionArgument" value="-V${label}" />
  </target>

setUpArgs creates the versionArgument property.  SourceSafe complains about
the ${versionArgument} argument when label isn't defined, but it goes ahead
anyway.

> -----Original Message-----
> From: Stanislas Pinte [mailto:stan.pinte@wanadoo.be]
> Sent: Thursday, November 16, 2000 7:20 AM
> To: ant-user@jakarta.apache.org
> Subject: Re: Question about <arg>s in <exec>
>
>
> At 07:07 PM 11/15/00 -0800, you wrote:
> >Conditionally set a property, ${Vflag}, then pass that in the <arg>
> >instead of hard-coding the -V${label} in the <arg>.
>
>
> Could you give an example, please? I couldn't understand what you mean.
>
> Stan
>
>
> >Diane
> >
> >--- Eric Hodges <eric.hodges@mongoosetech.com> wrote:
> > > 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?
> >
> >=====
> >(holtdl@yahoo.com)
> >
> >
> >
> >__________________________________________________
> >Do You Yahoo!?
> >Yahoo! Calendar - Get organized for the holidays!
> >http://calendar.yahoo.com/
>
> -------------------------------------------------------
>
> Stanislas Pinte
> Software engineer - Trademine-europe
> Tel: 00 32 486 67 78 86
>
> -------------------------------------------------------
>


Mime
View raw message