forked from javacc/javacc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
728 lines (569 loc) · 28 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
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
<?xml version='1.0' encoding='ISO-8859-1' ?>
<!--
Copyright (c) 2006, Sun Microsystems, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Sun Microsystems, Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
-->
<project name="javacc" default="jar" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.1.3.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" />
<property name="java-src" value="src/main/java" />
<property name="test-src" value="src/test/java" />
<property name="resources-src" value="src/main/resources" />
<property name="generated-src" value="src/main/generated-sources" />
<property name="parser-generated-src" value="${generated-src}/org/javacc/parser" />
<property name="utils-generated-src" value="${generated-src}/org/javacc/utils" />
<property name="jjtree-generated-src" value="${generated-src}/org/javacc/jjtree" />
<property name="test-tmp" value="test.tmp" />
<property name="bootstrap-jar" value="bootstrap/javacc.jar" />
<property name="jjtree-bootstrap-class" value="org.javacc.jjtree.Main" />
<property name="javacc-bootstrap-class" value="org.javacc.parser.Main" />
<property name="target-folder" value="target" />
<property file="${resources-src}/version.properties" />
<!-- property name="version" value="${version.major}.${version.minor}.${version.patch}-SNAPSHOT" / -->
<property name="version" value="${version.major}.${version.minor}.${version.patch}" />
<property name="javacc" value="${target-folder}/javacc.jar" />
<property name="javacc-vith-version" value="javacc-${version}.jar" />
<property name="javacc-sources-jar" value="javacc-${version}-sources.jar" />
<property name="javacc-javadoc-jar" value="javacc-${version}-javadoc.jar" />
<property name="javacc-path" value="${target-folder}/${javacc-vith-version}" />
<property name="javacc-sources-path" value="${target-folder}/${javacc-sources-jar}" />
<property name="javacc-javadoc-path" value="${target-folder}/${javacc-javadoc-jar}" />
<target name="clean">
<delete dir="classes" />
<delete dir="${target-folder}" />
<delete dir="test.tmp" />
<delete dir="dist" />
</target>
<target name="clean_generated_sources">
<delete dir="${generated-src}" />
</target>
<target name="compile" depends="clean, clean_generated_sources">
<mkdir dir="${generated-src}" />
<mkdir dir="${parser-generated-src}" />
<mkdir dir="${utils-generated-src}" />
<mkdir dir="${jjtree-generated-src}" />
<!-- Generate the Java CC Main Parser -->
<java classname="${javacc-bootstrap-class}" classpath="${bootstrap-jar}" dir="${basedir}/src/main/javacc" fork="true">
<arg value="-OUTPUT_DIRECTORY=${basedir}/${parser-generated-src}" />
<arg value="JavaCC.jj" />
</java>
<!-- This class is overriden -->
<delete file="${parser-generated-src}/Token.java" />
<!-- Generate the JJTree Parser Definition (from the tree definition) -->
<java classname="${jjtree-bootstrap-class}" classpath="${bootstrap-jar}" dir="${basedir}/src/main/jjtree" fork="true">
<arg value="-OUTPUT_DIRECTORY=${basedir}/${jjtree-generated-src}" />
<arg value="JJTree.jjt" />
</java>
<!-- Generate the JJTree Parser -->
<java classname="${javacc-bootstrap-class}" classpath="${bootstrap-jar}" dir="${basedir}/${jjtree-generated-src}" fork="true">
<arg value="-OUTPUT_DIRECTORY=${basedir}/${jjtree-generated-src}" />
<arg value="JJTree.jj" />
</java>
<!-- Delete the .jj file created by the jjtree program and the classes that were override and already added into the main source path -->
<delete file="${jjtree-generated-src}/JJTree.jj" />
<delete file="${jjtree-generated-src}/ASTBNF.java" />
<delete file="${jjtree-generated-src}/ASTBNFAction.java" />
<delete file="${jjtree-generated-src}/ASTBNFDeclaration.java" />
<delete file="${jjtree-generated-src}/ASTBNFNodeScope.java" />
<delete file="${jjtree-generated-src}/ASTCompilationUnit.java" />
<delete file="${jjtree-generated-src}/ASTExpansionNodeScope.java" />
<delete file="${jjtree-generated-src}/ASTGrammar.java" />
<delete file="${jjtree-generated-src}/ASTJavacode.java" />
<delete file="${jjtree-generated-src}/ASTJavacodeBody.java" />
<delete file="${jjtree-generated-src}/ASTNodeDescriptor.java" />
<delete file="${jjtree-generated-src}/ASTNodeDescriptorExpression.java" />
<delete file="${jjtree-generated-src}/ASTOptionBinding.java" />
<delete file="${jjtree-generated-src}/ASTOptions.java" />
<delete file="${jjtree-generated-src}/JJTreeParserVisitor.java" />
<delete file="${jjtree-generated-src}/JJTreeParserDefaultVisitor.java" />
<delete file="${jjtree-generated-src}/Token.java" />
<!-- Generate the Condition Parser -->
<java classname="${javacc-bootstrap-class}" classpath="${bootstrap-jar}" dir="${basedir}/src/main/javacc" fork="true">
<arg value="-OUTPUT_DIRECTORY=${basedir}/${utils-generated-src}" />
<arg value="ConditionParser.jj" />
</java>
<mkdir dir="classes" />
<copy todir="classes/templates">
<fileset dir="${resources-src}/templates" />
</copy>
<copy file="${resources-src}/version.properties" todir="classes" />
<javac srcdir="${java-src}" destdir="classes" debug="true" classpath="" includeantruntime='false'>
<src path="${java-src}" />
<src path="${generated-src}" />
<src path="${resources-src}" />
</javac>
</target>
<target name="jar" description="create javacc.jar">
<antcall target="jar-nocompile" />
</target>
<!-- Be careful not to include the test files in the distribution. -->
<target name="jar-check">
<uptodate property="jar.uptodate" targetfile="${javacc-path}">
<srcfiles dir="src/main" />
</uptodate>
</target>
<target name="jar-nocompile" depends="jar-check" unless="jar.uptodate">
<mkdir dir="${target-folder}" />
<antcall target="compile" />
<jar jarfile="${javacc}" basedir="classes" compress="true" />
<jar jarfile="${javacc-path}" basedir="classes" compress="true" />
</target>
<target name="dist" depends="jar, javadoc" description="build a distribution">
<property name="install-name" value="${target-folder}/javacc-${version}" />
<delete file="${install-name}-distribution.tar.gz" />
<tar destfile="${install-name}-distribution.tar.gz" compression="gzip">
<tarfileset username="root" uid="1" group="root" prefix="javacc-${version}/docs" filemode="444" dir="docs/" />
<tarfileset username="root" uid="1" group="root" prefix="javacc-${version}/examples" filemode="444" dir="examples/" />
<tarfileset username="root" uid="1" group="root" prefix="javacc-${version}" filemode="444" file="LICENSE" />
<tarfileset username="root" uid="1" group="root" prefix="javacc-${version}/${target-folder}" filemode="444" file="${javacc}" />
</tar>
<delete file="${install-name}-distribution.zip" />
<zip destfile="${install-name}-distribution.zip">
<zipfileset prefix="javacc-${version}/${target-folder}" filemode="444" file="${javacc}" />
<zipfileset prefix="javacc-${version}/docs" filemode="444" dir="docs/" />
<zipfileset prefix="javacc-${version}/examples" filemode="444" dir="examples/" />
<zipfileset prefix="javacc-${version}" filemode="444" file="LICENSE" />
</zip>
<delete dir="." includes="**/*.class" />
<delete file="${install-name}-sources.tar.gz" />
<tar destfile="${install-name}-sources.tar.gz" compression="gzip">
<tarfileset username="root" uid="1" group="root" prefix="javacc-${version}" filemode="444" file="./**" excludes="deployment_pom/**, target/**, temp/**, .svn,CVS,**/*.zip,**/*.tar.gz" />
</tar>
<delete file="${install-name}-sources.jar" />
<zip destfile="${install-name}-sources.jar">
<zipfileset prefix="javacc-${version}" filemode="444" file="./**" excludes=".svn,CVS,**/*.zip,**/*.tar.gz, deployment_pom/**, target/**, dist/**, temp/**" />
</zip>
</target>
<target name="javadoc">
<property name="install-name" value="${target-folder}/javacc-${version}" />
<delete dir="${target-folder}/javadoc" />
<mkdir dir="${target-folder}/javadoc" />
<javadoc destdir="${target-folder}/javadoc">
<fileset dir="${generated-src}" />
<fileset dir="${java-src}" />
</javadoc>
<zip destfile="${install-name}-javadoc.jar" basedir="${target-folder}/javadoc">
</zip>
</target>
<target name="unittest" depends="jar" description="run JUnit unit test cases" unless="true">
<delete dir="test.tmp" />
<mkdir dir="test.tmp" />
<path id="compile-test-classpath">
<pathelement location="lib/junit.jar" />
<pathelement location="target/javacc.jar" />
</path>
<delete dir="junit" />
<mkdir dir="junit" />
<javac srcdir="${test-src}" destdir="junit" classpathref="compile-test-classpath" includeantruntime='false'>
<src path="${test-src}" />
</javac>
<junit printsummary="yes" haltonfailure="no">
<classpath>
<pathelement location="junit" />
<pathelement location="target/javacc.jar" />
<pathelement location="lib/junit.jar" />
</classpath>
<batchtest fork="no" todir=".">
<fileset dir="junit">
<include name="**/*Test.*" />
</fileset>
<formatter type="failure" />
<!-- I want to see something ... -->
<formatter type="plain" usefile="false" />
</batchtest>
</junit>
<!-- Should sort this out properly, in the test. But for now... -->
<delete file="JavaCCParserTokenManager.java" />
</target>
<target name="test" depends="jar, unittest" description="run functional test cases">
<delete dir="test.tmp" />
<mkdir dir="test.tmp" />
<echo />
<ant antfile="build.xml" target="test" dir="test" />
<echo />
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/CORBA-IDL examples/CORBA-IDL/IDL.jj" />
</java>
<javac srcdir="${test-tmp}/CORBA-IDL" includeantruntime='false'/>
<copy todir="${test-tmp}/CORBA-IDL/">
<fileset dir="examples/CORBA-IDL">
<include name="*.idl" />
</fileset>
</copy>
<java failonerror="true" fork="true" classname="IDLParser" classpath="${test-tmp}/CORBA-IDL/" outputproperty="test.corba.out">
<arg line="${test-tmp}/CORBA-IDL/Hello.idl" />
</java>
<echo>${test.corba.out}</echo>
<fail message="CORBA failed">
<condition>
<not>
<contains string="${test.corba.out}" substring="IDL file parsed successfully" />
</not>
</condition>
</fail>
<echo />
<copy todir="${test-tmp}/GUIParsing/ParserVersion">
<fileset dir="examples/GUIParsing/ParserVersion">
<include name="*.java" />
</fileset>
</copy>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/GUIParsing/ParserVersion examples/GUIParsing/ParserVersion/CalcInput.jj" />
</java>
<javac srcdir="${test-tmp}/GUIParsing/ParserVersion" includeantruntime='false'/>
<echo />
<!--
<copy todir="${test-tmp}/GUIParsing/TokenMgrVersion">
<fileset dir="examples/GUIParsing/TokenMgrVersion">
<include name="*.java" />
</fileset>
</copy>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/GUIParsing/TokenMgrVersion examples/GUIParsing/TokenMgrVersion/CalcInput.jj" />
</java>
<javac srcdir="${test-tmp}/GUIParsing/TokenMgrVersion" includeantruntime='false'/>
<echo />
-->
<copy todir="${test-tmp}/Interpreter">
<fileset dir="examples/Interpreter">
<include name="*.java" />
</fileset>
</copy>
<java failonerror="true" fork="true" classname="jjtree" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/Interpreter examples/Interpreter/SPL.jjt" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/Interpreter ${test-tmp}/Interpreter/SPL.jj" />
</java>
<javac srcdir="${test-tmp}/Interpreter" includeantruntime='false'/>
<copy todir="${test-tmp}/Interpreter/">
<fileset dir="examples/Interpreter/">
<include name="*.spl" />
</fileset>
</copy>
<java failonerror="true" fork="true" classname="SPL" classpath="${test-tmp}/Interpreter/" inputstring="3" outputproperty="spl.out1">
<arg line="${test-tmp}/Interpreter/fact.spl" />
</java>
<echo>${spl.out1}</echo>
<fail message="SPL fact parse failed">
<condition>
<not>
<contains string="${spl.out1}" substring="Value of fact : 6" />
</not>
</condition>
</fail>
<java failonerror="true" fork="true" classname="SPL" classpath="${test-tmp}/Interpreter/" inputstring="3" outputproperty="spl.out2">
<arg line="${test-tmp}/Interpreter/odd.spl" />
</java>
<echo>${spl.out2}</echo>
<fail message="SPL odd parse failed">
<condition>
<not>
<contains string="${spl.out2}" substring="Value of odd : true" />
</not>
</condition>
</fail>
<java failonerror="true" fork="true" classname="SPL" classpath="${test-tmp}/Interpreter/" inputstring="9" outputproperty="spl.out3">
<arg line="${test-tmp}/Interpreter/sqrt.spl" />
</java>
<echo>${spl.out3}</echo>
<fail message="SPL sqrt parse failed">
<condition>
<not>
<contains string="${spl.out3}" substring="Value of sqrt : 3" />
</not>
</condition>
</fail>
<echo />
<java failonerror="true" fork="true" classname="jjtree" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/java/JJTreeExamples.eg1 examples/JJTreeExamples/java/eg1.jjt" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/java/JJTreeExamples.eg1 ${test-tmp}/java/JJTreeExamples.eg1/eg1.jj" />
</java>
<javac srcdir="${test-tmp}/java/JJTreeExamples.eg1" includeantruntime='false'/>
<java failonerror="true" fork="true" classname="Eg1" classpath="${test-tmp}/java/JJTreeExamples.eg1/" inputstring="(a + b) * (c + 1);" outputproperty="jjtree.eg1.out">
</java>
<echo>${jjtree.eg1.out}</echo>
<fail message="JJTree eg1 parse failed">
<condition>
<not>
<contains string="${jjtree.eg1.out}" substring="Thank you." />
</not>
</condition>
</fail>
<echo />
<copy todir="${test-tmp}/java/JJTreeExamples.eg2">
<fileset dir="examples/JJTreeExamples/java">
<include name="*.java" />
<exclude name="Eg4DumpVisitor.java" />
<exclude name="ASTMyOtherID.java" />
</fileset>
</copy>
<java failonerror="true" fork="true" classname="jjtree" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/java/JJTreeExamples.eg2 examples/JJTreeExamples/java/eg2.jjt" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/java/JJTreeExamples.eg2 ${test-tmp}/java/JJTreeExamples.eg2/eg2.jj" />
</java>
<javac srcdir="${test-tmp}/java/JJTreeExamples.eg2" includeantruntime='false'/>
<java failonerror="true" fork="true" classname="Eg2" classpath="${test-tmp}/java/JJTreeExamples.eg2/" inputstring="(a + b) * (c + 1);" outputproperty="jjtree.eg2.out">
</java>
<echo>${jjtree.eg2.out}</echo>
<fail message="JJTree eg2 parse failed">
<condition>
<not>
<contains string="${jjtree.eg2.out}" substring="Thank you." />
</not>
</condition>
</fail>
<echo />
<copy todir="${test-tmp}/java/JJTreeExamples.eg3">
<fileset dir="examples/JJTreeExamples/java">
<include name="*.java" />
<exclude name="Eg4DumpVisitor.java" />
<exclude name="ASTMyOtherID.java" />
</fileset>
</copy>
<java failonerror="true" fork="true" classname="jjtree" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/java/JJTreeExamples.eg3 examples/JJTreeExamples/java/eg3.jjt" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/java/JJTreeExamples.eg3 ${test-tmp}/java/JJTreeExamples.eg3/eg3.jj" />
</java>
<javac srcdir="${test-tmp}/java/JJTreeExamples.eg3" includeantruntime='false'/>
<java failonerror="true" fork="true" classname="Eg3" classpath="${test-tmp}/java/JJTreeExamples.eg3/" inputstring="(a + b) * (c + 1);" outputproperty="jjtree.eg3.out">
</java>
<echo>${jjtree.eg3.out}</echo>
<fail message="JJTree eg3 parse failed">
<condition>
<not>
<contains string="${jjtree.eg3.out}" substring="Thank you." />
</not>
</condition>
</fail>
<echo />
<copy todir="${test-tmp}/java/JJTreeExamples.eg4">
<fileset dir="examples/JJTreeExamples/java">
<include name="*.java" />
</fileset>
</copy>
<java failonerror="true" fork="true" classname="jjtree" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/java/JJTreeExamples.eg4 examples/JJTreeExamples/java/eg4.jjt" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/java/JJTreeExamples.eg4 ${test-tmp}/java/JJTreeExamples.eg4/eg4.jj" />
</java>
<javac srcdir="${test-tmp}/java/JJTreeExamples.eg4" debug="true" includeantruntime='false'/>
<java failonerror="true" fork="true" classname="Eg4" classpath="${test-tmp}/java/JJTreeExamples.eg4/" inputstring="(a + b) * (c + 1);" outputproperty="jjtree.eg4.out">
</java>
<echo>${jjtree.eg4.out}</echo>
<fail message="JJTree eg4 parse failed">
<condition>
<not>
<contains string="${jjtree.eg4.out}" substring="Thank you." />
</not>
</condition>
</fail>
<echo />
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/JavaCCGrammar examples/JavaCCGrammar/JavaCC.jj" />
</java>
<javac srcdir="${test-tmp}/JavaCCGrammar" includeantruntime='false'/>
<echo />
<ant antfile="build.xml" target="compile-and-test" dir="examples/JavaGrammars/1.5" />
<ant antfile="build.xml" target="clean" dir="examples/JavaGrammars/1.5" />
<echo />
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/Lookahead.eg1 examples/Lookahead/Example1.jj" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/Lookahead.eg2 examples/Lookahead/Example2.jj" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/Lookahead.eg3 examples/Lookahead/Example3.jj" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/Lookahead.eg4 examples/Lookahead/Example4.jj" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/Lookahead.eg5 examples/Lookahead/Example5.jj" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/Lookahead.eg6 examples/Lookahead/Example6.jj" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/Lookahead.eg7 examples/Lookahead/Example7.jj" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/Lookahead.eg8 examples/Lookahead/Example8.jj" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/Lookahead.eg9 examples/Lookahead/Example9.jj" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/Lookahead.eg10 examples/Lookahead/Example10.jj" />
</java>
<echo />
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/MailProcessing examples/MailProcessing/Digest.jj" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/MailProcessing examples/MailProcessing/Faq.jj" />
</java>
<javac srcdir="${test-tmp}/MailProcessing" includeantruntime='false'/>
<echo />
<copy todir="${test-tmp}/Obfuscator">
<fileset dir="examples/Obfuscator">
<include name="*.java" />
</fileset>
</copy>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/Obfuscator examples/Obfuscator/Java1.1.jj" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/Obfuscator examples/Obfuscator/IdsFile.jj" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/Obfuscator examples/Obfuscator/MapFile.jj" />
</java>
<javac srcdir="${test-tmp}/Obfuscator" includeantruntime='false'/>
<echo />
<!-- Test cases for SimpleExamples -->
<mkdir dir="${test-tmp}/SimpleExamples" />
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/SimpleExamples examples/SimpleExamples/Simple1.jj" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/SimpleExamples examples/SimpleExamples/Simple2.jj" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/SimpleExamples examples/SimpleExamples/Simple3.jj" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/SimpleExamples examples/SimpleExamples/NL_Xlator.jj" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/SimpleExamples examples/SimpleExamples/IdList.jj" />
</java>
<echo />
<!-- Test cases for Java 7 syntax features -->
<mkdir dir="${test-tmp}/java7features" />
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/java7features test/java7features/Parser.jj" />
</java>
<echo />
<copy todir="${test-tmp}/Transformer">
<fileset dir="examples/Transformer">
<include name="*.java" />
</fileset>
</copy>
<java failonerror="true" fork="true" classname="jjtree" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/Transformer examples/Transformer/ToyJava.jjt" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/Transformer ${test-tmp}/Transformer/ToyJava.jj" />
</java>
<javac srcdir="${test-tmp}/Transformer" includeantruntime='false'/>
<echo />
<copy todir="${test-tmp}/VTransformer">
<fileset dir="examples/VTransformer">
<include name="*.java" />
</fileset>
</copy>
<java failonerror="true" fork="true" classname="jjtree" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/VTransformer examples/VTransformer/Java1.1.jjt" />
</java>
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/VTransformer ${test-tmp}/VTransformer/Java1.1.jj" />
</java>
<javac srcdir="${test-tmp}/VTransformer" includeantruntime='false'/>
<!-- 2014/05/09 - New tests to test that TOKEN_MANAGER_USES_PARSER has no effect if static is true -->
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/TestTokenManagerUsesParser test/TestTokenManagerUsesParser/TestTokenManagerUsesParser.jj" />
</java>
<javac srcdir="${test-tmp}/TestTokenManagerUsesParser" includeantruntime='false'/>
<!-- 2014/05/09 - New tests to test that TOKEN_MANAGER_USES_PARSER works as expected if static is false -->
<java failonerror="true" fork="true" classname="javacc" classpath="${javacc}">
<arg line="-OUTPUT_DIRECTORY=${test-tmp}/TestTokenManagerUsesParser2 test/TestTokenManagerUsesParser2/TestTokenManagerUsesParser2.jj" />
</java>
<javac srcdir="${test-tmp}/TestTokenManagerUsesParser2" includeantruntime='false'/>
</target>
<!-- defined maven snapshots and staging repository id and url -->
<property name="ossrh-snapshots-repository-url" value="https://oss.sonatype.org/content/repositories/snapshots/" />
<property name="ossrh-staging-repository-url" value="https://oss.sonatype.org/service/local/staging/deploy/maven2/" />
<!-- there server id in the Maven settings.xml -->
<property name="ossrh-server-id" value="ossrh" />
<target name="echo">
<!-- replace file="foo.xml" token="$${version}" value="${version}"/ -->
<echo message="$${version} = ${version}"/>
</target>
<target name="deploy" depends="dist" description="deploy snapshot version to Maven snapshot repository">
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-deploy-plugin:2.8:deploy-file" />
<arg value="-Durl=${ossrh-snapshots-repository-url}" />
<arg value="-DrepositoryId=${ossrh-server-id}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${javacc-path}" />
</artifact:mvn>
</target>
<target name="install" depends="jar" description="install version to Maven local repository">
<artifact:pom id="mypom" file="pom.xml" />
<artifact:install file="${javacc-path}">
<pom refid="mypom" />
</artifact:install>
</target>
<!-- before this, update project version (both build.xml and pom.xml) from SNAPSHOT to RELEASE -->
<target name="stage" depends="dist" description="deploy release version to Maven staging repository">
<!-- sign and deploy the main artifact -->
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.5:sign-and-deploy-file" />
<arg value="-Durl=${ossrh-staging-repository-url}" />
<arg value="-DrepositoryId=${ossrh-server-id}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${javacc-path}" />
<arg value="-Pgpg" />
</artifact:mvn>
<!-- sign and deploy the sources artifact -->
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.5:sign-and-deploy-file" />
<arg value="-Durl=${ossrh-staging-repository-url}" />
<arg value="-DrepositoryId=${ossrh-server-id}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${javacc-sources-path}" />
<arg value="-Dclassifier=sources" />
<arg value="-Pgpg" />
</artifact:mvn>
<!-- sign and deploy the javadoc artifact -->
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.5:sign-and-deploy-file" />
<arg value="-Durl=${ossrh-staging-repository-url}" />
<arg value="-DrepositoryId=${ossrh-server-id}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${javacc-javadoc-path}" />
<arg value="-Dclassifier=javadoc" />
<arg value="-Pgpg" />
</artifact:mvn>
</target>
</project>