ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Burton" <>
Subject Reusing <patternset> with a subset?
Date Wed, 06 Dec 2000 13:58:11 GMT

I have a <patternset> like the following.  Since the src.dir has many more
packages, I'm explicitly specifying each package I want to be included in
the compile and jar targets:

  <patternset id="server">
    <include name="com.myco.server/*" />
    <include name="com.myco.server.config/*" />
    <include name="com.myco.server.connector/*" />

As I'm building each of my jars with just the CLASSPATH it needs, I'm also
limiting the files passed to my <javac> this way as follows:

  <target name="compile" depends="vssget" description="Compiles source
    <mkdir dir="${classes.dir}" />
    <javac srcdir="${src.dir}"
      <classpath refid="classpath" />
      <patternset refid="server" />

The patternset seems to work fine here.  But now, I want to copy any
.properties files from the same directories using the copy task.  What I'd
like to be able to do is reuse this patternset in a fileset but further
qualify it to find just **/*.properties files.  It would be nice if
something like the following worked:

    <copy todir="${classes.dir}">
      <fileset dir="${src.dir}">
        <patternset refid="server">
          <!-- only include files found in the patternset -->
          <include name="**/*.properties" />

Is there any way to do the above?  

  <patternset id="" refid="server">
    <include name="**/*.properties" />

Or maybe this, so you can create a new patternset as a subset of an
existing one?

-Bill Burton

View raw message