On mardi, mars 26, 2002, at 01:42 , Erik Hatcher wrote:
> One workaround would be to use the excludesfile capabilities of
> patternsets - and define your patterns in files.
>
External files have drawbacks especially when there is more elegant
solution IMHO
1: They defeat the principle of locality.
"Ant" and the traditional "build.xml" file achieve a great level of
cohesion and self containment. External files (unless they are
automatically generated by tasks just before they are used by another
task) just ruin this nice level of achievement.
2: They often don't pay for the burden they impose.
You have to maintain the "build.xml" file AND the external files, you
have to backup both, you have to commit both under cvs, you have to take
care to not delete anyone of them, etc. Bref, external file considerably
increase the burden, no more you can say "everything is in the build.xml
file".
3: They tends to bloat the project directory.
Either they are visible and they incur the risk to be deleted at the
next spring cleaning, or they are invisible but in this case they are
PITA to edit.
When there are other, more elegant, solutions I prefer to not use
external file.
Thus the solution I found so far is to define a property that list the
gremlin files I want to exclude, then use this property in the
patternset's "excludes" attribute for all my defined patternset.
<property name="gremlin_files"
value="**/Icon\r:**/.DS_Store:**/package cache/**"/>
<patternset id="set1" excludes="${gremlin_files}">
<include name="**/*.java"/>
<exclude name="**/Test_*.java"/>
</patternset>
. . .
<patternset id="set9999" excludes="${gremlin_files}">
<include name="**/Test_*.java"/>
</patternset>
P.S. I don't understand why patternset doesn't have a nested element for
the "excludes"/"includes" (with an 's') attribute ??
ZC.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>