build.xml
1 |
<?xml version="1.0"?>
|
---|---|
2 |
|
3 |
<!--
|
4 |
/*
|
5 |
** Module : build.xml
|
6 |
** Abstract : ant build script for the P2J project
|
7 |
**
|
8 |
** Copyright (c) 2004-2013, Golden Code Development Corporation.
|
9 |
** ALL RIGHTS RESERVED. Use is subject to license terms.
|
10 |
**
|
11 |
** Golden Code Development Corporation
|
12 |
** CONFIDENTIAL
|
13 |
**
|
14 |
** _#_ _I_ __Date__ __JPRM__ ________________Description_________________
|
15 |
** 001 GES 20041130 @18843 First version based on samples from ECF.
|
16 |
** Supports:
|
17 |
** - build and distribution dirs
|
18 |
** - clean task including all generated files
|
19 |
** - lots of antlr build stuff (thanks ECF!)
|
20 |
** - compile
|
21 |
** - jar
|
22 |
** - javadoc
|
23 |
** 002 ECF 20050201 @19521 Added support for ANTLR-based expression
|
24 |
** parser: ANTLR-specific targets and additional
|
25 |
** cleanup items.
|
26 |
** 003 ECF 20050204 @19589 Updated javadoc copyright date.
|
27 |
** 004 GES 20050411 @20661 Fixed dependencies upon progress.g and
|
28 |
** implemented new processing for change from
|
29 |
** data_df.g to schema.g.
|
30 |
** 005 ECF 20050504 @21058 Added build of p2jrt.jar. Includes only those
|
31 |
** packages needed for P2J runtime operation.
|
32 |
** Requires corresponding p2jrt.mf manifest
|
33 |
** file.
|
34 |
** 006 NVS 20050602 @21391 Added locale="en_US" option to javadoc target
|
35 |
** to eliminate the dependency from the default
|
36 |
** system locale which may vary.
|
37 |
** 007 ECF 20050831 @22483 Update to prepare target. Added task to copy
|
38 |
** DTDs to build directory.
|
39 |
** 008 ECF 20060113 @23894 Update to jar and prepare targets. Modified
|
40 |
** includes on p2jrt.jar to include newer
|
41 |
** packages and resources. XML files are now
|
42 |
** copied to build directory during prepare
|
43 |
** step.
|
44 |
** 009 ECF 20060120 @24007 Changed compile options. Enabled deprecation.
|
45 |
** 010 GES 20060126 @24083 Updated javadoc copyright date.
|
46 |
** 011 ECF 20060201 @24083 Raised maximum heap size to 256M for javadoc
|
47 |
** target. JVM was thrashing on this step,
|
48 |
** pegging the CPU for several minutes.
|
49 |
** 012 ECF 20060314 @25100 Added support for ANTLR-based HQL statement
|
50 |
** preprocessing. Added persist/hql/hql.g
|
51 |
** grammar to ANTLR targets.
|
52 |
** 013 ECF 20060811 @28591 Added p2jpl.jar to the JAR target. This jar
|
53 |
** is used exclusively on the database server to
|
54 |
** support custom, server-side functions
|
55 |
** implemented in Java.
|
56 |
** 014 ECF 20060815 @28693 Added content to p2jpl.jar. Various packages
|
57 |
** were necessary to resolve class loader
|
58 |
** dependencies originating with ContextLocal.
|
59 |
** 015 NVS 20070226 @32241 New memoryMaximumSize="128M" and fork="true"
|
60 |
** options were added to the compile target.
|
61 |
** 016 ECF 20070629 @34328 Removed H015 (@32241). The 128M limit is no
|
62 |
** longer appropriate under Java 6. The default
|
63 |
** allocation is higher and is needed with the
|
64 |
** 64-bit VM, which uses considerably more RAM
|
65 |
** for everything.
|
66 |
** 017 GES 20070821 @34945 Added e4gl.g ANTLR grammar processing. Fixed
|
67 |
** some cleanup directives and updated the
|
68 |
** generated copyright dates.
|
69 |
** 018 ECF 20080310 @37460 Removed exclusion of persist/pl directory
|
70 |
** from p2j.jar and p2jrt.jar. This package is
|
71 |
** now needed for embedded database support.
|
72 |
** 019 ECF 20080321 @37633 Added p2jspi.jar. Includes service provider
|
73 |
** interface (SPI) classes for P2J collator
|
74 |
** support. Excluded com.goldencode.p2j.spi
|
75 |
** package from all other jars.
|
76 |
** 020 ECF 20080325 @37672 Fixed regression caused by #019 (@37633).
|
77 |
** Missed including com.goldencode.html package
|
78 |
** and testcases in p2j.jar.
|
79 |
** 021 ECF 20080811 @39397 Added schema target. Allows schema generation
|
80 |
** for test databases.
|
81 |
** 022 ECF 20080910 @39783 Added memoryMaximumSize="512M" to the compile
|
82 |
** target. The default no longer seems adequate
|
83 |
** for the project. 256M seems enough with a
|
84 |
** 32-bit JVM, but 512M is used to allow for
|
85 |
** compilation on a 64-bit platform.
|
86 |
** 023 GES 20090107 @41029 Copyright date updated.
|
87 |
** 024 JJC 20090111 @41175 Added cp command to include admin_login.html
|
88 |
** in the p2j.jar file.
|
89 |
** Added code to create p2jadmin.jar
|
90 |
** 025 ECF 20090421 @41835 Added com/goldencode/util/** to jar targets.
|
91 |
** 026 GES 20090428 @42027 All com/goldencode/** is now included in p2j.jar.
|
92 |
** 027 ECF 20090605 @42607 Added com/goldencode/util/* to p2jpl.jar.
|
93 |
** 028 GES 20101117 Added directory schema to jar files. Updated
|
94 |
** javadoc copyright date.
|
95 |
** 029 LMR 20101105 Added target "native" which builds libp2j.so and
|
96 |
** copies it to build/lib/; included this build step
|
97 |
** in the "all" target.
|
98 |
** 030 GES 20110628 Removed the stat.g grammar (it is no longer
|
99 |
** needed). Added includeantruntime to javac task
|
100 |
** to eliminate a bogus warning that started appearing
|
101 |
** in Ant 1.8.
|
102 |
** 031 SIY 20110911 Included color mapping resource into resulting JAR.
|
103 |
** 032 GES 20111003 Copy chui_applet.html to build env.
|
104 |
** 033 CS 20130103 Implement OS-DIR support as an INPUT stream
|
105 |
** Added native code compile to native task.
|
106 |
** 034 ECF 20130117 Increased maxmemory for javadoc target to prevent
|
107 |
** OOME. Updated javadoc copyright notice.
|
108 |
** 035 GES 20130206 During clean, delete the new native header for
|
109 |
** FileChecker (it is a generated file).
|
110 |
** 036 CA 20130415 Added install_p2jpl task, to copy the p2jpl.jar to the
|
111 |
** /opt/pljava/$USER/ folder.
|
112 |
** 037 CA 20130416 Copy the libTerminal.so, depending on the OS architecture.
|
113 |
** 038 GES 20130430 Added native library memory management function support.
|
114 |
** 039 EVL 20130402 Adding OS detection task and different native library building
|
115 |
** instruction depending on the OS type and architecture.
|
116 |
** 040 EVL 20130618 Adding registry access native functions support.
|
117 |
** 041 EVL 20130724 Replacing CHARVA with our own console driver integrated into
|
118 |
** libp2j/p2j.dll.
|
119 |
** 042 MAG 20131115 Copy index.html to build env.
|
120 |
** Remove the copy of chui_applet.html to build env.
|
121 |
** 043 GES 20130920 Updated the list of generated JNI headers to delete.
|
122 |
*/
|
123 |
-->
|
124 |
|
125 |
<!-- A "project" describes a set of targets that may be requested
|
126 |
when Ant is executed. The "default" attribute defines the
|
127 |
target which is executed if no specific target is requested,
|
128 |
and the "basedir" attribute defines the current working directory
|
129 |
from which Ant executes the requested task. This is normally
|
130 |
set to the current working directory.
|
131 |
-->
|
132 |
|
133 |
<project name="P2J Conversion Project" default="compile" basedir="."> |
134 |
|
135 |
|
136 |
<!-- ===================== Property Definitions ========================= -->
|
137 |
|
138 |
|
139 |
<!--
|
140 |
|
141 |
Each of the following properties are used in the build script.
|
142 |
Values for these properties are set by the first place they are
|
143 |
defined, from the following list:
|
144 |
|
145 |
* Definitions on the "ant" command line (ant -Dfoo=bar compile).
|
146 |
|
147 |
* Definitions from a "build.properties" file in the top level
|
148 |
source directory of this application.
|
149 |
|
150 |
* Definitions from a "build.properties" file in the developer's
|
151 |
home directory.
|
152 |
|
153 |
* Default definitions in this build.xml file.
|
154 |
|
155 |
You will note below that property values can be composed based on the
|
156 |
contents of previously defined properties. This is a powerful technique
|
157 |
that helps you minimize the number of changes required when your development
|
158 |
environment is modified. Note that property composition is allowed within
|
159 |
"build.properties" files as well as in the "build.xml" script.
|
160 |
|
161 |
-->
|
162 |
|
163 |
<property file="build.properties"/> |
164 |
<property file="${user.home}/build.properties"/> |
165 |
|
166 |
|
167 |
<!-- ==================== File and Directory Names ====================== -->
|
168 |
|
169 |
|
170 |
<!--
|
171 |
|
172 |
These properties generally define file and directory names (or paths) that
|
173 |
affect where the build process stores its outputs.
|
174 |
|
175 |
-->
|
176 |
|
177 |
<property name="build.home" value="${basedir}/build"/> |
178 |
<property name="dist.home" value="${basedir}/dist"/> |
179 |
<property name="src.home" value="${basedir}/src"/> |
180 |
<property name="lib.home" value="${basedir}/lib"/> |
181 |
<property name="pl.home" value="${basedir}/pl" /> |
182 |
<property name="color.home" value="${basedir}/src/com/goldencode/p2j/ui" /> |
183 |
<property name="src.gcd.home" value="${basedir}/src/com/goldencode"/> |
184 |
<property name="src.p2j.home" value="${src.gcd.home}/p2j"/> |
185 |
<property name="grammar.home" value="${src.gcd.home}/p2j"/> |
186 |
<property name="manifest.dir" value="${basedir}/manifest"/> |
187 |
|
188 |
<!-- ==================== Compilation Control Options ================== -->
|
189 |
|
190 |
<!--
|
191 |
|
192 |
These properties control option settings on the Javac compiler when it
|
193 |
is invoked using the <javac> task.
|
194 |
|
195 |
compile.debug Should compilation include the debug option?
|
196 |
|
197 |
compile.deprecation Should compilation include the deprecation option?
|
198 |
|
199 |
compile.optimize Should compilation include the optimize option?
|
200 |
|
201 |
-->
|
202 |
|
203 |
<property name="compile.debug" value="true"/> |
204 |
<property name="compile.deprecation" value="true"/> |
205 |
<property name="compile.optimize" value="true"/> |
206 |
|
207 |
|
208 |
<!-- ==================== Compilation Classpath ========================= -->
|
209 |
|
210 |
<!--
|
211 |
|
212 |
Rather than relying on the CLASSPATH environment variable, Ant includes
|
213 |
features that makes it easy to dynamically construct the classpath you
|
214 |
need for each compilation. The example below constructs the compile
|
215 |
classpath to include the servlet.jar file, as well as the other components
|
216 |
that Tomcat makes available to web applications automatically, plus anything
|
217 |
that you explicitly added.
|
218 |
|
219 |
-->
|
220 |
|
221 |
<!-- Path used when compiling Java classes -->
|
222 |
|
223 |
<path id="compile.classpath"> |
224 |
|
225 |
<fileset dir="${lib.home}"> |
226 |
<include name="*.jar"/> |
227 |
</fileset>
|
228 |
|
229 |
</path>
|
230 |
|
231 |
<!-- Only used by special build-time tasks -->
|
232 |
|
233 |
<path id="tools.classpath"> |
234 |
|
235 |
<path refid="compile.classpath"/> |
236 |
<pathelement location="${build.home}/lib/p2j.jar"/> |
237 |
|
238 |
</path>
|
239 |
|
240 |
|
241 |
<!-- ==================== All Target ==================================== -->
|
242 |
|
243 |
<!--
|
244 |
|
245 |
The "all" target is a shortcut for running the "clean" target followed
|
246 |
by the "compile" target, to force a complete recompile.
|
247 |
|
248 |
-->
|
249 |
|
250 |
<target name="all" depends="clean,compile,jar,native,javadoc" |
251 |
description="Clean build directory, then compile"/> |
252 |
|
253 |
|
254 |
|
255 |
<!-- ==================== Clean Target ================================== -->
|
256 |
|
257 |
<!--
|
258 |
|
259 |
The "clean" target deletes any previous "build" directory,
|
260 |
so that you can be ensured the application can be built from scratch.
|
261 |
|
262 |
-->
|
263 |
|
264 |
<target
|
265 |
name="clean" |
266 |
description="Delete old build directory"> |
267 |
|
268 |
<delete
|
269 |
failonerror="false" |
270 |
includeEmptyDirs="true"> |
271 |
|
272 |
<fileset dir="${build.home}"/> |
273 |
<fileset dir="${dist.home}"/> |
274 |
|
275 |
<fileset dir="${src.home}/native"> |
276 |
<include name="com_goldencode_p2j_util_LaunchManager.h"/> |
277 |
<include name="com_goldencode_p2j_util_FileChecker.h"/> |
278 |
<include name="com_goldencode_p2j_util_FileSystemDaemon.h"/> |
279 |
<include name="com_goldencode_p2j_util_MemoryManager.h"/> |
280 |
<include name="com_goldencode_p2j_util_LibraryManager.h"/> |
281 |
<include name="com_goldencode_p2j_util_Registry.h"/> |
282 |
<include name="com_goldencode_p2j_ui_client_chui_driver_console_ConsoleHelper.h"/> |
283 |
</fileset>
|
284 |
|
285 |
</delete>
|
286 |
|
287 |
<!-- delete preprocessor generated files -->
|
288 |
<delete file="${src.p2j.home}/preproc/PreprocTokenTypes.java"/> |
289 |
<delete file="${src.p2j.home}/preproc/PreprocTokenTypes.txt"/> |
290 |
<delete file="${src.p2j.home}/preproc/BracesParser.java"/> |
291 |
<delete file="${src.p2j.home}/preproc/BracesLexer.java"/> |
292 |
<delete file="${src.p2j.home}/preproc/TextParser.java"/> |
293 |
<delete file="${src.p2j.home}/preproc/TextLexer.java"/> |
294 |
|
295 |
<!-- delete schema generated files -->
|
296 |
<delete file="${src.p2j.home}/schema/ProgressParserTokenTypes.txt"/> |
297 |
<delete file="${src.p2j.home}/schema/SchemaParserTokenTypes.java"/> |
298 |
<delete file="${src.p2j.home}/schema/SchemaParserTokenTypes.txt"/> |
299 |
<delete file="${src.p2j.home}/schema/SchemaParser.java"/> |
300 |
|
301 |
<!-- delete uast generated files -->
|
302 |
<delete file="${src.p2j.home}/uast/ProgressParserTokenTypes.java"/> |
303 |
<delete file="${src.p2j.home}/uast/ProgressParserTokenTypes.txt"/> |
304 |
<delete file="${src.p2j.home}/uast/ProgressParser.java"/> |
305 |
<delete file="${src.p2j.home}/uast/ProgressLexer.java"/> |
306 |
<delete file="${src.p2j.home}/uast/ExpressionEvaluatorTokenTypes.java"/> |
307 |
<delete file="${src.p2j.home}/uast/ExpressionEvaluatorTokenTypes.txt"/> |
308 |
<delete file="${src.p2j.home}/uast/ExpressionEvaluator.java"/> |
309 |
|
310 |
<!-- delete e4gl generated files -->
|
311 |
<delete file="${src.p2j.home}/e4gl/E4GLParserTokenTypes.java"/> |
312 |
<delete file="${src.p2j.home}/e4gl/E4GLParserTokenTypes.txt"/> |
313 |
<delete file="${src.p2j.home}/e4gl/E4GLParser.java"/> |
314 |
<delete file="${src.p2j.home}/e4gl/E4GLLexer.java"/> |
315 |
|
316 |
<!-- delete expr generated files -->
|
317 |
<delete file="${src.gcd.home}/expr/ExpressionParserTokenTypes.java"/> |
318 |
<delete file="${src.gcd.home}/expr/ExpressionParserTokenTypes.txt"/> |
319 |
<delete file="${src.gcd.home}/expr/ExpressionParser.java"/> |
320 |
<delete file="${src.gcd.home}/expr/ExpressionLexer.java"/> |
321 |
|
322 |
<!-- delete hql generated files -->
|
323 |
<delete file="${src.p2j.home}/persist/hql/HQLParserTokenTypes.java"/> |
324 |
<delete file="${src.p2j.home}/persist/hql/HQLParserTokenTypes.txt"/> |
325 |
<delete file="${src.p2j.home}/persist/hql/HQLParser.java"/> |
326 |
<delete file="${src.p2j.home}/persist/hql/HQLLexer.java"/> |
327 |
|
328 |
</target>
|
329 |
|
330 |
|
331 |
|
332 |
<!-- ==================== Prepare Target ================================ -->
|
333 |
|
334 |
<!--
|
335 |
|
336 |
The "prepare" target is used to create the "build" destination directory,
|
337 |
and copy the static contents of your web application to it. If you need
|
338 |
to copy static files from external dependencies, you can customize the
|
339 |
contents of this task.
|
340 |
|
341 |
Normally, this task is executed indirectly when needed.
|
342 |
|
343 |
-->
|
344 |
|
345 |
<target name="prepare"> |
346 |
|
347 |
<!-- Create build directories as needed -->
|
348 |
<mkdir dir="${build.home}" /> |
349 |
<mkdir dir="${build.home}/lib" /> |
350 |
<mkdir dir="${build.home}/classes" /> |
351 |
<mkdir dir="${build.home}/classes/META-INF/services" /> |
352 |
|
353 |
<mkdir dir="${build.home}/native" /> |
354 |
|
355 |
<!-- Copy DTDs from src to equivalent location in build -->
|
356 |
<copy todir="${build.home}/classes"> |
357 |
<fileset dir="${src.home}" includes="**/*.dtd" /> |
358 |
</copy>
|
359 |
|
360 |
<!-- Copy XML files from src to equivalent location in build -->
|
361 |
<copy todir="${build.home}/classes"> |
362 |
<fileset dir="${src.home}" includes="**/*.xml" /> |
363 |
</copy>
|
364 |
|
365 |
<!-- Copy admin_login.html file from src to a location in build -->
|
366 |
<copy todir="${build.home}/classes"> |
367 |
<fileset dir="${src.home}" includes="**/admin_login.html" /> |
368 |
</copy>
|
369 |
|
370 |
<!-- Copy index.html file from src to a location in build -->
|
371 |
<copy todir="${build.home}/classes"> |
372 |
<fileset dir="${src.home}" includes="**/index.html" /> |
373 |
</copy>
|
374 |
|
375 |
<!-- Create distribution directory as needed -->
|
376 |
<mkdir dir="${dist.home}" /> |
377 |
<mkdir dir="${dist.home}/docs/api" /> |
378 |
|
379 |
<!-- Copy external jars -->
|
380 |
<copy todir="${build.home}/lib"> |
381 |
<fileset dir="${lib.home}" /> |
382 |
</copy>
|
383 |
|
384 |
<!-- Copy PL/Java p2jpl.ddr SQLJ deployment descriptor to jar location -->
|
385 |
<copy todir="${build.home}/classes"> |
386 |
<fileset dir="${pl.home}" includes="p2jpl.ddr" /> |
387 |
</copy>
|
388 |
|
389 |
<!-- Copy SPI descriptors to META-INF/services directory -->
|
390 |
<copy todir="${build.home}/classes/META-INF/services"> |
391 |
<fileset dir="${manifest.dir}" includes="*Provider" /> |
392 |
</copy>
|
393 |
|
394 |
<!-- Copy color specification to jar location -->
|
395 |
<copy todir="${build.home}/classes"> |
396 |
<fileset dir="${color.home}" includes="color-table.properties" /> |
397 |
</copy>
|
398 |
|
399 |
</target>
|
400 |
|
401 |
|
402 |
<!-- ==================== ANTLR Target ================================== -->
|
403 |
|
404 |
<!--
|
405 |
|
406 |
The "antlr" target transforms ANTLR grammar files (*.g) into a set of Java
|
407 |
source files.
|
408 |
|
409 |
Each individual grammar has two targets. One checks whether the transform
|
410 |
target files are up to date and stores the result of this check in a named
|
411 |
property ('<grammar_target_name>.utd'). The companion target checks the
|
412 |
value of this property and only runs if the property is false. This avoids
|
413 |
unnecessary processing and long(er) build times.
|
414 |
|
415 |
By convention, the target which runs the ANTLR transformer (the "primary"
|
416 |
target) is named 'antlr_<grammar_filename_sans_extension>'. The target
|
417 |
which performs the up to date check (the "secondary" target) is named
|
418 |
'chk_antlr_<grammar_filename_sans_extension>'.
|
419 |
|
420 |
The main antlr target has a dependency for the primary target for each
|
421 |
separate ANTLR grammar. As new grammars are added, the "dependency"
|
422 |
attribute of the main target must be updated, as this is what drives the
|
423 |
ANTLR processing. Note that the order of these dependencies determines the
|
424 |
order in which the dependent targets will be processed.
|
425 |
|
426 |
-->
|
427 |
|
428 |
<target name="antlr" |
429 |
depends="prepare |
430 |
,antlr_progress
|
431 |
,antlr_expression_evaluator
|
432 |
,antlr_text
|
433 |
,antlr_braces
|
434 |
,antlr_e4gl
|
435 |
,antlr_schema
|
436 |
,antlr_expression_compiler
|
437 |
,antlr_hql
|
438 |
"
|
439 |
description="Run ANTLR transformer against all updated grammars"/> |
440 |
|
441 |
<!-- Pair of targets for ANTLR grammar expr/function.g -->
|
442 |
|
443 |
<!-- Grammar up to date checker -->
|
444 |
<target name="chk_antlr_expression_compiler"> |
445 |
|
446 |
<uptodate property="antlr_expression_compiler.utd" |
447 |
srcfile="${src.gcd.home}/expr/expression.g"> |
448 |
|
449 |
<!-- One or more targets to be checked -->
|
450 |
<mapper type="merge" to="${src.gcd.home}/expr/ExpressionParser.java"/> |
451 |
|
452 |
</uptodate>
|
453 |
|
454 |
</target>
|
455 |
|
456 |
<!-- Grammar transformer -->
|
457 |
<target name="antlr_expression_compiler" |
458 |
depends="chk_antlr_expression_compiler" |
459 |
unless="antlr_expression_compiler.utd"> |
460 |
|
461 |
<antlr target="${src.gcd.home}/expr/expression.g" |
462 |
traceLexer="no" |
463 |
traceParser="no"> |
464 |
<classpath refid="compile.classpath"/> |
465 |
</antlr>
|
466 |
|
467 |
</target>
|
468 |
|
469 |
<!-- End ANTLR grammar target pair -->
|
470 |
|
471 |
<!-- Pair of targets for ANTLR grammar uast/progress.g -->
|
472 |
|
473 |
<!-- Grammar up to date checker -->
|
474 |
<target name="chk_antlr_progress"> |
475 |
|
476 |
<uptodate property="antlr_progress.utd" |
477 |
srcfile="${grammar.home}/uast/progress.g"> |
478 |
|
479 |
<!-- One or more targets to be checked -->
|
480 |
<mapper type="merge" to="${grammar.home}/uast/ProgressParser.java"/> |
481 |
|
482 |
</uptodate>
|
483 |
|
484 |
</target>
|
485 |
|
486 |
<!-- Grammar transformer -->
|
487 |
<target name="antlr_progress" |
488 |
depends="chk_antlr_progress" |
489 |
unless="antlr_progress.utd"> |
490 |
|
491 |
<antlr target="${grammar.home}/uast/progress.g" |
492 |
traceLexer="no" |
493 |
traceParser="no"> |
494 |
<classpath refid="compile.classpath"/> |
495 |
</antlr>
|
496 |
|
497 |
<!-- copy the latest token types vocabulary so schema grammars can
|
498 |
import it -->
|
499 |
<copy todir="${grammar.home}/schema"> |
500 |
<fileset file="${grammar.home}/uast/ProgressParserTokenTypes.txt"/> |
501 |
</copy>
|
502 |
|
503 |
<!-- make sure that dependent code is regenerated (ANT can't properly
|
504 |
be made to have multiple dependencies) -->
|
505 |
<delete file="${src.p2j.home}/uast/ExpressionEvaluator.java"/> |
506 |
<delete file="${src.p2j.home}/schema/SchemaParser.java"/> |
507 |
|
508 |
</target>
|
509 |
|
510 |
<!-- End ANTLR grammar target pair -->
|
511 |
|
512 |
<!-- Pair of targets for ANTLR grammar uast/expression_evaluator.g -->
|
513 |
|
514 |
<!-- Grammar up to date checker -->
|
515 |
<target name="chk_antlr_expression_evaluator"> |
516 |
|
517 |
<uptodate property="antlr_expression_evaluator.utd" |
518 |
srcfile="${grammar.home}/uast/expression_evaluator.g"> |
519 |
<!-- One or more targets to be checked -->
|
520 |
<mapper type="merge" |
521 |
to="${grammar.home}/uast/ExpressionEvaluator.java"/> |
522 |
</uptodate>
|
523 |
|
524 |
</target>
|
525 |
|
526 |
<!-- Grammar transformer -->
|
527 |
<target name="antlr_expression_evaluator" |
528 |
depends="chk_antlr_expression_evaluator" |
529 |
unless="antlr_expression_evaluator.utd"> |
530 |
|
531 |
<antlr target="${grammar.home}/uast/expression_evaluator.g" |
532 |
traceLexer="no" |
533 |
traceParser="no"> |
534 |
<classpath refid="compile.classpath"/> |
535 |
</antlr>
|
536 |
|
537 |
</target>
|
538 |
|
539 |
<!-- End ANTLR grammar target pair -->
|
540 |
|
541 |
<!-- Pair of targets for ANTLR grammar schema/schema.g -->
|
542 |
|
543 |
<!-- Grammar up to date checker -->
|
544 |
<target name="chk_antlr_schema"> |
545 |
|
546 |
<uptodate property="antlr_schema.utd" |
547 |
srcfile="${grammar.home}/schema/schema.g"> |
548 |
|
549 |
<!-- One or more targets to be checked -->
|
550 |
<mapper type="merge" to="${grammar.home}/schema/SchemaParser.java"/> |
551 |
|
552 |
</uptodate>
|
553 |
|
554 |
</target>
|
555 |
|
556 |
<!-- Grammar transformer -->
|
557 |
<target name="antlr_schema" |
558 |
depends="chk_antlr_schema" |
559 |
unless="antlr_schema.utd"> |
560 |
|
561 |
<antlr target="${grammar.home}/schema/schema.g" |
562 |
traceLexer="no" |
563 |
traceParser="no"> |
564 |
<classpath refid="compile.classpath"/> |
565 |
</antlr>
|
566 |
|
567 |
</target>
|
568 |
|
569 |
<!-- End ANTLR grammar target pair -->
|
570 |
|
571 |
<!-- Pair of targets for ANTLR grammar preproc/text.g -->
|
572 |
|
573 |
<!-- Grammar up to date checker -->
|
574 |
<target name="chk_antlr_text"> |
575 |
|
576 |
<uptodate property="antlr_text.utd" |
577 |
srcfile="${grammar.home}/preproc/text.g"> |
578 |
|
579 |
<!-- One or more targets to be checked (one mapper entry per file) -->
|
580 |
<mapper type="merge" to="${grammar.home}/preproc/TextParser.java"/> |
581 |
|
582 |
</uptodate>
|
583 |
|
584 |
</target>
|
585 |
|
586 |
<!-- Grammar transformer -->
|
587 |
<target name="antlr_text" |
588 |
depends="chk_antlr_text" |
589 |
unless="antlr_text.utd"> |
590 |
|
591 |
<antlr target="${grammar.home}/preproc/text.g" |
592 |
traceLexer="no" |
593 |
traceParser="no"> |
594 |
<classpath refid="compile.classpath"/> |
595 |
</antlr>
|
596 |
|
597 |
</target>
|
598 |
|
599 |
<!-- End ANTLR grammar target pair -->
|
600 |
|
601 |
<!-- Pair of targets for ANTLR grammar preproc/braces.g -->
|
602 |
|
603 |
<!-- Grammar up to date checker -->
|
604 |
<target name="chk_antlr_braces"> |
605 |
|
606 |
<uptodate property="antlr_braces.utd" |
607 |
srcfile="${grammar.home}/preproc/braces.g"> |
608 |
|
609 |
<!-- One or more targets to be checked (one mapper entry per file) -->
|
610 |
<mapper type="merge" to="${grammar.home}/preproc/BracesParser.java"/> |
611 |
|
612 |
</uptodate>
|
613 |
|
614 |
</target>
|
615 |
|
616 |
<!-- Grammar transformer -->
|
617 |
<target name="antlr_braces" |
618 |
depends="chk_antlr_braces" |
619 |
unless="antlr_braces.utd"> |
620 |
|
621 |
<antlr target="${grammar.home}/preproc/braces.g" |
622 |
traceLexer="no" |
623 |
traceParser="no"> |
624 |
<classpath refid="compile.classpath"/> |
625 |
</antlr>
|
626 |
|
627 |
</target>
|
628 |
|
629 |
<!-- End ANTLR grammar target pair -->
|
630 |
|
631 |
<!-- Pair of targets for ANTLR grammar e4gl/e4gl.g -->
|
632 |
|
633 |
<!-- Grammar up to date checker -->
|
634 |
<target name="chk_antlr_e4gl"> |
635 |
|
636 |
<uptodate property="antlr_e4gl.utd" |
637 |
srcfile="${grammar.home}/e4gl/e4gl.g"> |
638 |
|
639 |
<!-- One or more targets to be checked (one mapper entry per file) -->
|
640 |
<mapper type="merge" to="${grammar.home}/e4gl/E4GLParser.java"/> |
641 |
|
642 |
</uptodate>
|
643 |
|
644 |
</target>
|
645 |
|
646 |
<!-- Grammar transformer -->
|
647 |
<target name="antlr_e4gl" |
648 |
depends="chk_antlr_e4gl" |
649 |
unless="antlr_e4gl.utd"> |
650 |
|
651 |
<antlr target="${grammar.home}/e4gl/e4gl.g" |
652 |
traceLexer="no" |
653 |
traceParser="no"> |
654 |
<classpath refid="compile.classpath"/> |
655 |
</antlr>
|
656 |
|
657 |
</target>
|
658 |
|
659 |
<!-- End ANTLR grammar target pair -->
|
660 |
|
661 |
<!-- Pair of targets for ANTLR grammar persist/hql/hql.g -->
|
662 |
|
663 |
<!-- Grammar up to date checker -->
|
664 |
<target name="chk_antlr_hql"> |
665 |
|
666 |
<uptodate property="antlr_hql.utd" |
667 |
srcfile="${grammar.home}/persist/hql/hql.g"> |
668 |
|
669 |
<!-- One or more targets to be checked (one mapper entry per file) -->
|
670 |
<mapper type="merge" to="${grammar.home}/persist/hql/HQLParser.java"/> |
671 |
|
672 |
</uptodate>
|
673 |
|
674 |
</target>
|
675 |
|
676 |
<!-- Grammar transformer -->
|
677 |
<target name="antlr_hql" |
678 |
depends="chk_antlr_hql" |
679 |
unless="antlr_hql.utd"> |
680 |
|
681 |
<antlr target="${grammar.home}/persist/hql/hql.g" |
682 |
traceLexer="no" |
683 |
traceParser="no"> |
684 |
<classpath refid="compile.classpath"/> |
685 |
</antlr>
|
686 |
|
687 |
</target>
|
688 |
|
689 |
<!-- End ANTLR grammar target pair -->
|
690 |
|
691 |
|
692 |
<!-- ==================== Compile Target ================================ -->
|
693 |
|
694 |
<!--
|
695 |
|
696 |
The "compile" target transforms source files (from your "src" directory)
|
697 |
into object files in the appropriate location in the build directory.
|
698 |
|
699 |
-->
|
700 |
|
701 |
<target name="compile" |
702 |
depends="antlr" |
703 |
description="Compile Java sources"> |
704 |
|
705 |
<!-- Compile Java classes as necessary -->
|
706 |
|
707 |
<javac srcdir="${src.home}" |
708 |
destdir="${build.home}/classes" |
709 |
memoryMaximumSize="512M" |
710 |
fork="true" |
711 |
debug="${compile.debug}" |
712 |
deprecation="${compile.deprecation}" |
713 |
optimize="${compile.optimize}" |
714 |
includeantruntime="false"> |
715 |
|
716 |
<classpath refid="compile.classpath"/> |
717 |
|
718 |
</javac>
|
719 |
|
720 |
</target>
|
721 |
|
722 |
<!-- prepare for native library building -->
|
723 |
<target name="native_prepare" |
724 |
description="Common steps in building native library (called via JNI)"> |
725 |
|
726 |
<javah class="com.goldencode.p2j.util.LaunchManager" |
727 |
destdir="${src.home}/native" |
728 |
classpath="${build.home}/classes"/> |
729 |
<javah class="com.goldencode.p2j.util.FileChecker" |
730 |
destdir="${src.home}/native" |
731 |
classpath="${build.home}/classes"/> |
732 |
<javah class="com.goldencode.p2j.util.FileSystemDaemon" |
733 |
destdir="${src.home}/native" |
734 |
classpath="${build.home}/classes"/> |
735 |
<javah class="com.goldencode.p2j.util.MemoryManager" |
736 |
destdir="${src.home}/native" |
737 |
classpath="${build.home}/classes"/> |
738 |
<javah class="com.goldencode.p2j.util.LibraryManager" |
739 |
destdir="${src.home}/native" |
740 |
classpath="${build.home}/classes"/> |
741 |
<javah class="com.goldencode.p2j.util.Registry" |
742 |
destdir="${src.home}/native" |
743 |
classpath="${build.home}/classes"/> |
744 |
<javah class="com.goldencode.p2j.ui.client.chui.driver.console.ConsoleHelper" |
745 |
destdir="${src.home}/native" |
746 |
classpath="${build.home}/classes"/> |
747 |
<copy todir="${build.home}/native"> |
748 |
<fileset dir="${src.home}/native" includes="makefile" /> |
749 |
</copy>
|
750 |
|
751 |
<condition property="libname" value="p2j.dll"> |
752 |
<os family="windows" /> |
753 |
</condition>
|
754 |
<condition property="libname" value="libp2j.so"> |
755 |
<not>
|
756 |
<os family="windows" /> |
757 |
</not>
|
758 |
</condition>
|
759 |
|
760 |
<condition property="native.build.tool" value="gmake" > |
761 |
<os name="SunOS"/> |
762 |
</condition>
|
763 |
<condition property="native.build.tool" value="make" > |
764 |
<not>
|
765 |
<os name="SunOS"/> |
766 |
</not>
|
767 |
</condition>
|
768 |
</target>
|
769 |
|
770 |
<!-- build the native library -->
|
771 |
<target name="native" |
772 |
depends="compile, native_prepare" |
773 |
description="Compile the native shared library (to be called via JNI)" > |
774 |
|
775 |
<exec dir="${build.home}/native" executable="${native.build.tool}" failonerror="true"> |
776 |
<arg value="SONAME=${libname}" /> |
777 |
<arg value="SRCDIR=${src.home}/native"/> |
778 |
<arg value="JRE_HOME=${java.home}"/> |
779 |
</exec>
|
780 |
|
781 |
<copy todir="${build.home}/lib"> |
782 |
<fileset dir="${build.home}/native" includes="${libname}" /> |
783 |
</copy>
|
784 |
|
785 |
</target>
|
786 |
|
787 |
<!-- ==================== Jar Target ============================ -->
|
788 |
|
789 |
<target name="jar" depends="compile"> |
790 |
|
791 |
<jar jarfile="${build.home}/lib/p2j.jar" |
792 |
basedir="${build.home}/classes" |
793 |
includes="com/goldencode/** |
794 |
*.dtd
|
795 |
*.xml
|
796 |
*.properties"
|
797 |
excludes="com/goldencode/p2j/spi/* |
798 |
com/goldencode/p2j/admin/client/*"
|
799 |
manifest="${manifest.dir}/p2j.mf" |
800 |
/>
|
801 |
|
802 |
<jar jarfile="${build.home}/lib/p2jrt.jar" |
803 |
basedir="${build.home}/classes" |
804 |
includes="com/goldencode/expr/* |
805 |
com/goldencode/p2j/cfg/*
|
806 |
com/goldencode/p2j/directory/*
|
807 |
com/goldencode/p2j/main/*
|
808 |
com/goldencode/p2j/net/*
|
809 |
com/goldencode/p2j/persist/*
|
810 |
com/goldencode/p2j/persist/event/*
|
811 |
com/goldencode/p2j/persist/hql/*
|
812 |
com/goldencode/p2j/security/*
|
813 |
com/goldencode/p2j/ui/**
|
814 |
com/goldencode/p2j/util/*
|
815 |
com/goldencode/p2j/xml/*
|
816 |
com/goldencode/p2j/*
|
817 |
com/goldencode/util/*
|
818 |
*.dtd
|
819 |
*.xml"
|
820 |
excludes="com/goldencode/p2j/spi/*" |
821 |
manifest="${manifest.dir}/p2jrt.mf" |
822 |
/>
|
823 |
|
824 |
<jar jarfile="${build.home}/lib/p2jpl.jar" |
825 |
basedir="${build.home}/classes" |
826 |
includes="com/goldencode/p2j/cfg/* |
827 |
com/goldencode/p2j/directory/*
|
828 |
com/goldencode/p2j/persist/pl/*
|
829 |
com/goldencode/p2j/security/*
|
830 |
com/goldencode/p2j/ui/*
|
831 |
com/goldencode/p2j/util/*
|
832 |
com/goldencode/p2j/*
|
833 |
com/goldencode/expr/*
|
834 |
com/goldencode/util/*
|
835 |
p2jpl.ddr"
|
836 |
excludes="com/goldencode/p2j/spi/*" |
837 |
manifest="${manifest.dir}/p2jpl.mf" |
838 |
/>
|
839 |
|
840 |
<jar jarfile="${build.home}/lib/p2jspi.jar" |
841 |
basedir="${build.home}/classes" |
842 |
includes="com/goldencode/p2j/spi/* |
843 |
META-INF/services/*"
|
844 |
/>
|
845 |
|
846 |
<jar jarfile="${build.home}/lib/p2jadmin.jar" |
847 |
basedir="${build.home}/classes" |
848 |
includes="com/goldencode/p2j/admin/client/* |
849 |
com/goldencode/p2j/admin/*
|
850 |
com/goldencode/p2j/security/*
|
851 |
com/goldencode/p2j/net/*
|
852 |
com/goldencode/p2j/cfg/*
|
853 |
com/goldencode/expr/*
|
854 |
com/goldencode/p2j/directory/*
|
855 |
com/goldencode/p2j/util/*"
|
856 |
/>
|
857 |
|
858 |
</target>
|
859 |
|
860 |
<!-- ==================== Javadoc Target ========================== -->
|
861 |
|
862 |
<!--
|
863 |
|
864 |
The "javadoc" target creates Javadoc API documentation for the Java
|
865 |
classes included in your application. Normally, this is only required
|
866 |
when preparing a distribution release, but is available as a separate
|
867 |
target in case the developer wants to create Javadocs independently.
|
868 |
|
869 |
-->
|
870 |
|
871 |
<target name="javadoc" |
872 |
depends="compile" |
873 |
description="Create Javadoc API documentation"> |
874 |
|
875 |
<javadoc sourcepath="${src.home}" |
876 |
destdir="${dist.home}/docs/api" |
877 |
maxmemory="1g" |
878 |
access="private" |
879 |
Footer="Copyright (c) 2004-2013, Golden Code Development |
880 |
Corporation.<br>
|
881 |
ALL RIGHTS RESERVED. Use is subject to license terms."
|
882 |
Windowtitle="P2J - Progress 4GL to Java Conversion and Runtime" |
883 |
locale="en_US" |
884 |
packagenames="*"> |
885 |
|
886 |
<classpath refid="compile.classpath"/> |
887 |
|
888 |
</javadoc>
|
889 |
|
890 |
</target>
|
891 |
<!-- ============= Hibernate Schema Generation Target ============= -->
|
892 |
|
893 |
<!--
|
894 |
|
895 |
The "schema" target uses Hibernate ORM mapping documents to generate
|
896 |
Database Definition Language (DDL) statements to create the matching
|
897 |
schema in a Postgres database. The schema is not actually applied to
|
898 |
the database directly; the DDL is emitted but not executed. This is
|
899 |
because additional DDL statements must be added to make the schema
|
900 |
complete.
|
901 |
|
902 |
To generate the DDL for a particular database, invoke this target, passing
|
903 |
the database name to ant as a property named 'target.db'. For instance:
|
904 |
|
905 |
ant -Dcfg.dir=testcases/uast/cfg/ -Dtarget.db=p2j_test schema
|
906 |
|
907 |
Note that the 'cfg.dir' property also is required. This should be the
|
908 |
directory which contains the Hibernate configuration file.
|
909 |
|
910 |
P2J runtime environment is a prerequisite.
|
911 |
|
912 |
-->
|
913 |
|
914 |
<target name="schema" |
915 |
depends="prepare" |
916 |
description="Generate DDL from hibernate mapping files"> |
917 |
|
918 |
<taskdef name="schema-gen" |
919 |
classname="org.hibernate.tool.hbm2ddl.SchemaExportTask" |
920 |
classpathref="tools.classpath" /> |
921 |
|
922 |
<schema-gen config="${cfg.dir}/hibernate.cfg.xml" |
923 |
quiet="yes" |
924 |
text="yes" |
925 |
drop="no" |
926 |
output="${basedir}/schema-create-${target.db}.sql" |
927 |
delimiter=";"> |
928 |
|
929 |
<fileset dir="${build.home}/classes"> |
930 |
<include name="**/${target.db}/impl/*.hbm.xml" /> |
931 |
</fileset>
|
932 |
|
933 |
</schema-gen>
|
934 |
|
935 |
</target>
|
936 |
|
937 |
<target name="install_p2jpl" |
938 |
depends="jar" |
939 |
description="Install the p2jpl.jar file in the /opt/pljava/${user.name} folder or the one specified by the 'p2jpl_location' property"> |
940 |
<condition property="p2jpl_location" value="/opt/pljava/${user.name}"> |
941 |
<not>
|
942 |
<isset property="p2jpl_location"/> |
943 |
</not>
|
944 |
</condition>
|
945 |
|
946 |
<mkdir dir="${p2jpl_location}"/> |
947 |
<copy todir="${p2jpl_location}"> |
948 |
<fileset file="${build.home}/lib/p2jpl.jar"/> |
949 |
</copy>
|
950 |
<chmod file="${p2jpl_location}/p2jpl.jar" perm="gou+r"/> |
951 |
</target>
|
952 |
</project>
|