Click to search Andy Jarrett.co.uk RSS feed

Loading Twitter

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 plain print about
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3*
4* Name: is anything you want it to be, for this example its build-mg
5* default: is the first target (method) to run
6* basedir: is the base directory, this can be any local location
7*
8-->

9
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>

Comments Comments (0) | Print Print | Send Send | 6023 Views

If you like what you see on the website and/or this post has helped you out in some way please consider donating to help keep me in beer vodka. The donations are made through Paypal, which accepts almost any credit card or eCheck.

(Comment Moderation is enabled. Your comment will not appear until approved.)
BlogCFC by Raymond Camden + Twitter @AndyJ + ColdFusion jobs + Contact Me + Snippets/Downloads + RSS .