ant-user mailing list archives

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

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/*" />
  </patternset>

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
code">
    <mkdir dir="${classes.dir}" />
    <javac srcdir="${src.dir}"
           destdir="${classes.dir}"
      <classpath refid="classpath" />
      <patternset refid="server" />
    </javac>

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" />
        </patternset>
      </fileset>
    </copy>

Is there any way to do the above?  

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

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

Thanks,
-Bill Burton

Mime
View raw message