ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leif Hanack" <leif.han...@t-systems.com>
Subject Copy file or dir and changing name?
Date Tue, 01 Apr 2003 11:34:42 GMT
Hello,

i'm struggling with the following task and hope you have some hints and help
available.

I want to write a task that receive a file or directory and copy and rename
it.
e.g.:

./file1.txt  -> ./file1_20020401_1200.txt
./file2      -> ./file2_20020401_1200
./dir1       -> ./dir1_20020401_1200

The ant call should be s.th. like:
	$ant -f copy.xml -Dsource=file1.txt
	$ant -f copy.xml -Dsource=dir2

So far i started with:

<?xml version="1.0"?>
<project name="copy" basedir="." default="build">
    <target name="init" description="initialize ant">
        <property name="source" value="test"/>
        <tstamp/>
        <property name="date" value="${DSTAMP}_${TSTAMP}"/>
    </target>

    <target name="copy" depends="init" description="">
        <echo message="${source}" />
        <echo message="${date}" />

        <!-- copy-Task with embedded mapper regexp or glob ?? -->
    </target>

    <target name="build" depends="init,copy" description="">
    </target>
</project>


Thanks in advance, Leif


Mime
View raw message