ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject RE: How to create paths that depend on a condition?
Date Mon, 24 May 2004 15:34:21 GMT
Another approach is to use pure Ant target
dependencies and conditional execution with
references:

<target name="compile" depends="setupsrc">
  <javac [...]>
    <src>
      <pathelement
        location="${src.test.dir}/share-12-13-14" />
      <dirset dir="${src.test.dir}/share-13-14">
        <selector refid="selector" />
      </dirset>
    </src>
  </javac>
</target>

<target name="setupselector" depends="13,14" />

<target name="13" if="j2ee13.available"
                  unless="j2ee14.available">
  <selector id="selector" refid="j2ee13.selector"/>
</target>

<target name="14" if="j2ee14.available">
  <selector id="selector" refid="j2ee14.selector"/>
</target>


If that makes any sense...

-Matt


--- Vincent Massol <vmassol2@pivolis.com> wrote:
> Yes, I've tried. But I don't see how it helps. They
> have to be defined
> inside fileset. They don't make sense inside direst.
> What I'm trying to
> do is build a path that depends on conditions.
> 
> Anyway, thanks for the idea! :-)
> -Vincent
> 
> > -----Original Message-----
> > From: Hagen, Christian [mailto:chagen@init-ka.de]
> > Sent: 23 May 2004 13:10
> > To: Ant Users List
> > Subject: AW: How to create paths that depend on a
> condition?
> > 
> > Hi,
> > 
> > have you tried using <patterset>s? They support
> if/unless attributes
> for
> > <include>/<exclude> elements.
> > 
> > Greetings
> > Chris
> > 
> > 
> > > -----Ursprüngliche Nachricht-----
> > > Von: Vincent Massol
> [mailto:vmassol2@pivolis.com]
> > > Gesendet: Samstag, 22. Mai 2004 10:41
> > > An: user@ant.apache.org
> > > Betreff: How to create paths that depend on a
> condition?
> > >
> > > Hi,
> > >
> > > I'd like to create a <path> that depends on some
> property
> > > being defined or not. This is for putting inside
> the <javac>
> > > task. I cannot find the right combination.
> Here's what I'd like to
> do:
> > >
> > >     <javac [...]>
> > >       <src>
> > >         <pathelement
> location="${src.test.dir}/share-12-13-14"/>
> > > ---> start here
> > >         <dirset
> dir="${src.test.dir}/share-13-14">
> > >           <and>
> > >             <depth max="0"/>
> > >             <or>
> > >               <selector if="j2ee13.available"/>
> > >               <selector if="j2ee14.available"/>
> > >             </or>
> > >           </and>
> > >         </dirset>
> > > ---> stop here
> > >
> > > [...]
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 



	
		
__________________________________
Do you Yahoo!?
Yahoo! Domains – Claim yours for only $14.70/year
http://smallbusiness.promotions.yahoo.com/offer 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message