ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <>
Subject Evaluation of Patterns
Date Tue, 12 Dec 2000 04:09:54 GMT

I have just been kicking around some ideas with respect to evaluation of
Patterns. When do we want it to occur ? Should it occur when the
Pattern/PatternSet is bound to a name or should it be when a patternset is
applied to get a value (as in FileSet).

ie given the following sequence 

<property name="basepackage" value="com/biz/foo" />

<patternset id="mypattern" >
  <include name="${basepackage}/" />

<property name="basepackage" value="com/biz/bar" />

<fileset dir="${client.src}" >
  <patternset refid="mypattern" />

What would you expect to be included. Would it be
"${client.src}/com/biz/foo/" or
"${client.src}/com/biz/bar/" ?

I used to think it was the first one but I think I have changed my mind. A
few people have wanted this on ant-user but I never thought it would be
useful. However I noticed that it is a common pattern to layour similar
directory structures within projects based on the same framework.

For example IIRC Turbine used to have this requirement (and still does?).
It used to layout a "module" as


and it's architecture mandated that.

Now if we want to reuse patternsets then I believe that the best way to do
that would be to evaluate the patterns when they are applied to form a
fileset. Thus the same patternset could be used for multiple turbine
modules by changing value of basepackage and using the paternset in
multiple filesets.

Comments ?



| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |

View raw message