-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.xml
684 lines (607 loc) · 23.9 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
<!--
* Copyright (c) 2002-2011 by XMLVM.org
*
* Project Info: http://www.xmlvm.org
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
-->
<project name="xmlvm" default="jar" basedir=".">
<presetdef name="javac">
<javac includeantruntime="false" />
</presetdef>
<target name="demos" depends="demos-iphone,demos-android" />
<target name="init">
<!-- initialize properties -->
<property file="properties/local.properties" />
<property file="properties/xmlvm.properties" />
<!-- calculate classpaths -->
<path id="classpath.compile">
<pathelement location="lib/dx.jar" />
<pathelement location="lib/bcel.jar" />
<pathelement location="lib/jdom.jar" />
<pathelement location="lib/mbel.jar" />
<pathelement location="lib/yuicompressor-2.1.2.jar" />
<pathelement location="lib/czlUtil.jar" />
<pathelement location="lib/saxon9.jar" />
<pathelement location="lib/saxon9-jdom.jar" />
<pathelement location="lib/lwjgl.jar" />
<pathelement location="lib/basicplayer3.0.jar" />
<pathelement location="lib/harmony6-build.jar" />
<pathelement location="lib/jaxp.jar" />
</path>
<path id="classpath.run">
<pathelement location="${xmlvm.bin}" />
<pathelement location="src/xmlvm2objc/xsl" />
<pathelement location="lib/dx.jar" />
<pathelement location="lib/bcel.jar" />
<pathelement location="lib/mbel.jar" />
<pathelement location="lib/jdom.jar" />
<pathelement location="lib/jakarta-regexp.jar" />
<pathelement location="lib/saxon9.jar" />
<pathelement location="lib/saxon9-jdom.jar" />
<pathelement location="lib/xercesImpl.jar" />
<pathelement location="lib/lwjgl.jar" />
</path>
<property name="xmlvm.sdk.jar" location="${xmlvm.jar}" />
<!-- Create the time stamp -->
<tstamp />
<!-- Create the build directory structure used by compile -->
<mkdir dir="${xmlvm.libjars}" />
<mkdir dir="${xmlvm.build}" />
<mkdir dir="${xmlvm.build.main}" />
<mkdir dir="${xmlvm.build.lib}" />
<mkdir dir="${xmlvm.bin}" />
<mkdir dir="${xmlvm.bin}/ios" />
<mkdir dir="${xmlvm.bin}/iphone" />
<mkdir dir="${xmlvm.bin}/lib" />
<mkdir dir="${xmlvm.bin}/wp7" />
<mkdir dir="${xmlvm.bin}/sdl" />
<mkdir dir="${xmlvm.bin}/xmlvm2csharp" />
<mkdir dir="${xmlvm.bin}/xmlvm2c" />
</target>
<target name="build-objc-compat-lib" depends="build-xmlvm">
<echo message="Generating objc-compat.jar" />
<mkdir dir="${xmlvm.objc-compat-lib}" />
<javac srcdir="src/xmlvm2objc/compat-lib/java" destdir="${xmlvm.objc-compat-lib}" debug="${debug}">
<classpath refid="classpath.compile" />
<classpath>
<pathelement location="${xmlvm.bin}" />
</classpath>
<include name="**/*.java" />
</javac>
<javac srcdir="src/ios" destdir="${xmlvm.objc-compat-lib}" debug="${debug}">
<classpath refid="classpath.compile" />
<classpath>
<pathelement location="${xmlvm.bin}" />
</classpath>
<include name="**/*.java" />
</javac>
<jar destfile="${xmlvm.libjars}/objc-compat.jar">
<fileset dir="${xmlvm.objc-compat-lib}" />
</jar>
</target>
<target name="build-csharp-compat-lib" depends="build-xmlvm">
<echo message="Generating csharp-compat.jar" />
<mkdir dir="${xmlvm.csharp-compat-lib}" />
<javac srcdir="src/xmlvm2csharp/compat-lib/java" destdir="${xmlvm.csharp-compat-lib}" debug="${debug}">
<classpath refid="classpath.compile" />
<classpath>
<pathelement location="${xmlvm.bin}" />
</classpath>
<include name="**/*.java" />
</javac>
<javac srcdir="src/wp7" destdir="${xmlvm.csharp-compat-lib}" debug="${debug}">
<classpath refid="classpath.compile" />
<classpath>
<pathelement location="${xmlvm.bin}" />
</classpath>
<include name="**/*.java" />
</javac>
<jar destfile="${xmlvm.libjars}/csharp-compat.jar">
<fileset dir="${xmlvm.csharp-compat-lib}" />
</jar>
</target>
<target name="build-android-ios-compat-lib" depends="build-objc-compat-lib">
<mkdir dir="${xmlvm.android-ios-compat-lib.java}" />
<javac destdir="${xmlvm.android-ios-compat-lib.java}" debug="${debug}">
<src path="./src/acl/android" />
<src path="./src/acl/common" />
<src path="./src/acl/ios" />
<classpath>
<pathelement location="${xmlvm.libjars}/objc-compat.jar" />
<pathelement location="${xmlvm.bin}" />
</classpath>
<include name="**/*.java" />
</javac>
<jar destfile="${xmlvm.libjars}/android-ios-compat.jar">
<fileset dir="${xmlvm.android-ios-compat-lib.java}" />
</jar>
</target>
<target name="build-android-wp7-compat-lib" depends="build-csharp-compat-lib">
<mkdir dir="${xmlvm.android-wp7-compat-lib.java}" />
<javac destdir="${xmlvm.android-wp7-compat-lib.java}" debug="${debug}">
<src path="./src/acl/android" />
<src path="./src/acl/common" />
<src path="./src/acl/wp7" />
<classpath>
<pathelement location="${xmlvm.libjars}/csharp-compat.jar" />
<pathelement location="${xmlvm.bin}" />
</classpath>
<include name="**/*.java" />
</javac>
<jar destfile="${xmlvm.libjars}/android-wp7-compat.jar">
<fileset dir="${xmlvm.android-wp7-compat-lib.java}" />
</jar>
</target>
<target name="build-sdl-compat-lib" depends="build-xmlvm">
<echo message="Generating sdl-compat.jar" />
<mkdir dir="${xmlvm.sdl-java}" />
<javac srcdir="src/sdl" destdir="${xmlvm.sdl-java}" debug="${debug}">
<classpath refid="classpath.compile" />
<classpath>
<pathelement location="${xmlvm.bin}" />
</classpath>
<include name="**/*.java" />
</javac>
<jar destfile="${xmlvm.libjars}/sdl-compat.jar">
<fileset dir="${xmlvm.sdl-java}" />
</jar>
</target>
<target name="build-android-sdl-compat-lib" depends="build-sdl-compat-lib">
<mkdir dir="${xmlvm.android-sdl-compat-lib.java}" />
<javac destdir="${xmlvm.android-sdl-compat-lib.java}" debug="${debug}">
<src path="./src/acl/android" />
<src path="./src/acl/common" />
<src path="./src/acl/sdl" />
<classpath>
<pathelement location="${xmlvm.libjars}/sdl-compat.jar" />
<pathelement location="${xmlvm.bin}" />
</classpath>
<include name="**/*.java" />
</javac>
<jar destfile="${xmlvm.libjars}/android-sdl-compat.jar">
<fileset dir="${xmlvm.android-sdl-compat-lib.java}" />
</jar>
</target>
<target name="cc-android-ios-compat-lib" depends="build-android-ios-compat-lib,build-xmlvm">
<uptodate property="cc-android-ios-compat-lib.notrequired" targetfile="${xmlvm.android-ios-compat-lib.objc}">
<srcfiles dir="${xmlvm.android-ios-compat-lib.java}" includes="**/*.class" />
</uptodate>
<antcall target="cc-android-ios-compat-lib.impl" inheritRefs="yes" />
</target>
<target name="cc-android-ios-compat-lib.impl" unless="cc-android-ios-compat-lib.notrequired">
<echo message="Building android ios compatibility lib" />
<mkdir dir="${xmlvm.android-ios-compat-lib.objc}" />
<java classname="org.xmlvm.Main">
<arg value="--out=${xmlvm.android-ios-compat-lib.objc}" />
<arg value="--target=objc" />
<arg value="--in=${xmlvm.android-ios-compat-lib.java}/" />
<classpath refid="classpath.run" />
</java>
</target>
<target name="build-xmlvm" depends="init">
<echo message="Compiling XMLVM" />
<mkdir dir="${xmlvm.build.main}" />
<javac destdir="${xmlvm.bin}" debug="${debug}">
<!-- Core -->
<src path="src/xmlvm" />
<!-- Plugins -->
<src path="plugins/c/src" />
<src path="plugins/csharp/src" />
<src path="plugins/ios/src" />
<src path="plugins/iphone/src" />
<src path="plugins/javascript/src" />
<src path="plugins/objc/src" />
<src path="plugins/posix/src" />
<src path="plugins/py/src" />
<src path="plugins/qooxdoo/src" />
<src path="plugins/webos/src" />
<src path="plugins/wp7/src" />
<classpath refid="classpath.compile" />
<include name="**/*.java" />
</javac>
</target>
<target name="jar" depends="xmlvmjar" />
<target name="xmlvmjar" depends="cc-android-ios-compat-lib, build-android-wp7-compat-lib, build-android-sdl-compat-lib">
<copy todir="${xmlvm.build.lib}">
<fileset dir="lib">
<include name="**/*.jar/" />
<include name="**/*.txt/" />
<exclude name="one-jar-boot.jar" />
<exclude name="lwjgl.jar" />
<exclude name="harmony6-build.jar" />
<exclude name="jaxp.jar" />
</fileset>
</copy>
<copy todir="${xmlvm.bin}/lib">
<fileset file="lib/harmony6-build.jar" />
<fileset file="lib/jaxp.jar" />
</copy>
<unjar src="lib/one-jar-boot.jar" dest="${xmlvm.build}">
<patternset>
<include name="**/*.class" />
<exclude name="OneJar.class" />
</patternset>
</unjar>
<unjar src="lib/lwjgl.jar" dest="${xmlvm.build}">
<patternset>
<include name="**/*.class" />
</patternset>
</unjar>
<unjar src="dist/lib/objc-compat.jar" dest="${xmlvm.build}">
<patternset>
<include name="**/*.class" />
</patternset>
</unjar>
<unjar src="dist/lib/csharp-compat.jar" dest="${xmlvm.build}">
<patternset>
<include name="**/*.class" />
</patternset>
</unjar>
<unjar src="dist/lib/android-ios-compat.jar" dest="${xmlvm.build}">
<patternset>
<include name="**/*.class" />
</patternset>
</unjar>
<unjar src="dist/lib/android-wp7-compat.jar" dest="${xmlvm.build}">
<patternset>
<include name="**/*.class" />
</patternset>
</unjar>
<unjar src="dist/lib/sdl-compat.jar" dest="${xmlvm.build}">
<patternset>
<include name="**/*.class" />
</patternset>
</unjar>
<unjar src="dist/lib/android-sdl-compat.jar" dest="${xmlvm.build}">
<patternset>
<include name="**/*.class" />
</patternset>
</unjar>
<javac srcdir="src/tools/ant/xcode-updater/" destdir="${xmlvm.build}" classpath="${ant.core.lib}" debug="${debug}">
<include name="**/*.java" />
</javac>
<copy todir="${xmlvm.bin}" flatten="true">
<fileset dir="src">
<include name="**/*.xsl" />
</fileset>
<fileset file="lib/redlist.txt" />
</copy>
<!-- xmlvm2c -->
<jar destfile="${xmlvm.bin}/xmlvm2c/java-ios-lib.jar">
<fileset dir="src/xmlvm2c/lib/ios/c" />
</jar>
<jar destfile="${xmlvm.bin}/iphone/cocoa-compat-lib.jar">
<fileset dir="src/xmlvm2c/compat-lib/iphone/" />
</jar>
<jar destfile="${xmlvm.bin}/ios/wrapper-lib.jar">
<fileset dir="src/xmlvm2c/lib/wrapper/" />
</jar>
<jar destfile="${xmlvm.bin}/xmlvm2c/java-compat-lib.jar">
<fileset dir="src/xmlvm2c/compat-lib/java/" />
</jar>
<!-- xmlvm2csharp -->
<jar destfile="${xmlvm.bin}/wp7/wrapper-lib.jar">
<fileset dir="src/xmlvm2csharp/lib/wrapper/" />
</jar>
<jar destfile="${xmlvm.bin}/xmlvm2csharp/java-compat-lib.jar">
<fileset dir="src/xmlvm2csharp/compat-lib/java/" />
</jar>
<mkdir dir="${xmlvm.silverlight-java}" />
<javac srcdir="./src/wp7" destdir="${xmlvm.silverlight-java}" debug="${debug}">
<classpath>
<pathelement location="${xmlvm.bin}" />
</classpath>
<classpath refid="classpath.compile" />
<include name="**/*.java" />
</javac>
<jar destfile="${xmlvm.bin}/lib/silverlight-java.jar">
<fileset dir="${xmlvm.silverlight-java}" />
</jar>
<!-- SDL -->
<jar destfile="${xmlvm.bin}/sdl/wrapper-lib.jar">
<fileset dir="src/xmlvm2c/lib/sdl-wrapper/" />
</jar>
<mkdir dir="${xmlvm.sdl-java}" />
<javac srcdir="./src/sdl" destdir="${xmlvm.sdl-java}" debug="${debug}">
<classpath>
<pathelement location="${xmlvm.bin}" />
</classpath>
<classpath refid="classpath.compile" />
<include name="**/*.java" />
</javac>
<jar destfile="${xmlvm.bin}/lib/sdl-java.jar">
<fileset dir="${xmlvm.sdl-java}" />
</jar>
<!-- xmlvm2objc -->
<jar destfile="${xmlvm.bin}/iphone/compat-lib.jar">
<fileset dir="src/xmlvm2objc/compat-lib/objc/" />
</jar>
<jar destfile="${xmlvm.bin}/iphone/android-ios-compat-lib.jar">
<fileset dir="${xmlvm.android-ios-compat-lib.objc}" />
</jar>
<mkdir dir="${xmlvm.cocoa-java}" />
<javac srcdir="./src/xmlvm2objc/compat-lib/java" destdir="${xmlvm.cocoa-java}" debug="${debug}">
<classpath>
<pathelement location="${xmlvm.bin}" />
</classpath>
<classpath refid="classpath.compile" />
<include name="**/*.java" />
</javac>
<javac srcdir="src/ios" destdir="${xmlvm.cocoa-java}" debug="${debug}">
<classpath refid="classpath.compile" />
<classpath>
<pathelement location="${xmlvm.bin}" />
</classpath>
<include name="**/*.java" />
</javac>
<jar destfile="${xmlvm.bin}/lib/cocoa-java.jar">
<fileset dir="${xmlvm.cocoa-java}" />
</jar>
<mkdir dir="${xmlvm.xmlvm-util-java}" />
<javac srcdir="./src/xmlvm2c/lib/util" destdir="${xmlvm.xmlvm-util-java}" debug="${debug}">
<classpath>
<pathelement location="${xmlvm.bin}" />
</classpath>
<classpath refid="classpath.compile" />
<include name="**/*.java" />
</javac>
<jar destfile="${xmlvm.bin}/lib/xmlvm-util-java.jar">
<fileset dir="${xmlvm.xmlvm-util-java}" />
</jar>
<mkdir dir="${xmlvm.proxies-java}" />
<javac srcdir="./src/xmlvm2c/lib/proxies" destdir="${xmlvm.proxies-java}" debug="${debug}">
<bootclasspath>
<pathelement location="${xmlvm.xmlvm-util-java}" />
<pathelement location="lib/harmony6-build.jar" />
<pathelement location="lib/jaxp.jar" />
</bootclasspath>
<include name="**/*.java" />
</javac>
<jar destfile="${xmlvm.bin}/lib/proxies-java.jar">
<fileset dir="${xmlvm.proxies-java}" />
</jar>
<mkdir dir="${xmlvm.iphone-android-java}" />
<javac destdir="${xmlvm.iphone-android-java}" debug="${debug}">
<src path="./src/acl/android" />
<src path="./src/acl/common" />
<src path="./src/acl/ios" />
<classpath>
<pathelement location="${xmlvm.libjars}/objc-compat.jar" />
<pathelement location="${xmlvm.bin}" />
</classpath>
<include name="**/*.java" />
</javac>
<jar destfile="${xmlvm.bin}/lib/iphone-android-java.jar">
<fileset dir="${xmlvm.iphone-android-java}" />
</jar>
<mkdir dir="${xmlvm.wp7-android-java}" />
<javac destdir="${xmlvm.wp7-android-java}" debug="${debug}">
<src path="./src/acl/android" />
<src path="./src/acl/common" />
<src path="./src/acl/wp7" />
<classpath>
<pathelement location="${xmlvm.libjars}/csharp-compat.jar" />
<pathelement location="${xmlvm.bin}" />
</classpath>
<include name="**/*.java" />
</javac>
<jar destfile="${xmlvm.bin}/lib/wp7-android-java.jar">
<fileset dir="${xmlvm.wp7-android-java}" />
</jar>
<mkdir dir="${xmlvm.sdl-android-java}" />
<javac destdir="${xmlvm.sdl-android-java}" debug="${debug}">
<src path="./src/acl/android" />
<src path="./src/acl/common" />
<src path="./src/acl/sdl" />
<classpath>
<pathelement location="${xmlvm.libjars}/sdl-compat.jar" />
<pathelement location="${xmlvm.bin}" />
</classpath>
<include name="**/*.java" />
</javac>
<jar destfile="${xmlvm.bin}/lib/sdl-android-java.jar">
<fileset dir="${xmlvm.sdl-android-java}" />
</jar>
<jar destfile="${xmlvm.bin}/lib/native-c-lib.jar">
<fileset dir="src/xmlvm2c/lib/native/" />
</jar>
<jar destfile="${xmlvm.bin}/lib/native-csharp-lib.jar">
<fileset dir="src/xmlvm2csharp/lib/native/" />
</jar>
<copy todir="${xmlvm.bin}/iphone">
<fileset file="var/iphone/Makefile" />
<fileset file="var/iphone/project.template" />
<fileset file="var/iphone/Info.plist" />
</copy>
<copy todir="${xmlvm.bin}/posix">
<fileset file="var/posix/Makefile" />
</copy>
<copy todir="${xmlvm.bin}/sdl">
<fileset file="var/sdl/Makefile" />
<fileset dir="var/sdl" includes="data/**/*" />
</copy>
<mkdir dir="${xmlvm.build}/xmlvm2js" />
<jar destfile="${xmlvm.build}/xmlvm2js/xmlvm2js.jar">
<fileset dir="src/xmlvm2js/" />
</jar>
<copy todir="${xmlvm.build}/xmlvm2js">
<fileset file="src/xmlvm2js/Application.js.template" />
</copy>
<copy todir="${xmlvm.build}/xmlvm2js">
<fileset file="src/xmlvm2js/Application.js.template.mobile" />
</copy>
<copy todir="${xmlvm.bin}/templates/">
<fileset dir="var/templates" />
</copy>
<copy todir="${xmlvm.build}/sys_resources">
<fileset dir="var/iphone/sys_resources" />
</copy>
<jar destfile="${xmlvm.build.main}/main.jar" basedir="${xmlvm.bin}">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Implementation-Vendor" value="xmlvm.org" />
<attribute name="Implementation-Title" value="XMLVM" />
<attribute name="Implementation-Version" value="alpha" />
<attribute name="Main-Class" value="com.simontuffs.onejar.Boot" />
<attribute name="One-Jar-Main-Class" value="org.xmlvm.Main" />
</manifest>
</jar>
<jar destfile="${xmlvm.jar}">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Implementation-Vendor" value="xmlvm.org" />
<attribute name="Implementation-Title" value="XMLVM" />
<attribute name="Implementation-Version" value="alpha" />
<attribute name="Main-Class" value="com.simontuffs.onejar.Boot" />
<attribute name="One-Jar-Main-Class" value="org.xmlvm.Main" />
</manifest>
<fileset dir="${xmlvm.build}" />
</jar>
<!-- Declare the location of xmlvm.jar to all iPhone projects -->
<ant dir="demo" target="classpath" />
<ant dir="tutorial" target="classpath" />
</target>
<target name="eventHandlerCompatLib" depends="build-xmlvm">
<echo message="Compiling event handler for compat lib" />
<exec executable="${cscCompiler}">
<arg value="/out:${tmp.dir}/EventBinaries.exe" />
<arg value="/warn:0" />
<arg value="/nologo" />
<arg value="src/clr2jvm/compat-lib/c_sharp/eventHandler/DummyMain.cs" />
<arg value="src/clr2jvm/compat-lib/c_sharp/eventHandler/EventArgs.cs" />
<arg value="src/clr2jvm/compat-lib/c_sharp/eventHandler/EventHandler.cs" />
</exec>
<echo message="Cross compiling event handler for compat lib" />
<java classname="org.xmlvm.Main">
<arg value="--java" />
<arg value="--out=${xmlvm.main}" />
<arg value="${tmp.dir}/EventBinaries.exe" />
<classpath refid="classpath.run" />
</java>
<echo message="Compiling compat lib" />
<javac srcdir="src/clr2jvm/compat-lib/Java" destdir="${xmlvm.main}" debug="${debug}">
<classpath refid="classpath.compile" />
<include name="**/*.java" />
</javac>
<delete file="${tmp.dir}/EventBinaries.exe" />
<delete file="${xmlvm.main}/DummyMain.class" />
</target>
<target name="create-local.properties" unless="sdk.dir">
<echo file="properties/local.properties" message="# The location of the AndroidSDK.${line.separator}# Since this file is included in all Android demo projects, it is advised${line.separator}# to use an absolute path, or else the demo projects will not be properly${line.separator}# configured.${line.separator}#${line.separator}sdk.dir=LOCATION_OF_ANDROID_SDK" />
</target>
<target name="demos-iphone" depends="jar">
<ant dir="demo" target="demos-iphone" />
</target>
<target name="demos-android" depends="jar,create-local.properties">
<ant dir="demo" target="demos-android" />
</target>
<target name="tutorial">
<ant dir="tutorial" />
</target>
<target name="gen-c-wrappers" depends="jar">
<java jar="dist/xmlvm.jar" fork="true" failonerror="true">
<jvmarg value="-Xmx512m" />
<arg value="--in=build/cocoa-java/org/xmlvm/iphone" />
<arg value="--target=gen-c-wrappers" />
<arg value="--out=src/xmlvm2c/compat-lib/iphone" />
<arg value="--c-source-extension=m" />
</java>
</target>
<target name="gen-c-native-skeletons" depends="jar">
<java jar="dist/xmlvm.jar" fork="true" failonerror="true">
<jvmarg value="-Xmx1G" />
<arg value="--in=lib/harmony6-build.jar" />
<arg value="--in=${xmlvm.bin}/lib/xmlvm-util-java.jar" />
<arg value="--target=gen-c-wrappers" />
<arg value="--out=src/xmlvm2c/lib/native" />
<arg value="--gen-native-skeletons" />
</java>
</target>
<target name="gen-csharp-wrappers" depends="jar">
<java jar="dist/xmlvm.jar" fork="true" failonerror="true">
<jvmarg value="-Xmx512m" />
<arg value="--in=build/silverlight-java" />
<arg value="--target=gen-csharp-wrappers" />
<arg value="--out=src/xmlvm2csharp/lib/wrapper" />
</java>
</target>
<target name="gen-csharp-native-skeletons" depends="jar">
<java jar="dist/xmlvm.jar" fork="true" failonerror="true">
<jvmarg value="-Xmx2G" />
<arg value="--in=lib/harmony6-build.jar" />
<arg value="--in=${xmlvm.bin}/lib/xmlvm-util-java.jar" />
<arg value="--target=gen-csharp-wrappers" />
<arg value="--out=src/xmlvm2csharp/lib/native" />
<arg value="--gen-native-skeletons" />
</java>
</target>
<target name="gen-sdl-wrappers" depends="jar">
<java jar="dist/xmlvm.jar" fork="true" failonerror="true">
<jvmarg value="-Xmx512m" />
<arg value="--in=build/sdl-java" />
<arg value="--target=gen-c-wrappers" />
<arg value="--out=src/xmlvm2c/lib/sdl-wrapper" />
</java>
</target>
<target name="clean" description="Remove all build files">
<ant dir="demo" target="clean" />
<ant dir="tutorial" target="clean" />
<delete dir=".cache" />
<delete dir="dist" />
<delete dir="build" />
<delete dir="${doc.dir}/homepage/lib" />
<delete file="${doc.dir}/homepage/android/demo/xokoban.jar" />
<delete file="${doc.dir}/homepage/iphone/demo/ifireworks.jar" />
<delete dir="var/Netbeans/build" />
<delete dir="var/Netbeans/nbproject/private" />
<delete dir="demo/iphone/plugins/Zip/nbproject/private" />
</target>
<target name="install" depends="init,jar">
<property name="xmlvm.install" value="/usr/local" />
<echo message="** Installing XMLVM under prefix '${xmlvm.install}'." />
<echo message="** To change the default location, please provide the property 'xmlvm.install' in file properties/local.properties." />
<input message="Please type [RETURN] to continue, [CTR]-[C] to cancel." />
<mkdir dir="${xmlvm.install}/lib/xmlvm" />
<mkdir dir="${xmlvm.install}/bin" />
<copy file="dist/xmlvm.jar" todir="${xmlvm.install}/lib/xmlvm" />
<echo file="${xmlvm.install}/bin/xmlvm" message="#!/bin/bash${line.separator}java -Xmx1G -jar "${xmlvm.install}/lib/xmlvm/xmlvm.jar" "$@"${line.separator}" />
<chmod file="${xmlvm.install}/bin/xmlvm" perm="a+x" />
<echo message="Please make sure to add path '${xmlvm.install}/bin' to your $PATH environment." />
</target>
<target name="uninstall" depends="init">
<property name="xmlvm.install" value="/usr/local" />
<macrodef name="deleteEmptyFolders">
<attribute name="dir" />
<sequential>
<delete includeemptydirs="true" failonerror="false">
<fileset dir="@{dir}">
<and>
<size value="0" />
<type type="dir" />
</and>
</fileset>
</delete>
</sequential>
</macrodef>
<delete file="${xmlvm.install}/bin/xmlvm" failonerror="false" />
<delete file="${xmlvm.install}/lib/xmlvm/xmlvm.jar" failonerror="false" />
<deleteEmptyFolders dir="${xmlvm.install}/lib/xmlvm" />
<deleteEmptyFolders dir="${xmlvm.install}/lib" />
<deleteEmptyFolders dir="${xmlvm.install}/bin" />
<deleteEmptyFolders dir="${xmlvm.install}" />
</target>
</project>