ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmass...@pivolis.com>
Subject RE: How to create paths that depend on a condition?
Date Sat, 22 May 2004 09:23:20 GMT
Ok, I've found a solutiob but it looks really ugly:

<dirset dir="${src.test.dir}/share-13-14">
  <and>
    <filename name="share-13-14"/>
    <or>
      <selector if="j2ee13.available"/>
      <selector if="j2ee14.available"/>
    </or>
  </and>
</dirset>

Any better solution?

Thanks
-Vincent

> -----Original Message-----
> From: Vincent Massol [mailto:vmassol2@pivolis.com]
> Sent: 22 May 2004 10:41
> To: user@ant.apache.org
> Subject: 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
> 
> The problem is that in order to use a selector (which has a "if"
> attribute), I need to use direst. However dirset lists all directories
> below a base dir. Hence the reason why I've tried using a max <depth>
of
> 0.
> 
> When I run this I get a "duplicate class" error:
> 
>     [javac]
>
E:\Dev\jakarta-cactus\framework\src\test\share-13-14\org\apache\cactus\T
> estAll.java:32:
> duplicate class: org.apache.cactus.TestAll
>     [javac] public class TestAll
>     [javac]        ^
>     [javac]
>
E:\Dev\jakarta-cactus\framework\src\test\share-13-14\org\apache\cactus\e
> xtension\jetty\T
> estJettyTestSetup.java:40: duplicate class:
> org.apache.cactus.extension.jetty.TestJettyTestSetup
>     [javac] public class TestJettyTestSetup extends TestCase
>     [javac]        ^
>     [javac] 2 errors
> 
> I think it's because some directories are added several times. Not
sure
> why though.
> 
> Is there a simpler way to achieve this? (it sounds very complex)
> 
> I'm using Ant 1.6.1.
> 
> Thanks
> -Vincent
> 
> 
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message