Ant: simplest way to copy over a relative list of files
- by Derek Illchuk
Using Ant, I want to copy a list of files from one project to another, where each project has the same directory structure. Is there a way to get the following to work?
<project name="WordSlug" default="pull" basedir=".">
<description>
WordSlug: pull needed files
</description>
<property name="prontiso_home" location="../../prontiso/trunk"/>
<!-- I know this doesn't work, what's the missing piece? -->
<target name="pull" description="Pull needed files">
<copy todir="." overwrite="true">
<resources>
<file file="${prontiso_home}/application/views/scripts/error/error.phtml"/>
<file file="${prontiso_home}/application/controllers/CacheController.php"/>
<!-- etc. -->
</resources>
</copy>
</target>
</project>
Success is deriving the paths automatically:
${prontiso_home}/application/views/scripts/error/error.phtml copied to ./application/views/scripts/error/error.phtml
${prontiso_home}/application/controllers/CacheController.php copied to ./application/controllers/CacheController.php
Thanks!