ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@bost.de>
Subject Re: file lists
Date Mon, 30 Oct 2000 12:40:44 GMT
>>>>> "DS" == David Sacher <david.sacher@financity.co.uk> writes:

 DS> I have a directoy of libraries (lib), but I don't want to use all
 DS> of them in the project I'm building. So instead of copying all
 DS> the libraries to the delployment directory by

 DS> <copydir src="lib" dest="${deploy.home}/WEB-INF/lib"/>

 DS> i want only some of them. I obviously can use <copyfile> for
 DS> that.

No, use a nested fileset and copy. The files you want to copy can be
specified in a patternset (and later be reused in a classpath as
well).

<patternset id="myfiles">
  <include name="**/file1.jar" />
  <include name="**/file2.jar" />
</patternset>

<target ...>
  <copy todir="${deploy.home}/WEB-INF/lib">
    <fileset dir="lib">
      <patternset refid="myfiles" />
    </fileset>
  </copy>
</target>

<target ...>
  <java ...>
    <classpath>
      <pathelement ... />
      <fileset dir="lib">
        <patternset refid="myfiles" />
      </fileset>
    </classpath>
  </copy>
</target>

Hope this helps

        Stefan

Mime
View raw message