ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Goldstein <sdgol...@mailandnews.com>
Subject Re: Copying a file recursively
Date Tue, 31 Jul 2001 06:03:36 GMT
Yes, I am trying to use 'cp' because I have cygwin installed and I'm
running ant from a bash shell.  So, the 'cp' command should work.

The problem with using the <copy/> task, is that, from the documentation,
I understood that is copies one or more files to a single directory.  I'm
trying to copy a single file to multiple directories.  Did I misunderstand
the docs?  Is there a better way (or any way for that matter) to do this?

Scott

Bill.J.Fellows@mail.sprint.com wrote:

> Perhaps I'm not reading this correctly, but you are trying to shell to
> the OS and execute cp, yes?  If so, cp will work just dandy for *nix
> but for Windows machines you are looking for copy (unless you have a
> cp.bat file which essentially aliases copy)
>
> Is there a problem using the <copy/> task?
>
> /bill
>
> -----Original Message-----
> From: sdgoldst [mailto:sdgoldst@MailAndNews.com]
> Sent: Monday, July 30, 2001 12:27 PM
> To: ant-user
> Cc: sdgoldst
> Subject: Copying a file recursively
>
> I'm attempting to copy a file recursively throughout a directory tree.
> Here
> is the target that I'm trying:
>
> <target name="make" depends="init">
>     <apply executable="cp" dest="." dir="." type="dir"
> failonerror="yes">
>          <targetfile/>
>          <srcfile/>
>          <fileset dir=".">
>               <patternset refid="all.sources"/>
>          </fileset>
>          <mapper type="merge" to="file_to_copy"/>
>     </apply>
> </target>
>
> where the all.source pattern is
>
>     <patternset id="all.sources">
>             <include name="**/*.java"/>
>     </patternset>
>
> When I run ant with verbose and debug options, I get the following
> output for
> this target:
>
> make:
>     [apply] Myos = Windows NT
>     [apply] cp
>
> Can anyone give me some hints on how to fix this?  Thanks.
>
> Scott
>
> ------------------------------------------------------------
> "Just a mirror for the sun...
>  My smiling eyes are just a mirror for the sun."
> ------------------------------------------------------------


Mime
View raw message