Grokbase Groups Ant user July 2001
FAQ
Hello!

I want to use a <patternset> in a <javac> task.

The ant manual says on the <javac> page:
"This task forms an implicit FileSet and supports all attributes of
<fileset> (dir becomes srcdir) as well as the nested <include>,
<exclude> and <patternset> elements."

And the DTD says that it is possible, too, but I can't find the right
syntax.

My aim is to use the same patternset with javac and copy, so that I
needn't list the directories two times. (The patternset contains the
directories whose *.java files should be compiled and whose resources
should be copied. Other files shouldn't be copied and all other
direcotries shouldn't be regared.)

I've tried different approaches the following code is one:

<mapper id="resources" type="regexp"
from="^((.+)\.gif)|((.+)\.jpeg)|((.+)\.jpg)|((.+)\.properties)$$" to="\0"/>

<patternset id="ps-ep-resource" >
<include name="*"/>
<include name="images\*"/>
<include name="images\small\*"/>
<include name="images\tiny\*"/>
</patternset>

<target name="ep-resource">
<javac
destdir="${PRJ_CLASSES}"
classpath="${myenv.CLASSPATH}"
debug="on"
deprecation="off"
failonerror="on"
>
<!-- scr or scrdir is missing here -->
<patternset refid="ps-ep-resource"/>
</javac>
<copy todir="${PRJ_CLASSES}/com/epag/resource" includeEmptyDirs="no">
<mapper refid="resources"/>
<fileset dir="${PRJ_SOURCE}/com/epag/resource">
<patternset refid="ps-ep-resource"/>
</fileset>
</copy>
</target>

Can you give me a hint, please?

Thank you!

Steffen

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
groupuser @
categoriesant
postedJul 10, '01 at 11:46a
activeJul 10, '01 at 1:33p
posts2
users2
websiteant.apache.org

2 users in discussion

Stefan Bodewig: 1 post Steffen Euch: 1 post

People

Translate

site design / logo © 2018 Grokbase