ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phillip Lord <>
Subject pattern set problems
Date Thu, 14 Aug 2003 17:56:05 GMT

I'm having a problem with the patternset type, which I've come across
while developing our antmerge tool.

Take a build file like so...

<project name="hello" default="test">

  <property name="base"

  <property name="jar-dependencies" value=""/>

  <patternset id="test-pattern">
    <patternset includes="${jar-dependencies}"/>

  <target name="test">
    <copy todir=".">
      <fileset dir="${base}">
        <patternset refid="test-pattern"/>


Imagine /ext contains lots of jars, some of which I want to obtain. 

As it stands this build file will copy everything in the directory. If
I change 

  <property name="jar-dependencies" value=""/>

to equal  

  <property name="jar-dependencies" value="ant.jar"/>

for instance, it only copies ant.jar. 

I find this a little counter intuitive as, in the first case, I have
not asked it to include anything at all. But still it does.

Now the behaviour that I want, is not to include anything at all. I
have tried a few variations. So

  <patternset id="test-pattern">
    <patternset includes="${jar-dependencies}" excludes="**"/>

fails because ant appears to include, then exclude, rather than vice

The only solution that I can come up with is by default include...

  <property name="jar-dependencies"

which then works as I want, but it seems rather nasty. 

Has anyone get a better idea?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message