-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
236 lines (200 loc) · 8.64 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
234
235
236
<!-- $Header$ -->
<project name="PARADE" basedir="." default="compile">
<property file="build.properties" />
<property file="tomcat.properties" />
<!-- Configure the directory into which the web application is built -->
<property name="build" value="${basedir}/build" />
<!-- Configure the context path for this application -->
<property name="path" value="/" />
<property name="war" value="/ROOT" />
<!-- Configure properties to access the Manager application -->
<property name="url" value="${tomcat.manager.url}" />
<property name="username" value="${tomcat.manager.username}" />
<property name="password" value="${tomcat.manager.password}" />
<!-- Configure the custom Ant tasks for the Manager application
<taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask" />
<taskdef name="list" classname="org.apache.catalina.ant.ListTask" />
<taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask" />
<taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask" />
<taskdef name="roles" classname="org.apache.catalina.ant.RolesTask" />
<taskdef name="start" classname="org.apache.catalina.ant.StartTask" />
<taskdef name="stop" classname="org.apache.catalina.ant.StopTask" />
<taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask" />-->
<!-- the following properties should be defined
tomcat.home: tomcat home (in tomcat.properties)
temp.dir: temporary dir (in build.properties)
-->
<path id="generic.class.path">
<fileset dir="${webapp.path}/WEB-INF/lib">
<include name="makumba.jar" />
<include name="freemarker.jar" />
<include name="hibernate3.jar" />
<include name="hibernate-jpa-2.0-api-1.0.0.Final.jar" />
<include name="struts.jar" />
<include name="parser.jar" />
<include name="jfreechart-1.0.9.jar" />
<include name="cewolf-1.0.jar" />
<include name="oscache-2.4.1.jar" />
<include name="commons-collections-3.2.jar" />
<include name="commons-io-1.1.jar" />
<include name="commons-lang-2.3.jar" />
<include name="commons-configuration-1.6.jar" />
<include name="commons-cli-1.2.jar" />
<include name="antlr-2.7.6.jar" />
</fileset>
<fileset dir="lib">
<include name="*.jar" />
<include name="*.zip" />
</fileset>
<fileset dir="${tomcat.home}/common/lib">
<include name="*.jar" />
</fileset>
<pathelement path="globalClasses/" />
<pathelement path="${temp.dir}" />
<fileset dir="${java.home}/lib/">
<include name="rt.jar" />
</fileset>
</path>
<path id="tomcat.class.path">
<fileset dir="${java.home}/lib/">
<include name="rt.jar" />
</fileset>
<fileset dir="lib">
<include name="tomcat-bootstrap.jar" />
<include name="servlet-api.jar" />
<include name="commons-logging-api.jar" />
<include name="ant-1.6.5.jar" />
</fileset>
<fileset dir="${webapp.path}/WEB-INF/lib">
<include name="ant-launcher-1.6.5.jar" />
</fileset>
<pathelement path="globalClasses/" />
</path>
<target name="compile" description="compile the java files">
<!-- bug in ant 1.7.1 for package-info compilation, see https://issues.apache.org/bugzilla/show_bug.cgi?id=43114 -->
<touch>
<fileset dir="${webapp.path}/WEB-INF/classes" includes="**/package-info.java" />
</touch>
<javac srcdir="${webapp.path}/WEB-INF/classes" debug="on">
<classpath refid="generic.class.path" />
<include name="**/package-info.java" />
</javac>
<javac srcdir="${webapp.path}/WEB-INF/classes" debug="on">
<classpath refid="generic.class.path" />
</javac>
</target>
<target name="clean" description="delete all generated and backup files">
<mkdir dir="${webapp.path}/javadoc" />
<mkdir dir="${basedir}/jspc" />
<mkdir dir="globalClasses" />
<delete>
<fileset dir="${webapp.path}/WEB-INF/classes" includes="**/*.class" />
<fileset dir="${webapp.path}/WEB-INF/classes" includes="**/*.java~" />
<fileset dir="${webapp.path}" includes="**/*.jsp~" />
<fileset dir="${webapp.path}/javadoc" />
<fileset dir="globalClasses/" includes="**/*.class" />
<fileset dir="${basedir}/jspc" />
</delete>
</target>
<target name="cleanTomcat" description="cleans the tomcat, i.e. empties work/ and removes all context descriptors from conf except parade ones">
<delete>
<fileset dir="${basedir}/tomcat/work" />
<fileset dir="${basedir}/tomcat/conf/Catalina/localhost/" excludes="ROOT.xml,manager.xml,tomcat-docs.xml,**/CVS" />
</delete>
<mkdir dir="${tomcat.home}/work" />
</target>
<target name="compileWar" description="Compile web application">
<war destfile="${build}${war}.war" webxml="WebContent/WEB-INF/web.xml" update="true">
<fileset dir="WebContent">
<exclude name="WebContent/WEB-INF/web.xml" />
</fileset>
<lib dir="WebContent/WEB-INF/lib" />
<classes dir="${build}/classes" />
</war>
</target>
<target name="deploy" description="Install web application" depends="compile">
<deploy url="${url}" username="${username}" password="${password}" path="${path}" war="${build}${war}.war" />
</target>
<target name="reload" description="Reload web application" depends="compile">
<reload url="${url}" username="${username}" password="${password}" path="${path}" />
</target>
<target name="undeploy" description="Remove web application">
<undeploy url="${url}" username="${username}" password="${password}" path="${path}" />
</target>
<target name="prepareTomcat" description="Sets up tomcat with ParaDe-specific configuration" depends="compile">
<!-- We also need to create a bunch of directories -->
<mkdir dir="tomcat/webapps_dummy" />
<antcall target="globalClassesCopy" />
</target>
<target name="globalClassesCopy">
<copy toDir="globalClasses/" overwrite="true">
<fileset dir="webapp/WEB-INF/classes">
<include name="org/makumba/parade/tools/TriggerFilter*.class" />
<include name="org/makumba/parade/tools/ServletRedirectionData*.class" />
<include name="org/makumba/parade/tools/HttpServletResponseDummy*.class" />
<include name="org/makumba/parade/tools/HttpServletRequestDummy*.class" />
<include name="org/makumba/parade/access/ActionLogDTO*.class" />
<include name="org/makumba/parade/tools/DatabaseHandler*.class" />
<include name="org/makumba/parade/tools/ParadeLogFormatter*.class" />
<include name="org/makumba/parade/tools/PerThreadPrintStream*.class" />
<include name="org/makumba/parade/tools/ParadeLogger*.class" />
<include name="org/makumba/parade/tools/LogHandler*.class" />
<include name="org/makumba/parade/listeners/ParadeSessionListener*.class" />
<include name="org/makumba/parade/aether/ObjectTypes*.class" />
<include name="org/makumba/aether/UserTypes*.class" />
<include name="org/makumba/commons/ServletObjects*.class" />
</fileset>
<fileset dir=".">
<include name="logging.properties" />
</fileset>
</copy>
</target>
<target name="tomcat">
<antcall target="tomcat-start" />
</target>
<target name="tomcat-start" depends="prepareTomcat">
<echo>Java home in build: ${java.home}</echo>
<java classname="org.apache.catalina.startup.Bootstrap" fork="yes" classpathref="tomcat.class.path" append="true">
<jvmarg value="-Dcatalina.home=${tomcat.home}" />
<jvmarg value="-Dcatalina.base=tomcat" />
<jvmarg value="-Xms${tomcat.Xms}" />
<jvmarg value="-Xmx${tomcat.Xmx}" />
<jvmarg value="-XX:MaxPermSize=${tomcat.Xmx}" />
<jvmarg value="-Djava.library.path=." />
<jvmarg value="-Djava.util.logging.config.file=${basedir}/logging.properties" />
<jvmarg value="-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager" />
<jvmarg value="-XX:CompileCommand=exclude,com/bbn/openmap/layer/rpf/RpfFrame,decompressSubframe" />
<jvmarg value="-client" />
<arg value="start" />
</java>
<!-- give tomcat time to start up -->
<sleep seconds="5" />
</target>
<target name="tomcat-stop">
<java classname="org.apache.catalina.startup.Bootstrap" fork="yes" classpathref="tomcat.class.path">
<jvmarg value="-Dcatalina.home=${tomcat.home}" />
<jvmarg value="-Dcatalina.base=tomcat" />
<arg value="stop" />
</java>
<!-- give tomcat time to shut down -->
<sleep seconds="5" />
</target>
<target name="crawlRows" depends="compile">
<java classname="org.makumba.parade.tools.RowCrawler" fork="true" dir=".">
<jvmarg value="-Xms${tomcat.Xms}" />
<jvmarg value="-Xmx${tomcat.Xmx}" />
<jvmarg value="-XX:MaxPermSize=${tomcat.Xmx}" />
<classpath>
<pathelement path="${java.class.path}" />
<pathelement location="webapp/WEB-INF/classes" />
<fileset dir="${webapp.path}/WEB-INF/lib">
<include name="*.jar" />
</fileset>
<fileset dir="lib">
<include name="*.jar" />
<include name="*.zip" />
</fileset>
</classpath>
</java>
</target>
</project>