-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.xml
412 lines (405 loc) · 19.3 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
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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
<?xml version="1.0"?>
<project name="JavaBridge" basedir="." default="all" xmlns:if="ant:if" xmlns:unless="ant:unless">
<target name="genInit">
<property name="srcDir" value="${basedir}/src"/>
<property name="distDir" value="${basedir}/build"/>
<property name="serverDir" value="${basedir}/legacy/server"/>
<property name="javaDir" value="${srcDir}/main/java"/>
<property name="pkgDir" value="${javaDir}/io/soluble/pjb"/>
<property name="resDir" value="${srcDir}/main/resources"/>
<property name="webappDir" value="${srcDir}/main/webapp"/>
<property name="phpExec" value="${php_exec}"/> <!-- Value provided by -Dphp_exec=... -->
</target>
<target name="genClean" depends="genInit">
<delete file="${resDir}/META-INF/java/Java.inc"/>
<delete file="${resDir}/META-INF/java/JavaProxy.php"/>
<delete file="${webappDir}/java/Java.inc"/>
<delete file="${webappDir}/java/JavaProxy.php"/>
<delete file="${serverDir}/META-INF/java/Java.inc"/>
<delete file="${serverDir}/META-INF/java/JavaProxy.php"/>
<delete file="${pkgDir}/bridge/JavaInc.java"/>
<delete file="${pkgDir}/bridge/JavaProxy.java"/>
<delete file="${pkgDir}/bridge/PhpDebuggerPHP.java" />
<delete file="${pkgDir}/bridge/LauncherUnix.java"/>
<delete file="${pkgDir}/bridge/LauncherWindows.java"/>
<delete file="${pkgDir}/bridge/LauncherWindows2.java"/>
<delete file="${pkgDir}/bridge/LauncherWindows3.java"/>
<delete file="${pkgDir}/bridge/LauncherWindows4.java"/>
</target>
<target name="-check-JavaInc">
<condition property="missingJavaInc">
<not>
<available file="${resDir}/META-INF/java/Java.inc"/>
</not>
</condition>
</target>
<target name="genJavaInc" depends="genInit,-check-JavaInc" if="missingJavaInc">
<apply executable="${phpExec}" failonerror="true" dir="${serverDir}" parallel="true">
<arg value="${serverDir}/buildJavaInc.php"/>
<arg value="${resDir}/META-INF/java/Java.inc"/> <!-- out -->
<arg value="${serverDir}/META-INF/java/JavaBridge.inc"/>
<arg value="${serverDir}/META-INF/java/Options.inc"/>
<arg value="${serverDir}/META-INF/java/Client.inc"/>
<arg value="${serverDir}/META-INF/java/GlobalRef.inc"/>
<arg value="${serverDir}/META-INF/java/NativeParser.inc"/>
<arg value="${serverDir}/META-INF/java/Parser.inc"/>
<arg value="${serverDir}/META-INF/java/Protocol.inc"/>
<arg value="${serverDir}/META-INF/java/SimpleParser.inc"/>
<fileset dir="${serverDir}">
<include name="META-INF/java/JavaProxy.inc"/>
</fileset>
</apply>
<copy file="${resDir}/META-INF/java/Java.inc" todir="${webappDir}/java"/>
</target>
<target name="-check-JavaProxyPhp">
<condition property="missingJavaProxyPhp">
<not>
<available file="${resDir}/META-INF/java/JavaProxy.php"/>
</not>
</condition>
</target>
<target name="genJavaProxyPhp" depends="genJavaInc,genInit,-check-JavaProxyPhp" if="missingJavaProxyPhp">
<apply executable="${phpExec}" failonerror="true" dir="${serverDir}" parallel="true">
<arg value="${serverDir}/buildJavaProxy.php"/>
<arg value="${resDir}/META-INF/java/JavaProxy.php"/> <!-- out -->
<fileset dir="${resDir}">
<include name="META-INF/java/Java.inc"/>
</fileset>
</apply>
<copy file="${resDir}/META-INF/java/JavaProxy.php" todir="${webappDir}/java"/>
</target>
<target name="genJavaIncJava" depends="genJavaInc,genInit">
<apply executable="${phpExec}" failonerror="true" dir="${serverDir}" parallel="true">
<arg value="buildClassFromTextFile.php"/>
<arg value="${pkgDir}/bridge/JavaInc.java"/>
<arg value="JavaInc"/>
<fileset dir="${resDir}">
<include name="META-INF/java/Java.inc"/>
</fileset>
</apply>
</target>
<target name="genJavaProxyPhpJava" depends="genJavaProxyPhp,genInit">
<apply executable="${phpExec}" failonerror="true" dir="${serverDir}" parallel="true">
<arg value="buildClassFromTextFile.php"/>
<arg value="${pkgDir}/bridge/JavaProxy.java"/>
<arg value="JavaProxy"/>
<fileset dir="${resDir}">
<include name="META-INF/java/JavaProxy.php"/>
</fileset>
</apply>
</target>
<!--
WARNING if you build the genPHPDebuggerPHPJava... License is GPL (GPL+classpath exception)
if you distribute... The PHPDebugger is needed only for tests and should not
be included in the build.
-->
<target name="genPhpDebuggerPHPJava" depends="genInit">
<apply executable="${phpExec}" failonerror = "true" dir="${serverDir}" parallel="true">
<arg value="buildClassFromTextFile.php" />
<arg value="${pkgDir}/bridge/PhpDebuggerPHP.java" />
<arg value="PhpDebuggerPHP" />
<fileset dir="${resDir}" >
<include name="META-INF/java/PHPDebugger.php" />
</fileset>
</apply>
</target>
<target name="genLauncherUnix" depends="genInit">
<apply executable="${phpExec}" failonerror="true" dir="${serverDir}" parallel="true">
<arg value="buildClassFromTextFile.php"/>
<arg value="${pkgDir}/bridge/LauncherUnix.java"/>
<arg value="LauncherUnix"/>
<fileset dir="${serverDir}">
<include name="WEB-INF/cgi/launcher.sh"/>
</fileset>
</apply>
</target>
<target name="genLauncherWindows" depends="genInit">
<apply executable="${phpExec}" failonerror="true" dir="${serverDir}" parallel="true">
<arg value="buildLauncherWindows.php"/>
<arg value="${pkgDir}/bridge" />
<fileset dir="${serverDir}">
<include name="WEB-INF/cgi/launcher.exe"/>
</fileset>
</apply>
</target>
<target name="genAll" depends="genLauncherWindows,genLauncherUnix,genJavaProxyPhpJava,genJavaIncJava">
</target>
<!-- legacy targets with wrong file paths: to be removed; do not use!
<target name="init">
<property name="javaBaseDir" value="${basedir}/server"/>
<property name="javaSourceDir" value="${javaBaseDir}"/>
<property name="javaClassDir" value="${basedir}/bin"/>
<property name="distDir" value="${basedir}/dist"/>
<property name="libDir" value="${basedir}/unsupported"/>
<property name="cgiDir" value="${javaBaseDir}/WEB-INF/cgi"/>
<property name="sampleWebDir" value="${basedir}/examples/php+jsp"/>
<property name="php_exec" value="php"/>
<path id="compilePath">
<fileset dir="${libDir}">
<include name="*.jar"/>
</fileset>
</path>
<mkdir dir="${distDir}"/>
<mkdir dir="${javaClassDir}"/>
</target>
<target name="cleanBuild" depends="init">
<delete dir="server/documentation"/>
<delete dir="documentation"/>
<delete dir="dist"/>
<delete dir="bin"/>
<delete file="server/META-INF/java/Java.inc"/>
<delete file="server/META-INF/java/JavaProxy.php"/>
<delete file="server/php/java/bridge/JavaInc.java"/>
<delete file="server/php/java/bridge/JavaProxy.java"/>
<delete file="server/php/java/bridge/PhpDebuggerPHP.java"/>
<delete file="server/php/java/bridge/LauncherUnix.java"/>
<delete file="server/php/java/bridge/LauncherWindows.java"/>
<delete file="server/php/java/bridge/LauncherWindows2.java"/>
<delete file="server/php/java/bridge/LauncherWindows3.java"/>
<delete file="server/php/java/bridge/LauncherWindows4.java"/>
</target>
<target name="compile" depends="init,JavaIncJava,JavaProxyPhpJava,PhpDebuggerPHPJava,LauncherUnix,LauncherWindows">
<javac srcdir="${javaSourceDir}" source="1.7" target="1.7" destdir="${javaClassDir}" debug="true"
deprecation="true">
<exclude name="php/java/test/**/*.java"/>
<classpath refid="compilePath"/>
</javac>
</target>
<target name="SrcZip" depends="init,JavaBridgeProperties,JavaInc,JavaProxyPhp">
<zip zipfile="${distDir}/src.zip" compress="true">
<fileset dir="${javaSourceDir}">
<include name="php/java/**/*.java"/>
<exclude name="php/java/test/**/*.java"/>
<include name="javax/script/*.java"/>
<include name="php/java/bridge/global.properties"/>
<include name="WEB-INF/cgi/launcher.c"/>
<include name="WEB-INF/cgi/launcher.sh"/>
<include name="WEB-INF/cgi/README.sh"/>
</fileset>
<fileset dir="${javaClassDir}">
<include name="php/java/bridge/global.properties"/>
</fileset>
<fileset dir="${javaBaseDir}/META-INF">
<include name="java/*.inc"/>
<include name="java/*.php"/>
</fileset>
</zip>
</target>
<target name="JavaBridgeJar" depends="init,compile,JavaInc,JavaProxyPhp,JavaBridgeProperties">
<jar jarfile="${distDir}/JavaBridge.jar" manifest="${javaSourceDir}/META-INF/MANIFEST.MF" compress="true">
<fileset dir="${javaClassDir}">
<include name="php/java/bridge/*.class"/>
<include name="php/java/bridge/global.properties"/>
<include name="php/java/bridge/http/*.class"/>
</fileset>
<metainf dir="${javaBaseDir}/META-INF">
<include name="java/*.inc"/>
<include name="java/*.php"/>
<include name="SSLServerSocketHelperKeystore"/>
</metainf>
</jar>
</target>
<target name="PhpScriptJar" depends="init,compile">
<jar jarfile="${distDir}/php-script.jar" compress="true">
<fileset dir="${javaClassDir}">
<include name="php/java/script/*.class"/>
</fileset>
<metainf dir="${javaBaseDir}/META-INF">
<include name="services/javax.script.ScriptEngineFactory"/>
</metainf>
</jar>
</target>
<target name="ScriptApiJar" depends="init,compile">
<jar jarfile="${distDir}/script-api.jar" compress="true">
<fileset dir="${javaClassDir}">
<include name="javax/script/*.class"/>
</fileset>
</jar>
</target>
<target name="PhpServletJar" depends="init,compile">
<jar jarfile="${distDir}/php-servlet.jar" compress="true">
<fileset dir="${javaClassDir}">
<include name="php/java/servlet/*.class"/>
<include name="php/java/servlet/fastcgi/*.class"/>
<include name="php/java/script/servlet/*.class"/>
</fileset>
</jar>
</target>
<target name="JavaInc" depends="init">
<apply executable="${php_exec}" failonerror="true" dir="${javaBaseDir}" parallel="true">
<arg value="buildJavaInc.php"/>
<arg value="META-INF/java/Java.inc"/>
<arg value="META-INF/java/JavaBridge.inc"/>
<arg value="META-INF/java/Options.inc"/>
<arg value="META-INF/java/Client.inc"/>
<arg value="META-INF/java/GlobalRef.inc"/>
<arg value="META-INF/java/NativeParser.inc"/>
<arg value="META-INF/java/Parser.inc"/>
<arg value="META-INF/java/Protocol.inc"/>
<arg value="META-INF/java/SimpleParser.inc"/>
<fileset dir="${javaBaseDir}">
<include name="META-INF/java/JavaProxy.inc"/>
</fileset>
</apply>
<copy file="${javaBaseDir}/META-INF/java/Java.inc" todir="${distDir}"/>
</target>
<target name="JavaIncJava" depends="JavaInc,init">
<apply executable="${php_exec}" failonerror="true" dir="${javaBaseDir}" parallel="true">
<arg value="${javaBaseDir}/buildClassFromTextFile.php"/>
<arg value="${javaBaseDir}/php/java/bridge/JavaInc.java"/>
<arg value="JavaInc"/>
<fileset dir="${javaBaseDir}">
<include name="META-INF/java/Java.inc"/>
</fileset>
</apply>
</target>
<target name="JavaProxyPhp" depends="JavaInc,init">
<apply executable="${php_exec}" failonerror="true" dir="${javaBaseDir}" parallel="true">
<arg value="${javaBaseDir}/buildJavaProxy.php"/>
<arg value="${javaBaseDir}/META-INF/java/JavaProxy.php"/>
<fileset dir="${javaBaseDir}">
<include name="META-INF/java/Java.inc"/>
</fileset>
</apply>
</target>
<target name="JavaProxyPhpJava" depends="JavaProxyPhp,init">
<apply executable="${php_exec}" failonerror="true" dir="${javaBaseDir}" parallel="true">
<arg value="${javaBaseDir}/buildClassFromTextFile.php"/>
<arg value="${javaBaseDir}/php/java/bridge/JavaProxy.java"/>
<arg value="JavaProxy"/>
<fileset dir="${javaBaseDir}">
<include name="META-INF/java/JavaProxy.php"/>
</fileset>
</apply>
</target>
<target name="PhpDebuggerPHPJava" depends="init">
<apply executable="${php_exec}" failonerror="true" dir="${javaBaseDir}" parallel="true">
<arg value="${javaBaseDir}/buildClassFromTextFile.php"/>
<arg value="${javaBaseDir}/php/java/bridge/PhpDebuggerPHP.java"/>
<arg value="PhpDebuggerPHP"/>
<fileset dir="${javaBaseDir}">
<include name="META-INF/java/PHPDebugger.php"/>
</fileset>
</apply>
</target>
<target name="LauncherUnix" depends="init">
<apply executable="${php_exec}" failonerror="true" dir="${javaBaseDir}" parallel="true">
<arg value="${javaBaseDir}/buildClassFromTextFile.php"/>
<arg value="${javaBaseDir}/php/java/bridge/LauncherUnix.java"/>
<arg value="LauncherUnix"/>
<fileset dir="${javaBaseDir}">
<include name="WEB-INF/cgi/launcher.sh"/>
</fileset>
</apply>
</target>
<target name="LauncherWindows" depends="init">
<apply executable="${php_exec}" failonerror="true" dir="${javaBaseDir}" parallel="true">
<arg value="${javaBaseDir}/buildLauncherWindows.php"/>
<fileset dir="${javaBaseDir}">
<include name="WEB-INF/cgi/launcher.exe"/>
</fileset>
</apply>
</target>
<target name="JavaBridgeProperties" depends="init">
<apply executable="${php_exec}" failonerror="true" dir="${javaBaseDir}" parallel="true">
<arg value="${javaBaseDir}/buildJavaBridgeProperties.php"/>
<arg value="${javaBaseDir}/php/java/bridge/global.properties"/>
<fileset dir="${javaBaseDir}">
<include name="php/java/bridge/global.properties.in"/>
</fileset>
</apply>
<move file="${javaBaseDir}/php/java/bridge/global.properties"
tofile="${javaClassDir}/php/java/bridge/global.properties"/>
</target>
<target name="JavaBridgeTemplateWar" depends="JavaBridgeJar,PhpServletJar,PhpScriptJar,JavaInc,JavaProxyPhp,init">
<copy file="${sampleWebDir}/settings.php" tofile="./index.php"/>
<war destfile="${distDir}/JavaBridgeTemplate.war" webxml="${javaBaseDir}/example-web.xml">
<fileset dir=".">
<include name="index.php"/>
</fileset>
<lib dir="${distDir}">
<include name="JavaBridge.jar"/>
<include name="php-script.jar"/>
<include name="php-servlet.jar"/>
</lib>
</war>
<delete file="./index.php"/>
</target>
<target name="JavaDoc" depends="init">
<javadoc access="public" author="true" classpath="unsupported/servlet-api.jar"
destdir="doc/API" doctitle="PHP/Java Bridge" nodeprecated="false"
nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false"
packagenames="php.java.servlet,javax.script,php.java.servlet.fastcgi,php.java.bridge,php.java.script,php.java.script.servlet,php.java.bridge.http"
source="1.7" sourcepath="server" splitindex="true" use="true" version="true"/>
</target>
<target name="PhpDoc" depends="init">
<apply executable="phpdoc" failonerror="true" dir="${javaBaseDir}" parallel="true">
<arg value="-c"/>
<arg value="PHPDocConfig.ini"/>
<fileset dir="${javaBaseDir}">
<include name="META-INF/java/JavaBridge.inc"/>
<include name="META-INF/java/Options.inc"/>
<include name="META-INF/java/Client.inc"/>
<include name="META-INF/java/GlobalRef.inc"/>
<include name="META-INF/java/NativeParser.inc"/>
<include name="META-INF/java/Parser.inc"/>
<include name="META-INF/java/Protocol.inc"/>
<include name="META-INF/java/SimpleParser.inc"/>
<include name="META-INF/java/JavaProxy.inc"/>
<include name="META-INF/java/PHPDebugger.inc"/>
<include name="META-INF/java/PHPDebugger.php"/>
</fileset>
</apply>
<delete file="documentation/API/errors.html"/>
</target>
<target name="JavaBridgeWar"
depends="JavaBridgeJar,PhpServletJar,ScriptApiJar,PhpScriptJar,JavaInc,JavaProxyPhp,init">
<war destfile="${distDir}/JavaBridge.war" webxml="${javaBaseDir}/WEB-INF/web.xml">
<fileset dir="${javaBaseDir}">
<include name="WEB-INF/weblogic.xml"/>
</fileset>
<fileset dir="${javaClassDir}">
<include name="*.class"/>
</fileset>
<fileset dir="${sampleWebDir}">
<include name="*.php"/>
<include name="*.jsp"/>
<include name="**/*.rptdesign"/>
<include name="**/*.rptlibrary"/>
<include name="locale/**/*"/>
</fileset>
<fileset dir="${basedir}">
<include name="*test.php"/>
</fileset>
<lib dir="${libDir}">
<include name="*.jar"/>
<exclude name="log4j.jar"/>
<exclude name="servlet-api.jar"/>
</lib>
<lib dir="${libDir}/eclipse.birt.lib">
<include name="*"/>
</lib>
<lib dir="${distDir}">
<include name="JavaBridge.jar"/>
<include name="php-script.jar"/>
<include name="php-servlet.jar"/>
<include name="script-api.jar"/>
</lib>
<lib dir="${sampleWebDir}">
<include name="*.jar"/>
</lib>
<webinf dir="${javaBaseDir}/WEB-INF">
<include name="cgi/**/*"/>
<include name="cgi/README"/>
<exclude name="cgi/launcher.*"/>
</webinf>
<webinf dir="${libDir}">
<include name="platform/**/*"/>
</webinf>
</war>
</target>
<target name="all"
depends="JavaBridgeTemplateWar,JavaBridgeWar">
</target>
-->
</project>