You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by David Weintraub <qa...@gmail.com> on 2007/08/06 22:39:57 UTC

Changing directory structure in copy

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@gmail.com

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


Re: Changing directory structure in copy

Posted by cuillandre frederic <fr...@airweb.fr>.
> 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/*

why don't you use the copy tag
http://ant.apache.org/manual/CoreTasks/copy.html
or copydir tag
http://ant.apache.org/manual/CoreTasks/copydir.html

> 
> 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?



Re: Changing directory structure in copy

Posted by David Weintraub <qa...@gmail.com>.
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 <qa...@gmail.com> 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@gmail.com
>


-- 
--
David Weintraub
qazwart@gmail.com

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