ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt_Con...@i2.com
Subject Re: Combining PatternSets with Path elements
Date Thu, 09 Nov 2000 17:03:41 GMT

Sort of.  What I had in mind was the following:

<patternset id="packages">
  <include name="com/foo/util/*" />
  <include name="com/foo/bar/*" />
</patternset>

<target name="compile">
     <javac>
          <!-- This is fine because javac task knows to only look for
*.java files -->
          <patternset refid="packages"/>
     </javac>
</target>

<target name="some_other_task">
     <!-- I want this task to copy all *.foo files elsewhere, but can't
figure out
     how to make the copy task only look for *.foo files, and not others.
-->
     <copy todir="outputdir">
          <fileset>
               <patternset refid="packages"/>
          </fileset>
     </copy>
</target>

I can't figure out how to reuse the patternset in some other task (just
using copy as an example) with different extensions - the patternset
selects all files, and not _just_ the *.foo files.  Any ideas? Thanks,

Matt



<patternset id="component1">
  <include name="**/com/foo/util/*" />
  <include name="**/com/foo/bar/*" />
</patternset>

> Where I get stuck is figuring out how to be able to specify a list
> of package directories in the project xml and then be able to use
> that list to limit my make rules to those directories, i.e. my javac
> task would only compile the java files in those directories, my
> ejbcompiler task would only process the ejbs in those directories,
> etc.

<javac>
  <patternset refid="component1" />
</javac>

for example.

Unfortunately not all tasks support patternsets as the should, javadoc
being a prominent exception.

I think this is what you've been asking for, but I'm not sure.

Stefan





Mime
View raw message