-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
318 lines (287 loc) · 12.6 KB
/
build.xml
File metadata and controls
318 lines (287 loc) · 12.6 KB
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
<?xml version="1.0" encoding="UTF-8"?>
<project name="cardservproxy" default="build" basedir=".">
<description>
CSP (Cardservproxy) is a scalable open source proxy primarily for the newcamd protocol,
with load balancing and cluster handling built in developed by bowman.
</description>
<property name="dir.config" value="config"/>
<property name="dir.config.example" value="config/example"/>
<property name="dir.etc" value="etc"/>
<property name="dir.lib" value="lib"/>
<property name="dir.plugins" value="plugins"/>
<property name="dir.src" value="src"/>
<property name="dir.trtest" value="trtest"/>
<property name="dir.web" value="web"/>
<!-- build-folder -->
<property name="dir.classes" value="classes"/>
<property name="dir.build" value="build"/>
<property name="dir.build.config" value="build/config"/>
<property name="dir.build.config.example" value="build/config/example"/>
<property name="dir.build.etc" value="build/etc"/>
<property name="dir.build.lib" value="build/lib"/>
<property name="dir.build.log" value="build/log"/>
<property name="dir.build.plugins" value="build/plugins"/>
<property name="dir.build.src" value="build/src"/>
<property name="dir.build.trtest" value="build/trtest"/>
<property name="dir.build.web" value="build/web"/>
<property name="dir.dist" value="dist"/>
<property name="name.fishenc" value="fishenc"/>
<property name="name.cs-status" value="cs-status"/>
<property name="proxy-reference" value="proxy-reference.html"/>
<!-- config files -->
<patternset id="files.config">
<include name="*.*" />
<exclude name="proxy.xml"/>
<exclude name="proxy.xml.bak"/>
</patternset>
<!-- config/example files -->
<patternset id="files.config.example">
<include name="*.*" />
</patternset>
<!-- etc files -->
<patternset id="files.etc">
<include name="policy.all"/>
<include name="protocol.txt"/>
</patternset>
<!-- lib files -->
<patternset id="files.lib">
<include name="**/*.jar"/>
<exclude name="bowbot.jar" />
<exclude name="orionembedded.jar" />
<exclude name="mail.jar" />
</patternset>
<!-- plugin files -->
<patternset id="files.plugins">
<include name="**/dist/*.jar"/>
<include name="**/README.*.txt"/>
</patternset>
<!-- misc files -->
<patternset id="files.misc">
<include name="cardproxy.sh"/>
<include name="cardproxy.sh.ubuntu-autostart"/>
<include name="changelog.txt"/>
<include name="README.txt"/>
<include name="README.ClusteredCache.txt"/>
<include name="README.MySQLUserManager.txt"/>
<include name="README.XmlUserManager.txt"/>
<include name="README.HttpXmlApi.txt"/>
<include name="README.Optimization.txt"/>
<include name="README.Compiling.txt"/>
<include name="README.Plugins.txt"/>
<include name="README.0.9.0.txt"/>
<include name="jsw-win32.zip"/>
</patternset>
<!-- misc files for compiling -->
<patternset id="files.classes">
<include name="**/*.properties"/>
<include name="**/*.xml"/>
<exclude name="**/filefetcher.properties"/>
</patternset>
<!-- MACRO: copy fileset -->
<macrodef name="copy-fileset">
<attribute name="destination-dir"/>
<attribute name="source-dir"/>
<attribute name="path-id"/>
<attribute name="doFlatten" default="false"/>
<sequential>
<copy failonerror="false" todir="@{destination-dir}" flatten="@{doFlatten}">
<fileset dir="@{source-dir}">
<patternset refid="@{path-id}" />
</fileset>
</copy>
</sequential>
</macrodef>
<target name="clean" description="delete all created files created through cardservproxy.">
<delete dir="${dir.classes}"/>
<delete dir="${dir.build}"/>
<delete dir="${dir.dist}"/>
<delete file="${dir.web}/${proxy-reference}"/>
<delete file="${dir.lib}/${name.cs-status}.war"/>
</target>
<target name="clean.plugins" description="delete all created files created through plugins.">
<ant inheritAll="false" dir="${dir.plugins}/BetacryptTunnelPlugin" target="clean"/>
<ant inheritAll="false" dir="${dir.plugins}/CacheCoveragePlugin" target="clean"/>
<ant inheritAll="false" dir="${dir.plugins}/ConaxConnector" target="clean"/>
<ant inheritAll="false" dir="${dir.plugins}/DcwFilterPlugin" target="clean"/>
<ant inheritAll="false" dir="${dir.plugins}/DreamboxPlugin" target="clean"/>
<ant inheritAll="false" dir="${dir.plugins}/EmmAnalyzerPlugin" target="clean"/>
<ant inheritAll="false" dir="${dir.plugins}/GeoipPlugin" target="clean"/>
<ant inheritAll="false" dir="${dir.plugins}/IrdetoPlugin" target="clean"/>
<ant inheritAll="false" dir="${dir.plugins}/MessagingPlugin" target="clean"/>
<ant inheritAll="false" dir="${dir.plugins}/MySQLWebManagementPlugin" target="clean"/>
<ant inheritAll="false" dir="${dir.plugins}/ProviderIdentPlugin" target="clean"/>
<ant inheritAll="false" dir="${dir.plugins}/SoftNdsPlugin" target="clean"/>
</target>
<target name="clean.all" description="delete all previously created files and folders including plugins.">
<antcall target="clean"/>
<antcall target="clean.plugins"/>
</target>
<target name="prepare" depends="clean">
<tstamp/>
<mkdir dir="${dir.classes}"/>
<mkdir dir="${dir.build}"/>
<mkdir dir="${dir.build.config}"/>
<mkdir dir="${dir.build.config.example}"/>
<mkdir dir="${dir.build.etc}"/>
<mkdir dir="${dir.build.lib}"/>
<mkdir dir="${dir.build.log}"/>
<mkdir dir="${dir.build.plugins}"/>
<mkdir dir="${dir.dist}"/>
<copy-fileset destination-dir="${dir.build.config}" source-dir="${dir.config}" path-id="files.config"/>
<copy-fileset destination-dir="${dir.build.config.example}" source-dir="${dir.config.example}" path-id="files.config.example"/>
<copy-fileset destination-dir="${dir.build.etc}" source-dir="${dir.etc}" path-id="files.etc"/>
<copy-fileset destination-dir="${dir.build.lib}" source-dir="${dir.lib}" path-id="files.lib"/>
<copy-fileset destination-dir="${dir.build}" source-dir="." path-id="files.misc"/>
<copy-fileset destination-dir="${dir.classes}" source-dir="${dir.src}" path-id="files.classes"/>
<!-- classpath -->
<path id="classpath">
<fileset dir="${dir.lib}">
<include name="**/*.jar"/>
</fileset>
</path>
<property name="classpath" refid="classpath" />
<!-- check depencies -->
<pathconvert property="mysql.lib.present" setonempty="false" pathsep=" ">
<path>
<fileset dir="${dir.lib}" includes="mysql-connector-java*.jar" />
</path>
</pathconvert>
</target>
<target name="compile" depends="prepare">
<javac sourcepath="" srcdir="${dir.src}" includeantruntime="false"
destdir="${dir.classes}" classpath="${classpath}"
source="1.4" target="1.4" debug="on">
<include name="**/*.java"/>
<!-- exclude all mysql stuff from compiling when the mysql lib is not available -->
<exclude name="**/MySQLUserManager.java" unless="mysql.lib.present"/>
<exclude name="**/mysql/*" unless="mysql.lib.present"/>
</javac>
<rmic classpath="${classpath}" stubversion="1.2" classname="com.bowman.cardserv.rmi.RemoteHandler" base="${dir.classes}"/>
<rmic classpath="${classpath}" stubversion="1.2" classname="com.bowman.cardserv.test.RemoteTestClient" base="${dir.classes}"/>
<delete file="classes/com/bowman/cardserv/test/TestUtil.class"/>
<delete file="classes/com/bowman/cardserv/BowbotUserManager.class"/>
<exec executable="svnversion" outputproperty="svn.revision" failifexecutionfails="false">
<arg value="${dir.src}"/>
</exec>
<echo message="svn.revision=${svn.revision}" file="classes/com/bowman/cardserv/build.properties"/>
</target>
<target name="build-app" depends="compile" description="build cardservproxy.">
<!-- generate a list of available .jar for the dynamic manifest file -->
<pathconvert property="libs" pathsep=" ">
<mapper>
<chainedmapper>
<flattenmapper />
</chainedmapper>
</mapper>
<path>
<fileset dir="${dir.lib}">
<include name="**/*.jar" />
</fileset>
</path>
</pathconvert>
<!-- create cardservproxy.jar -->
<jar jarfile="${dir.build.lib}/${ant.project.name}.jar">
<manifest>
<attribute name="Manifest-Version" value="1.0"/>
<attribute name="Main-Class" value="com.bowman.cardserv.CardServProxy"/>
<attribute name="Class-Path" value="${libs} mail.jar mysql-connector-java.jar"/>
</manifest>
<fileset dir="${dir.classes}"/>
</jar>
<!-- create fishenc.jar -->
<jar jarfile="${dir.build.lib}/${name.fishenc}.jar">
<manifest>
<attribute name="Manifest-Version" value="1.0"/>
<attribute name="Main-Class" value="com.bowman.cardserv.web.FileFetcher"/>
<attribute name="Class-Path" value="bowman.jar ${ant.project.name}.jar"/>
</manifest>
<fileset dir="${dir.classes}">
<include name="**/*FileFetcher*" />
</fileset>
</jar>
<copy todir="${dir.dist}" file="${dir.build.lib}/${ant.project.name}.jar" />
<copy todir="${dir.dist}" file="${dir.build.lib}/${name.fishenc}.jar" />
</target>
<target name="build-web" description="build the web-interface.">
<copy todir="${dir.web}" file="${dir.config}/${proxy-reference}" />
<jar jarfile="${dir.build.lib}/${name.cs-status}.war" basedir="${dir.web}" />
<copy todir="${dir.dist}" file="${dir.build.lib}/${name.cs-status}.war" />
<copy todir="${dir.lib}" file="${dir.build.lib}/${name.cs-status}.war" />
</target>
<target name="build-plugins" unless="skip-plugins" description="build all plugins in the plugins directory.">
<ant inheritAll="false" dir="${dir.plugins}/BetacryptTunnelPlugin"/>
<ant inheritAll="false" dir="${dir.plugins}/CacheCoveragePlugin"/>
<ant inheritAll="false" dir="${dir.plugins}/ConaxConnector"/>
<ant inheritAll="false" dir="${dir.plugins}/DcwFilterPlugin"/>
<ant inheritAll="false" dir="${dir.plugins}/DreamboxPlugin"/>
<ant inheritAll="false" dir="${dir.plugins}/EmmAnalyzerPlugin"/>
<ant inheritAll="false" dir="${dir.plugins}/GeoipPlugin"/>
<ant inheritAll="false" dir="${dir.plugins}/IrdetoPlugin"/>
<ant inheritAll="false" dir="${dir.plugins}/MessagingPlugin"/>
<ant inheritAll="false" dir="${dir.plugins}/MySQLWebManagementPlugin"/>
<ant inheritAll="false" dir="${dir.plugins}/ProviderIdentPlugin"/>
<ant inheritAll="false" dir="${dir.plugins}/SoftNdsPlugin"/>
<copy-fileset destination-dir="${dir.build.plugins}" source-dir="${dir.plugins}" path-id="files.plugins" doFlatten="true"/>
</target>
<target name="build" depends="build-app, build-web, build-plugins" description="build everything (cardservproxy, web-interface and plugins)."/>
<target name="tar-app" depends="build-app, build-web, build-plugins" description="build the complete cardservproxy and compress it to a tar.gz.">
<move todir="${dir.build}/${ant.project.name}">
<fileset dir="${dir.build}"/>
</move>
<tar tarfile="${dir.dist}/${ant.project.name}.tar" basedir="${dir.build}" excludes="${ant.project.name}/cardproxy.sh*">
<tarfileset dir="${dir.build}/${ant.project.name}" mode="755" prefix="${ant.project.name}">
<include name="cardproxy.sh*"/>
</tarfileset>
</tar>
<gzip zipfile="${dir.dist}/${ant.project.name}.tar.gz" src="${dir.dist}/${ant.project.name}.tar"/>
<delete file="${dir.dist}/${ant.project.name}.tar" />
<delete dir="${dir.build}"/>
</target>
<target name="tar-src" depends="prepare" description="compress the source files as .tar.gz.">
<mkdir dir="${dir.build.src}"/>
<copy todir="${dir.build.src}">
<fileset dir="${dir.src}">
<include name="**/*" />
</fileset>
</copy>
<mkdir dir="${dir.build.web}"/>
<copy todir="${dir.build.web}">
<fileset dir="${dir.web}">
<include name="**/*" />
</fileset>
</copy>
<copy todir="${dir.build.trtest}">
<fileset dir="${dir.trtest}">
<include name="**/*" />
</fileset>
</copy>
<copy todir="${dir.build}">
<fileset dir=".">
<include name="CardServProxy.iml" />
<include name="CardServProxy.ipr" />
</fileset>
</copy>
<delete dir="${dir.build.plugins}"/>
<copy todir="${dir.build.plugins}">
<fileset dir="${dir.plugins}">
<include name="**/*"/>
<exclude name="**/${dir.dist}/*"/>
<exclude name="**/*.iws"/>
<exclude name="**/*.bak"/>
<exclude name="**/*.jar"/>
</fileset>
</copy>
<delete file="${dir.build.src}/com/bowman/cardserv/BowbotUserManager.java"/>
<delete file="${dir.build.src}/com/bowman/cardserv/web/filefetcher.properties"/>
<delete file="${dir.build.src}/com/bowman/cardserv/test/TestUtil.java"/>
<copy todir="${dir.build}" file="build.xml"/>
<move todir="${dir.build}/${ant.project.name}-src">
<fileset dir="${dir.build}"/>
</move>
<tar tarfile="${dir.dist}/${ant.project.name}-src.tar" basedir="${dir.build}"/>
<gzip zipfile="${dir.dist}/${ant.project.name}-src.tar.gz" src="${dir.dist}/${ant.project.name}-src.tar"/>
<delete file="${dir.dist}/${ant.project.name}-src.tar" />
<delete dir="${dir.build}"/>
<delete dir="${dir.classes}"/>
</target>
</project>