ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: Help with selectors
Date Thu, 12 Sep 2002 15:44:41 GMT
FWIW, I tried your solution Bruce that uses the <filename> selector, and it
didn't find the one duplicate file I was having. Reverting to using
<present> as the first selection of the <and> does work. I'm not sure why it
doesn't work with <filename>.

Selectors are a great piece of code. Thanks for them, Bruce. --DD

  <fileset id="sources"
           dir="${ds.home}/src">
    <!-- This fileset selects all files included in more
         than one module. It should be empty!!! -->
    <or>
      ...
      <and>
        <present targetdir="../gocad/src" />
        <or>
          <present targetdir="../ow-sw/src" />
          <present targetdir="../viz-fv/src" />
          <present targetdir="../examples/src" />
        </or>
      </and>
      <and>
        <present targetdir="../ow-sw/src" />
        <or>
          <present targetdir="../viz-fv/src" />
          <present targetdir="../examples/src" />
        </or>
      </and>
      <and>
        <present targetdir="../viz-fv/src" />
        <or>
          <present targetdir="../examples/src" />
        </or>
      </and>
    </or>
  </fileset>

-----Original Message-----
From: Bruce Atherton [mailto:bruce@callenish.com] 
Sent: Wednesday, September 11, 2002 4:25 PM
To: Ant Users List
Subject: Re: Help with selectors

>I have no clue how to achieve (4). Help would be greatly appreciated. --DD

Tricky. Off the top of my head, if the combinatorial explosion isn't too 
large, you could do something like:

   <fileset dir=".">
     <or>
       <and>
         <filename name="A/src/**" />
         <or>
           <present present="both" targetdir="B/src" />
           <present present="both" targetdir="C/src" />
         </or>
       </and>
       <and>
         <filename name="B/src/**" />
         <or>
           <present present="both" targetdir="A/src" />
           <present present="both" targetdir="C/src" />
         </or>
       </and>
       <and>
         <filename name="C/src/**" />
         <or>
           <present present="both" targetdir="A/src" />
           <present present="both" targetdir="B/src" />
         </or>
       </and>
     </or>
   </fileset>

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


Mime
View raw message