You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Frank W. Zammetti" <fz...@omnytex.com> on 2005/08/25 21:13:52 UTC

Copy task that excludes directories

Hi all,

I'm trying to set up a task that will copy an entire directory tree
starting at a given root directory, but which will EXCLUDE certain
directories in the tree.

I started with the entire copy:

<target name="test">
  <delete dir="${ddir}/project" />
  <mkdir dir="${ddir}/project" />
  <copy toDir="${ddir}/project">
    <fileset dir="${root}">
      <exclude name="**/*src*" />
    </fileset>
  </copy>
</target>

Basically, I'm trying to exclude a single directory: src in WEB-INF (I'm
copying a webapp obviously).

This part was easy, and it works.  But, I can't seem to figure out the
exclusion... I can't use a <dirset> in <copy> apparently, and the
<copydir> task is deprecated.  I don't see a way to do it with the <copy>
task alone.  Any ideas?  Thanks!

Frank

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Copy task that excludes directories

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Ugh.  That did it.

I wish it was something more complex so I didn't have to feel so stupid
right now :(

Thank you Alexey!

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Thu, August 25, 2005 3:20 pm, Alexey N. Solofnenko said:
> You need to put a slash at the end. For example: name="WEB-INF/src/"
>
> - Alexey.
>
> Frank W. Zammetti wrote:
>> Hi all,
>>
>> I'm trying to set up a task that will copy an entire directory tree
>> starting at a given root directory, but which will EXCLUDE certain
>> directories in the tree.
>>
>> I started with the entire copy:
>>
>> <target name="test">
>>   <delete dir="${ddir}/project" />
>>   <mkdir dir="${ddir}/project" />
>>   <copy toDir="${ddir}/project">
>>     <fileset dir="${root}">
>>       <exclude name="**/*src*" />
>>     </fileset>
>>   </copy>
>> </target>
>>
>> Basically, I'm trying to exclude a single directory: src in WEB-INF (I'm
>> copying a webapp obviously).
>>
>> This part was easy, and it works.  But, I can't seem to figure out the
>> exclusion... I can't use a <dirset> in <copy> apparently, and the
>> <copydir> task is deprecated.  I don't see a way to do it with the
>> <copy>
>> task alone.  Any ideas?  Thanks!
>>
>> Frank
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>
> --
> ------------------------------------------------------------------------
> / Alexey N. Solofnenko
> MDL Information Systems, Inc.
> work: 510-357-2222x1726
> home: http://trelony.cjb.net/
> /
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Copy task that excludes directories

Posted by "Alexey N. Solofnenko" <A....@mdl.com>.
You need to put a slash at the end. For example: name="WEB-INF/src/"

- Alexey.

Frank W. Zammetti wrote:
> Hi all,
>
> I'm trying to set up a task that will copy an entire directory tree
> starting at a given root directory, but which will EXCLUDE certain
> directories in the tree.
>
> I started with the entire copy:
>
> <target name="test">
>   <delete dir="${ddir}/project" />
>   <mkdir dir="${ddir}/project" />
>   <copy toDir="${ddir}/project">
>     <fileset dir="${root}">
>       <exclude name="**/*src*" />
>     </fileset>
>   </copy>
> </target>
>
> Basically, I'm trying to exclude a single directory: src in WEB-INF (I'm
> copying a webapp obviously).
>
> This part was easy, and it works.  But, I can't seem to figure out the
> exclusion... I can't use a <dirset> in <copy> apparently, and the
> <copydir> task is deprecated.  I don't see a way to do it with the <copy>
> task alone.  Any ideas?  Thanks!
>
> Frank
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>   

-- 
------------------------------------------------------------------------
/ Alexey N. Solofnenko
MDL Information Systems, Inc.
work: 510-357-2222x1726
home: http://trelony.cjb.net/
/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org