ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Rosenberg" <>
Subject patternset question...
Date Tue, 28 Nov 2000 23:31:16 GMT

I am creating a simple build.xml with 2 targets:


The compile needs to reference the specific .java files to be compiled,
and the clean needs to reference the specific .class files to be deleted.
The build dir is the same as the source dir.

So far, I have created 2 patternsets, one for the .java files, and one for
the .class files:

 <patternset id="sourceFiles">
  <include name="${buildDir}/"/>
  <include name="${buildDir}/"/>

 <patternset id="classFiles">
  <include name="${buildDir}/EventTime.class"/>
  <include name="${buildDir}/EventOutMail.class"/>

I am wondering if there is a more efficient way to do this as a single patternset.
Is there a way I can parameterize the file extension.  This would help avoid errors
by only itemizing the set of files to be built a single time.

I don't want to use liberal wildcards *.java or *.class, because other files may be
in the directory that I don't want to be involved in the target in question, etc.

Is there some like:

 <patternset id="filenames">
  <include name="${buildDir}/EventTime.${ext}"/>
  <include name="${buildDir}/EventOutMail.${ext}"/>

and then have it interpret the ext property differently depending on whether I am
interested in .class files or .java files.


View raw message