1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
<?xml version="1.0"?>
<project name="copy-test" default="test1">
<target name="test1">
<mkdir dir="copytest" />
<copy todir="copytest">
<fileset dir="../../Phing">
<include name="Task/System/*.php" />
</fileset>
<mapper type="flatten" />
</copy>
</target>
<target name="test2">
<mkdir dir="copytest" />
<copy todir="copytest">
<fileset dir="../../Phing"/>
<mapper type="composite">
<mapper type="glob" from="*.xsl" to="*.from.xsl"/>
<mapper type="glob" from="*.xml" to="*.from.xml"/>
<mapper type="glob" from="*.php" to="*.from.php"/>
</mapper>
</copy>
</target>
<target name="test3">
<mkdir dir="copytest" />
<copy todir="copytest" enableMultipleMappings="true">
<mapper type="chained">
<mapper type="flatten"/>
<mapper type="glob" from="*.php" to="test/path/*.php"/>
<mapper>
<mapper type="glob" from="*.php" to="*.php1"/>
<mapper type="glob" from="*.php" to="*.php2"/>
</mapper>
</mapper>
<fileset dir="../../../src/Phing/Mapper"/>
</copy>
</target>
<target name="test4">
<mkdir dir="copytest" />
<copy todir="copytest" enableMultipleMappings="true">
<mapper type="firstmatch">
<mapper type="glob" from="*.xml" to="*.php1"/>
<mapper type="glob" from="*.php" to="*.php2"/>
</mapper>
<fileset dir="../../../src/Phing/Mapper"/>
</copy>
</target>
<target name="testCutDirsMapper">
<property name="input" value="copytest/testinput"/>
<property name="output" value="copytest/testoutput"/>
<mkdir dir="${input}/a/b/c"/>
<touch file="${input}/a/b/D"/>
<touch file="${input}/a/b/c/E"/>
<copy todir="${output}">
<mapper type="cutdirs" to="2"/>
<fileset dir="${input}"/>
</copy>
</target>
<target name="cleanup">
<delete dir="copytest" />
</target>
</project>
|