1 | <?xml version="1.0"?> |
---|
2 | |
---|
3 | |
---|
4 | <!-- ====================================================================== |
---|
5 | Date: 2011-10 |
---|
6 | Project: SMC |
---|
7 | (based on Bruce Phillips: Coding_Actions_Struts2_Ant) |
---|
8 | ====================================================================== --> |
---|
9 | |
---|
10 | |
---|
11 | |
---|
12 | <project name="MDUTILS" default="archive" basedir="."> |
---|
13 | |
---|
14 | <description> |
---|
15 | basic targets for MDUTILS-module |
---|
16 | </description> |
---|
17 | |
---|
18 | <property file="build.properties"/> |
---|
19 | |
---|
20 | |
---|
21 | |
---|
22 | <!-- ==================== Clean Target ==================================== --> |
---|
23 | |
---|
24 | <!-- |
---|
25 | The "clean" target deletes any previous "build" and "dist" directory, |
---|
26 | so that you can be ensured the application can be built from scratch. |
---|
27 | --> |
---|
28 | <target name="clean" description="Delete old build and dist directories"> |
---|
29 | <delete dir="${dist.home}"/> |
---|
30 | <delete dir="${build.home}"/> |
---|
31 | </target> |
---|
32 | |
---|
33 | <!-- ==================== Init Target ================================== --> |
---|
34 | |
---|
35 | <!-- |
---|
36 | |
---|
37 | The "init" target is used to create the "build" destination directory, |
---|
38 | Normally, this task is executed indirectly when needed. |
---|
39 | |
---|
40 | --> |
---|
41 | <target name="init" depends="clean" description="Create build directory"> |
---|
42 | |
---|
43 | <mkdir dir="${build.home}" /> |
---|
44 | |
---|
45 | </target> |
---|
46 | |
---|
47 | <!-- ==================== Compile Target ================================== --> |
---|
48 | |
---|
49 | <!-- |
---|
50 | |
---|
51 | The "compile" target transforms source files (from your "src" directory) |
---|
52 | into class files in the appropriate location in the build directory. |
---|
53 | This example assumes that you will be including your classes in an |
---|
54 | unpacked directory hierarchy under "/WEB-INF/classes". |
---|
55 | |
---|
56 | --> |
---|
57 | <target name="compile" depends="init" description="Compile Java sources"> |
---|
58 | |
---|
59 | |
---|
60 | <mkdir dir="${build.home}" /> |
---|
61 | |
---|
62 | <javac srcdir="${source.home}" |
---|
63 | destdir="${build.home}" |
---|
64 | debug="${compile.debug}" |
---|
65 | deprecation="${compile.deprecation}" |
---|
66 | optimize="${compile.optimize}" |
---|
67 | source="1.6" target="1.6"> |
---|
68 | |
---|
69 | <classpath> |
---|
70 | <path> |
---|
71 | <fileset dir="${lib.home}" /> |
---|
72 | <!-- <fileset dir="${lib.external}" /> --> |
---|
73 | </path> |
---|
74 | </classpath> |
---|
75 | |
---|
76 | </javac> |
---|
77 | |
---|
78 | </target> |
---|
79 | |
---|
80 | <!-- ==================== Build Target ================================== --> |
---|
81 | |
---|
82 | <!-- |
---|
83 | |
---|
84 | The "build" target copies all non class files to build directory |
---|
85 | |
---|
86 | --> |
---|
87 | |
---|
88 | <target name="build" depends="compile" description="Copies all non Java classes to build directoy"> |
---|
89 | <!-- <copy todir="${build.home}"> |
---|
90 | <fileset dir="${webapp.home}" excludes="SVN,**/*.class" /> |
---|
91 | </copy> --> |
---|
92 | <copy todir="${build.home}"> |
---|
93 | <fileset dir="${source.home}" excludes="SVN,**/*.java" /> |
---|
94 | </copy> |
---|
95 | </target> |
---|
96 | |
---|
97 | <!-- ==================== Archive Target ================================== --> |
---|
98 | <!-- |
---|
99 | The "archive" target create a binary archive of all files in build.home |
---|
100 | --> |
---|
101 | <target name="archive" depends="build" description="Create binary archive of all files in dist.home"> |
---|
102 | |
---|
103 | <mkdir dir="${dist.home}" /> |
---|
104 | <!-- Create application JAR file --> |
---|
105 | <jar jarfile="${dist.home}/${app.name}.jar" |
---|
106 | basedir="${build.home}" /> |
---|
107 | </target> |
---|
108 | |
---|
109 | |
---|
110 | |
---|
111 | </project> |
---|
112 | |
---|