ant-user mailing list archives

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

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

I want to write a task that receive a file or directory and copy and rename

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

The ant call should be 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"/>
        <property name="date" value="${DSTAMP}_${TSTAMP}"/>

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

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

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

Thanks in advance, Leif

View raw message