Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
Changing directory structure in copy

Changing directory structure in copy

2007-08-09       - By David Weintraub
Reply:     1     2     3     4     5  

I switched to the regexp mapper. That worked:

<project name="test" default="test" basedir=".">
   <target name="test">
       <delete dir="test"/>
       <mkdir dir="test"/>
       <copy todir="test">
           <fileset dir=".">
               <include name="*/db/**"/>
           </fileset>
           <mapper type="regexp"
               from="^([^/]+)/db/(.*)$$"
               to="dbutil/\1/\2"/>
       </copy>
   </target>
</project>


On 8/9/07, David Weintraub <qazwart@(protected)> wrote:
> Nope: Same issue. Finds the directories, but doesn't copy any files over.
>
> test:
>     [mkdir] Created dir: /solbright/tools/build/ADS02/neo/test
>      [copy] Copied 10 empty directories to 10 empty directories
>
> On 8/8/07, Jan.Materne@(protected) <Jan.Materne@(protected)> wrote:
> > Try
> >   <include name="*/db/"/>
> > instead of
> >   <include name="*/db/**"/>
> >
> > Jan
> >
> > >-----Urspr?ngliche Nachricht-----
> > >Von: David Weintraub [mailto:qazwart@(protected)]
> > >Gesendet: Dienstag, 7. August 2007 21:35
> > >An: Ant Users List
> > >Betreff: Re: Changing directory structure in copy
> > >
> > >I have the following build.xml:
> > >
> > ><project name="test" default="test" basedir=".">
> > >    <target name="test">
> > >        <delete dir="test"/>
> > >        <mkdir dir="test"/>
> > >        <copy todir="test">
> > >            <fileset dir=".">
> > >                <include name="*/db/**"/>
> > >            </fileset>
> > >            <mapper type="glob"
> > >                from="*/db"
> > >                to="dbutil/*"/>
> > >        </copy>
> > >    </target>
> > ></project>
> > >
> > >When I run it, the directories are copied and the names of the
> > >directories are modified, but the files under those directories aren't
> > >copied over.
> > >
> > >I tried the following (using extra asterisks) in the mapper:
> > >
> > >            <mapper type="glob"
> > >                from="*/db/*"
> > >                to="dbutil/*/*"/>
> > >
> > >But, then it doesn't copy the directories. Any ideas?
> > >
> > >
> > >On 8/6/07, David Weintraub <qazwart@(protected)> wrote:
> > >> I need to copy the following directories:
> > >>
> > >>     ../dir1/db/*
> > >>     ../dir2/db/*
> > >>     ../foo/db/*
> > >>     ../bar/db/*
> > >>
> > >> To:
> > >>
> > >>     dbutil/dir1
> > >>     dbutil/dir2
> > >>     dbutil/foo
> > >>     dbutil/bar
> > >>
> > >> Basically, I want to copy all directories:
> > >>
> > >>     ../*/db
> > >>
> > >> to:
> > >>
> > >>     dbutil/*
> > >>
> > >> I looked at mapper, but it seems to only map file names. Is there a
> > >> way to map directories in Ant without using any "optional" tasks,
> > >> manually listing the directories, or using shell callouts?
> > >>
> > >> --
> > >> David Weintraub
> > >> qazwart@(protected)
> > >>
> > >
> > >
> > >--
> > >--
> > >David Weintraub
> > >qazwart@(protected)
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: user-unsubscribe@(protected)
> > >For additional commands, e-mail: user-help@(protected)
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
>
> --
> --
> David Weintraub
> qazwart@(protected)
>


--
--
David Weintraub
qazwart@(protected)

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.