Home | Blog | Twitter @AndyJ | Contact Me | Snippets/Downloads | RSS

Ant basics: Copying directories

Thanks to Eclipse making Ant so simple to use I've got it doing a few tasks for me. Well I thought I'd show how simple it is to use. Below is a simple Ant build.xml that I use to copy the ModelGlueAppliactionTemplate files over to a new project. In a nutshell it copies a bunch of files and directories from one location into the location the build.xml was ran from.
   view plainprintabout
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 *
 * Name: is anything you want it to be, for this example its build-mg
 * default: is the first target (method) to run
 * basedir: is the base directory, this can be any local location
 *
 -->

 
10  <project name="build-mg" default="deploy" basedir=".">
11  
12      
13      <!--
14      *
15      * Description: Describes what the build file does
16      *
17      -->

18      <description>
19   Builds a new ModelGlue project
20   </description>
21  
22      
23      <!--
24      *
25      * The property tag is just setting a variable.
26      * name: variable name. You can reference this via ${xxxxx}
27      * value: variable value
28      *
29      -->
    
30   <property name="mgfolder" value="/Path2ModelGlueDirectory/ModelGlue/modelglueapplicationtemplate" />
31  
32      
33      <!--
34      *
35      * Target: In effect this is your method
36      * The next set of tags are self explanitory.
37      *    
38      -->

39      <target name="deploy">
40       <copy todir="${basedir}">
41       <fileset dir="${mgfolder}"/>
42       </copy>            
43      </target>
44  
45      
46          <!--
47          *
48          * Thats it
49          *
50          -->

51  </project>
TweetBacks
Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
BlogCFC / created by Raymond Camden / running version 5.9.5.003 / Contact AndyJarrett.com / Pet Rescue SOS www.redgiraffes.co.uk