-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
233 lines (223 loc) · 7.48 KB
/
build.xml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<project name="jbones_estimator" default="builditDebug" basedir=".">
<property file="${ant.project.name}_build.properties" />
<description>jbones_estimator build file</description>
<!--Set up classpath-->
<path id="project.class.path">
<fileset dir="${appLibDir}">
<include name="*.*" />
</fileset>
<pathelement path="${buildDir}" />
</path>
<!--Build the default javadocs-->
<target name="doc" depends="cleanDoc, createDocDir" description="generate javadocs">
<javadoc
sourcePath="${javaSrcDir}"
destdir="${javaDocDir}"
classpath= "project.class.path"
packagenames="${projectPackages}"/>
</target>
<!--Build the private javadocs-->
<target name="docprivate" depends="cleanDoc, createDocDir" description="generate javadocs">
<javadoc
private = "true"
sourcePath="${javaSrcDir}"
destdir="${javaDocDir}"
classpath= "project.class.path"
packagenames="${projectPackages}"/>
</target>
<!--Clean up all the created files-->
<target name="cleanDoc" description="clean javadocs">
<delete dir="${javaDocDir}" />
</target>
<!--Create javadoc directory-->
<target name="createDocDir" >
<mkdir dir="${javaDocDir}" />
</target>
<!--Create all the build directories-->
<target name="createBuildArea" >
<mkdir dir="${buildDir}" />
<mkdir dir="${buildDir}/test" />
</target>
<!--Copy the files to build area-->
<target name="copyFilesToBuildArea" depends="createBuildArea" >
<copy todir="${buildDir}/META-INF">
<fileset dir="${METAINFDir}">
<exclude name="**/*.db"/>
</fileset>
</copy>
</target>
<!--Copy the config jars to lib-->
<target name="copyConfigJarsToLib" >
<copy todir="${appLibDir">
<fileset dir="${deployDir}">
<include name="${ant.project.name}-config.jar"/>
<exclude name="**/*.db"/>
</fileset>
</copy>
</target>
<!--Compile the java source files-->
<target name="compile" depends="createBuildArea">
<javac srcdir="${javaSrcDir}" destdir="${buildDir}">
<classpath refid="project.class.path" />
</javac>
</target>
<!--Compile the java source files with debug statements-->
<target name="compileDebug" depends="clean,createBuildArea,copyFilesToBuildArea">
<echo message="using java version:${ant.java.version}" />
<javac srcdir="${javaSrcDir}" destdir="${buildDir}" debug="true" debuglevel="lines,vars,source">
<classpath refid="project.class.path" />
</javac>
</target>
<!--Clean up all the created files-->
<target name="clean" description="clean up">
<delete dir="${buildDir}" />
</target>
<!--Jar the class files-->
<target name="createJar" depends="cleanJar,compile">
<jar
jarfile="${deployDir}/${ant.project.name}.jar"
update="no"
basedir="${buildDir}" >
<include name="META-INF/**" />
<include name="**/*.class" />
<exclude name="**/*.java" />
</jar>
</target>
<!--Jar the debug enabled class files -->
<target name="createJarDebug" depends="cleanJar,compileDebug">
<jar
jarfile="${deployDir}/${ant.project.name}.jar"
update="no"
basedir="${buildDir}"
manifest="${METAINFDir}/MANIFEST.MF" >
<include name="**/*.class" />
<exclude name="**/*.java" />
</jar>
</target>
<!--Jar the config files-->
<target name="createJarConfig" depends="cleanJarConfig">
<jar
jarfile="${deployDir}/${ant.project.name}-config.jar"
update="no"
basedir="${configDir}" >
<include name="**/*" />
</jar>
</target>
<!--War the files-->
<target name="createWar" depends="cleanWar,compile">
<war destfile="${deployDir}/${ant.project.name}.war" webxml="${WEB-INFDir}//web.xml">
<fileset dir="${configDir}">
<include name="velocity.properties" />
<include name="StripesResources.properties" />
</fileset>
<fileset dir="${javaSrcDir}">
<include name="index.html" />
</fileset>
<lib dir="${appLibDir}">
<exclude name="**/*ant*.jar" />
<exclude name="${ant.project.name}-config.jar" />
<exclude name="**/*servletapi*.jar" />
<include name="**/*.jar" />
</lib>
<lib dir="${deployDir}">
<include name="${ant.project.name}.jar" />
<exclude name="${ant.project.name}-config.jar" />
</lib>
<webinf dir="${WEB-INFDir}">
<exclude name="web.xml" />
<include name="**/*.xml" />
<include name="/templates/**.*" />
</webinf>
</war>
</target>
<!--War the files-->
<target name="createWarDebug" depends="cleanWar,compileDebug">
<war destfile="${deployDir}/${ant.project.name}.war" webxml="${WEB-INFDir}//web.xml">
<!--classes dir="${buildDir}">
<include name="**/*.class" />
<include name="**/*.vm" />
<include name="**/*.xml" />
</classes-->
<fileset dir="${configDir}">
<include name="velocity.properties" />
<include name="StripesResources.properties" />
</fileset>
<fileset dir="${javaSrcDir}">
<include name="index.html" />
</fileset>
<lib dir="${appLibDir}">
<exclude name="**/*ant*.jar" />
<exclude name="**/*servletapi*.jar" />
<exclude name="${ant.project.name}-config.jar" />
<include name="**/*.jar" />
</lib>
<lib dir="${deployDir}">
<include name="${ant.project.name}.jar" />
<include name="${ant.project.name}-config.jar" />
</lib>
<webinf dir="${WEB-INFDir}">
<exclude name="web.xml" />
<include name="**/*.xml" />
<include name="/templates/**.*" />
</webinf>
</war>
</target>
<!--Clean up the War-->
<target name="cleanWar" >
<delete>
<fileset dir="${deployDir}">
<patternset>
<include name="${ant.project.name}.war"/>
</patternset>
</fileset>
</delete>
</target>
<!--Clean up the Jar-->
<target name="cleanJar" >
<delete>
<fileset dir="${deployDir}">
<patternset>
<include name="${ant.project.name}.jar"/>
</patternset>
</fileset>
</delete>
</target>
<!--Clean up the config Jar-->
<target name="cleanJarConfig" >
<delete>
<fileset dir="${deployDir}">
<patternset>
<include name="${ant.project.name}-config.jar"/>
</patternset>
</fileset>
</delete>
</target>
<!--Build the jar-->
<target name="buildit" description="builds all components" depends="compile" >
<antcall target="createJar" />
<antcall target="createJarConfig" />
</target>
<!--Build the jar with debug enabled classes-->
<target name="builditDebug" description="builds all components" depends="compileDebug" >
<antcall target="createJarDebug" />
<antcall target="createJarConfig" />
<antcall target="createWarDebug" />
</target>
<target name="help">
<echo>
usage:
ant -help display ant help screen
ant help display this message
ant compile compile the .java files
ant clean deletes the build directory
ant deployJAR build the deployable jar (default)
ant doc generate javadocs
ant docPrivate generate javadocs -private
ant cleandoc delete the javadocs
ant default
example:
ant
ant clean
</echo>
</target>
</project>