1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
2 |
|
---|
3 | <project name="cardservproxy" default="build" basedir=".">
|
---|
4 |
|
---|
5 | <description>
|
---|
6 | CSP (Cardservproxy) is a scalable open source proxy primarily for the newcamd protocol,
|
---|
7 | with load balancing and cluster handling built in developed by bowman.
|
---|
8 | </description>
|
---|
9 |
|
---|
10 | <property name="dir.config" value="config"/>
|
---|
11 | <property name="dir.config.example" value="config/example"/>
|
---|
12 | <property name="dir.etc" value="etc"/>
|
---|
13 | <property name="dir.lib" value="lib"/>
|
---|
14 | <property name="dir.plugins" value="plugins"/>
|
---|
15 | <property name="dir.src" value="src"/>
|
---|
16 | <property name="dir.trtest" value="trtest"/>
|
---|
17 | <property name="dir.web" value="web"/>
|
---|
18 |
|
---|
19 | <!-- build-folder -->
|
---|
20 | <property name="dir.classes" value="classes"/>
|
---|
21 | <property name="dir.build" value="build"/>
|
---|
22 | <property name="dir.build.config" value="build/config"/>
|
---|
23 | <property name="dir.build.config.example" value="build/config/example"/>
|
---|
24 | <property name="dir.build.etc" value="build/etc"/>
|
---|
25 | <property name="dir.build.lib" value="build/lib"/>
|
---|
26 | <property name="dir.build.log" value="build/log"/>
|
---|
27 | <property name="dir.build.plugins" value="build/plugins"/>
|
---|
28 | <property name="dir.build.src" value="build/src"/>
|
---|
29 | <property name="dir.build.trtest" value="build/trtest"/>
|
---|
30 | <property name="dir.build.web" value="build/web"/>
|
---|
31 | <property name="dir.dist" value="dist"/>
|
---|
32 |
|
---|
33 | <property name="name.fishenc" value="fishenc"/>
|
---|
34 | <property name="name.cs-status" value="cs-status"/>
|
---|
35 |
|
---|
36 | <property name="proxy-reference" value="proxy-reference.html"/>
|
---|
37 |
|
---|
38 | <!-- config files -->
|
---|
39 | <patternset id="files.config">
|
---|
40 | <include name="*.*" />
|
---|
41 | <exclude name="proxy.xml"/>
|
---|
42 | <exclude name="proxy.xml.bak"/>
|
---|
43 | </patternset>
|
---|
44 |
|
---|
45 | <!-- config/example files -->
|
---|
46 | <patternset id="files.config.example">
|
---|
47 | <include name="*.*" />
|
---|
48 | </patternset>
|
---|
49 |
|
---|
50 | <!-- etc files -->
|
---|
51 | <patternset id="files.etc">
|
---|
52 | <include name="policy.all"/>
|
---|
53 | <include name="protocol.txt"/>
|
---|
54 | </patternset>
|
---|
55 |
|
---|
56 | <!-- lib files -->
|
---|
57 | <patternset id="files.lib">
|
---|
58 | <include name="**/*.jar"/>
|
---|
59 | <exclude name="bowbot.jar" />
|
---|
60 | <exclude name="orionembedded.jar" />
|
---|
61 | <exclude name="mail.jar" />
|
---|
62 | </patternset>
|
---|
63 |
|
---|
64 | <!-- plugin files -->
|
---|
65 | <patternset id="files.plugins">
|
---|
66 | <include name="**/dist/*.jar"/>
|
---|
67 | <include name="**/README.*.txt"/>
|
---|
68 | </patternset>
|
---|
69 |
|
---|
70 | <!-- misc files -->
|
---|
71 | <patternset id="files.misc">
|
---|
72 | <include name="cardproxy.sh"/>
|
---|
73 | <include name="cardproxy.sh.ubuntu-autostart"/>
|
---|
74 | <include name="changelog.txt"/>
|
---|
75 | <include name="README.txt"/>
|
---|
76 | <include name="README.ClusteredCache.txt"/>
|
---|
77 | <include name="README.MySQLUserManager.txt"/>
|
---|
78 | <include name="README.XmlUserManager.txt"/>
|
---|
79 | <include name="README.HttpXmlApi.txt"/>
|
---|
80 | <include name="README.Optimization.txt"/>
|
---|
81 | <include name="README.Compiling.txt"/>
|
---|
82 | <include name="README.Plugins.txt"/>
|
---|
83 | <include name="README.0.9.0.txt"/>
|
---|
84 | <include name="jsw-win32.zip"/>
|
---|
85 | </patternset>
|
---|
86 |
|
---|
87 | <!-- misc files for compiling -->
|
---|
88 | <patternset id="files.classes">
|
---|
89 | <include name="**/*.properties"/>
|
---|
90 | <include name="**/*.xml"/>
|
---|
91 | <exclude name="**/filefetcher.properties"/>
|
---|
92 | </patternset>
|
---|
93 |
|
---|
94 | <!-- MACRO: copy fileset -->
|
---|
95 | <macrodef name="copy-fileset">
|
---|
96 | <attribute name="destination-dir"/>
|
---|
97 | <attribute name="source-dir"/>
|
---|
98 | <attribute name="path-id"/>
|
---|
99 | <attribute name="doFlatten" default="false"/>
|
---|
100 | <sequential>
|
---|
101 | <copy failonerror="false" todir="@{destination-dir}" flatten="@{doFlatten}">
|
---|
102 | <fileset dir="@{source-dir}">
|
---|
103 | <patternset refid="@{path-id}" />
|
---|
104 | </fileset>
|
---|
105 | </copy>
|
---|
106 | </sequential>
|
---|
107 | </macrodef>
|
---|
108 |
|
---|
109 | <target name="clean" description="delete all created files created through cardservproxy.">
|
---|
110 | <delete dir="${dir.classes}"/>
|
---|
111 | <delete dir="${dir.build}"/>
|
---|
112 | <delete dir="${dir.dist}"/>
|
---|
113 | <delete file="${dir.web}/${proxy-reference}"/>
|
---|
114 | <delete file="${dir.lib}/${name.cs-status}.war"/>
|
---|
115 | </target>
|
---|
116 |
|
---|
117 | <target name="clean.plugins" description="delete all created files created through plugins.">
|
---|
118 | <ant inheritAll="false" dir="${dir.plugins}/BetacryptTunnelPlugin" target="clean"/>
|
---|
119 | <ant inheritAll="false" dir="${dir.plugins}/ConaxConnector" target="clean"/>
|
---|
120 | <ant inheritAll="false" dir="${dir.plugins}/DcwFilterPlugin" target="clean"/>
|
---|
121 | <ant inheritAll="false" dir="${dir.plugins}/DreamboxPlugin" target="clean"/>
|
---|
122 | <ant inheritAll="false" dir="${dir.plugins}/EmmAnalyzerPlugin" target="clean"/>
|
---|
123 | <ant inheritAll="false" dir="${dir.plugins}/GeoipPlugin" target="clean"/>
|
---|
124 | <ant inheritAll="false" dir="${dir.plugins}/IrdetoPlugin" target="clean"/>
|
---|
125 | <ant inheritAll="false" dir="${dir.plugins}/MessagingPlugin" target="clean"/>
|
---|
126 | <ant inheritAll="false" dir="${dir.plugins}/MySQLWebManagementPlugin" target="clean"/>
|
---|
127 | <ant inheritAll="false" dir="${dir.plugins}/ProviderIdentPlugin" target="clean"/>
|
---|
128 | <ant inheritAll="false" dir="${dir.plugins}/SoftNdsPlugin" target="clean"/>
|
---|
129 | </target>
|
---|
130 |
|
---|
131 | <target name="clean.all" description="delete all previously created files and folders including plugins.">
|
---|
132 | <antcall target="clean"/>
|
---|
133 | <antcall target="clean.plugins"/>
|
---|
134 | </target>
|
---|
135 |
|
---|
136 | <target name="prepare" depends="clean">
|
---|
137 | <tstamp/>
|
---|
138 | <mkdir dir="${dir.classes}"/>
|
---|
139 | <mkdir dir="${dir.build}"/>
|
---|
140 | <mkdir dir="${dir.build.config}"/>
|
---|
141 | <mkdir dir="${dir.build.config.example}"/>
|
---|
142 | <mkdir dir="${dir.build.etc}"/>
|
---|
143 | <mkdir dir="${dir.build.lib}"/>
|
---|
144 | <mkdir dir="${dir.build.log}"/>
|
---|
145 | <mkdir dir="${dir.build.plugins}"/>
|
---|
146 | <mkdir dir="${dir.dist}"/>
|
---|
147 |
|
---|
148 | <copy-fileset destination-dir="${dir.build.config}" source-dir="${dir.config}" path-id="files.config"/>
|
---|
149 | <copy-fileset destination-dir="${dir.build.config.example}" source-dir="${dir.config.example}" path-id="files.config.example"/>
|
---|
150 | <copy-fileset destination-dir="${dir.build.etc}" source-dir="${dir.etc}" path-id="files.etc"/>
|
---|
151 | <copy-fileset destination-dir="${dir.build.lib}" source-dir="${dir.lib}" path-id="files.lib"/>
|
---|
152 | <copy-fileset destination-dir="${dir.build}" source-dir="." path-id="files.misc"/>
|
---|
153 | <copy-fileset destination-dir="${dir.classes}" source-dir="${dir.src}" path-id="files.classes"/>
|
---|
154 |
|
---|
155 | <!-- classpath -->
|
---|
156 | <path id="classpath">
|
---|
157 | <fileset dir="${dir.lib}">
|
---|
158 | <include name="**/*.jar"/>
|
---|
159 | </fileset>
|
---|
160 | </path>
|
---|
161 | <property name="classpath" refid="classpath" />
|
---|
162 |
|
---|
163 | <!-- check depencies -->
|
---|
164 | <pathconvert property="mysql.lib.present" setonempty="false" pathsep=" ">
|
---|
165 | <path>
|
---|
166 | <fileset dir="${dir.lib}" includes="mysql-connector-java*.jar" />
|
---|
167 | </path>
|
---|
168 | </pathconvert>
|
---|
169 | </target>
|
---|
170 |
|
---|
171 | <target name="compile" depends="prepare">
|
---|
172 | <javac sourcepath="" srcdir="${dir.src}" includeantruntime="false"
|
---|
173 | destdir="${dir.classes}" classpath="${classpath}"
|
---|
174 | source="1.4" target="1.4" debug="on">
|
---|
175 | <include name="**/*.java"/>
|
---|
176 | <!-- exclude all mysql stuff from compiling when the mysql lib is not available -->
|
---|
177 | <exclude name="**/MySQLUserManager.java" unless="mysql.lib.present"/>
|
---|
178 | <exclude name="**/mysql/*" unless="mysql.lib.present"/>
|
---|
179 | </javac>
|
---|
180 | <rmic classpath="${classpath}" stubversion="1.2" classname="com.bowman.cardserv.rmi.RemoteHandler" base="${dir.classes}"/>
|
---|
181 | <rmic classpath="${classpath}" stubversion="1.2" classname="com.bowman.cardserv.test.RemoteTestClient" base="${dir.classes}"/>
|
---|
182 | <delete file="classes/com/bowman/cardserv/test/TestUtil.class"/>
|
---|
183 | <delete file="classes/com/bowman/cardserv/BowbotUserManager.class"/>
|
---|
184 | <exec executable="svnversion" outputproperty="svn.revision" failifexecutionfails="false">
|
---|
185 | <arg value="${dir.src}"/>
|
---|
186 | </exec>
|
---|
187 | <echo message="svn.revision=${svn.revision}" file="classes/com/bowman/cardserv/build.properties"/>
|
---|
188 | </target>
|
---|
189 |
|
---|
190 | <target name="build-app" depends="compile" description="build cardservproxy.">
|
---|
191 | <!-- generate a list of available .jar for the dynamic manifest file -->
|
---|
192 | <pathconvert property="libs" pathsep=" ">
|
---|
193 | <mapper>
|
---|
194 | <chainedmapper>
|
---|
195 | <flattenmapper />
|
---|
196 | </chainedmapper>
|
---|
197 | </mapper>
|
---|
198 | <path>
|
---|
199 | <fileset dir="${dir.lib}">
|
---|
200 | <include name="**/*.jar" />
|
---|
201 | </fileset>
|
---|
202 | </path>
|
---|
203 | </pathconvert>
|
---|
204 |
|
---|
205 | <!-- create cardservproxy.jar -->
|
---|
206 | <jar jarfile="${dir.build.lib}/${ant.project.name}.jar">
|
---|
207 | <manifest>
|
---|
208 | <attribute name="Manifest-Version" value="1.0"/>
|
---|
209 | <attribute name="Main-Class" value="com.bowman.cardserv.CardServProxy"/>
|
---|
210 | <attribute name="Class-Path" value="${libs} mail.jar mysql-connector-java.jar"/>
|
---|
211 | </manifest>
|
---|
212 | <fileset dir="${dir.classes}"/>
|
---|
213 | </jar>
|
---|
214 |
|
---|
215 | <!-- create fishenc.jar -->
|
---|
216 | <jar jarfile="${dir.build.lib}/${name.fishenc}.jar">
|
---|
217 | <manifest>
|
---|
218 | <attribute name="Manifest-Version" value="1.0"/>
|
---|
219 | <attribute name="Main-Class" value="com.bowman.cardserv.web.FileFetcher"/>
|
---|
220 | <attribute name="Class-Path" value="bowman.jar ${ant.project.name}.jar"/>
|
---|
221 | </manifest>
|
---|
222 | <fileset dir="${dir.classes}">
|
---|
223 | <include name="**/*FileFetcher*" />
|
---|
224 | </fileset>
|
---|
225 | </jar>
|
---|
226 | <copy todir="${dir.dist}" file="${dir.build.lib}/${ant.project.name}.jar" />
|
---|
227 | <copy todir="${dir.dist}" file="${dir.build.lib}/${name.fishenc}.jar" />
|
---|
228 | </target>
|
---|
229 |
|
---|
230 | <target name="build-web" description="build the web-interface.">
|
---|
231 | <copy todir="${dir.web}" file="${dir.config}/${proxy-reference}" />
|
---|
232 | <jar jarfile="${dir.build.lib}/${name.cs-status}.war" basedir="${dir.web}" />
|
---|
233 | <copy todir="${dir.dist}" file="${dir.build.lib}/${name.cs-status}.war" />
|
---|
234 | <copy todir="${dir.lib}" file="${dir.build.lib}/${name.cs-status}.war" />
|
---|
235 | </target>
|
---|
236 |
|
---|
237 | <target name="build-plugins" unless="skip-plugins" description="build all plugins in the plugins directory.">
|
---|
238 | <ant inheritAll="false" dir="${dir.plugins}/BetacryptTunnelPlugin"/>
|
---|
239 | <ant inheritAll="false" dir="${dir.plugins}/ConaxConnector"/>
|
---|
240 | <ant inheritAll="false" dir="${dir.plugins}/DcwFilterPlugin"/>
|
---|
241 | <ant inheritAll="false" dir="${dir.plugins}/DreamboxPlugin"/>
|
---|
242 | <ant inheritAll="false" dir="${dir.plugins}/EmmAnalyzerPlugin"/>
|
---|
243 | <ant inheritAll="false" dir="${dir.plugins}/GeoipPlugin"/>
|
---|
244 | <ant inheritAll="false" dir="${dir.plugins}/IrdetoPlugin"/>
|
---|
245 | <ant inheritAll="false" dir="${dir.plugins}/MessagingPlugin"/>
|
---|
246 | <ant inheritAll="false" dir="${dir.plugins}/MySQLWebManagementPlugin"/>
|
---|
247 | <ant inheritAll="false" dir="${dir.plugins}/ProviderIdentPlugin"/>
|
---|
248 | <ant inheritAll="false" dir="${dir.plugins}/SoftNdsPlugin"/>
|
---|
249 |
|
---|
250 | <copy-fileset destination-dir="${dir.build.plugins}" source-dir="${dir.plugins}" path-id="files.plugins" doFlatten="true"/>
|
---|
251 | </target>
|
---|
252 |
|
---|
253 | <target name="build" depends="build-app, build-web, build-plugins" description="build everything (cardservproxy, web-interface and plugins)."/>
|
---|
254 |
|
---|
255 | <target name="tar-app" depends="build-app, build-web, build-plugins" description="build the complete cardservproxy and compress it to a tar.gz.">
|
---|
256 | <move todir="${dir.build}/${ant.project.name}">
|
---|
257 | <fileset dir="${dir.build}"/>
|
---|
258 | </move>
|
---|
259 | <tar tarfile="${dir.dist}/${ant.project.name}.tar" basedir="${dir.build}" excludes="${ant.project.name}/cardproxy.sh*">
|
---|
260 | <tarfileset dir="${dir.build}/${ant.project.name}" mode="755" prefix="${ant.project.name}">
|
---|
261 | <include name="cardproxy.sh*"/>
|
---|
262 | </tarfileset>
|
---|
263 | </tar>
|
---|
264 | <gzip zipfile="${dir.dist}/${ant.project.name}.tar.gz" src="${dir.dist}/${ant.project.name}.tar"/>
|
---|
265 | <delete file="${dir.dist}/${ant.project.name}.tar" />
|
---|
266 | <delete dir="${dir.build}"/>
|
---|
267 | </target>
|
---|
268 |
|
---|
269 | <target name="tar-src" depends="prepare" description="compress the source files as .tar.gz.">
|
---|
270 | <mkdir dir="${dir.build.src}"/>
|
---|
271 | <copy todir="${dir.build.src}">
|
---|
272 | <fileset dir="${dir.src}">
|
---|
273 | <include name="**/*" />
|
---|
274 | </fileset>
|
---|
275 | </copy>
|
---|
276 | <mkdir dir="${dir.build.web}"/>
|
---|
277 | <copy todir="${dir.build.web}">
|
---|
278 | <fileset dir="${dir.web}">
|
---|
279 | <include name="**/*" />
|
---|
280 | </fileset>
|
---|
281 | </copy>
|
---|
282 | <copy todir="${dir.build.trtest}">
|
---|
283 | <fileset dir="${dir.trtest}">
|
---|
284 | <include name="**/*" />
|
---|
285 | </fileset>
|
---|
286 | </copy>
|
---|
287 | <copy todir="${dir.build}">
|
---|
288 | <fileset dir=".">
|
---|
289 | <include name="CardServProxy.iml" />
|
---|
290 | <include name="CardServProxy.ipr" />
|
---|
291 | </fileset>
|
---|
292 | </copy>
|
---|
293 | <delete dir="${dir.build.plugins}"/>
|
---|
294 | <copy todir="${dir.build.plugins}">
|
---|
295 | <fileset dir="${dir.plugins}">
|
---|
296 | <include name="**/*"/>
|
---|
297 | <exclude name="**/${dir.dist}/*"/>
|
---|
298 | <exclude name="**/*.iws"/>
|
---|
299 | <exclude name="**/*.bak"/>
|
---|
300 | <exclude name="**/*.jar"/>
|
---|
301 | </fileset>
|
---|
302 | </copy>
|
---|
303 | <delete file="${dir.build.src}/com/bowman/cardserv/BowbotUserManager.java"/>
|
---|
304 | <delete file="${dir.build.src}/com/bowman/cardserv/web/filefetcher.properties"/>
|
---|
305 | <delete file="${dir.build.src}/com/bowman/cardserv/test/TestUtil.java"/>
|
---|
306 | <copy todir="${dir.build}" file="build.xml"/>
|
---|
307 | <move todir="${dir.build}/${ant.project.name}-src">
|
---|
308 | <fileset dir="${dir.build}"/>
|
---|
309 | </move>
|
---|
310 | <tar tarfile="${dir.dist}/${ant.project.name}-src.tar" basedir="${dir.build}"/>
|
---|
311 | <gzip zipfile="${dir.dist}/${ant.project.name}-src.tar.gz" src="${dir.dist}/${ant.project.name}-src.tar"/>
|
---|
312 | <delete file="${dir.dist}/${ant.project.name}-src.tar" />
|
---|
313 | <delete dir="${dir.build}"/>
|
---|
314 | <delete dir="${dir.classes}"/>
|
---|
315 | </target>
|
---|
316 | </project> |
---|