forked from bfattori/TheRenderEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
1231 lines (963 loc) · 42.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
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
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<project name="The Render Engine" default="dist" basedir=".">
<property file="build.properties"/>
<property name="build.homeurl" value="http://www.renderengine.com"/>
<property name="build.refname" value="The Render Engine"/>
<property name="app.name" value="renderengine"/>
<property name="app.version" value=""/>
<property name="version.name" value=""/>
<property name="build.date" value=""/>
<property name="dist.home" value="${basedir}/dist_${app.version}"/>
<property name="engine.home" value="${basedir}/engine"/>
<property name="engine.src" value="${engine.home}/build"/>
<property name="make.dir" value="${basedir}/make"/>
<property name="compressor.jar" value="${make.dir}/yuicompressor-2.4.2.jar"/>
<property name="compiler.jar" value="${make.dir}/compiler.jar"/>
<!-- Locations of distribution files -->
<property name="min.home" value="${dist.home}/min-js"/>
<property name="full.home" value="${dist.home}/full"/>
<!-- Demos and tools won't be copied unless specified in build.properties -->
<property name="demo.set" value="NO_COPY"/>
<property name="tool.set" value="NO_COPY"/>
<property name="font.set" value="NO_COPY"/>
<property name="test.set" value="NO_COPY"/>
<property name="exclude.set" value="NO_COPY"/>
<!-- Which compression option to use (either "engine.compress" or "engine.compile")
The second option uses the Google Closure Compiler. -->
<property name="compress.option" value="engine.compress"/>
<!-- Dump the system date (this is for Windows) -->
<exec executable="cmd.exe" outputproperty="build.date" >
<arg line="/c"/>
<arg line="date.exe"/>
<arg line="/T"/>
</exec>
<!--
<propertyregex property="build.date" input="${builddate.out}" select="\1">
<regexp pattern="\w+ ((\d+\/?){3})"/>
</propertyregex>
-->
<!--
<taskdef classname="net.bluecow.googlecode.ant.GoogleCodeUploadTask" classpath="${make.dir}/ant-googlecode-0.0.2.jar" name="gcupload"/>
-->
<!-- ======================== ENGINE DISTRIBUTION TARGETS ======================= -->
<target name="dist" depends="engine.clean,engine.dist,dist.finish" description="Creates the full and compressed distribution zip files for The Render Engine"/>
<target name="engine.make.min" depends="engine.clean,engine.min" description="Creates the compressed distribution directory for The Render Engine"/>
<target name="engine.make.full" depends="engine.clean,engine.full" description="Creates the full distribution directory for The Render Engine"/>
<target name="engine.make.all" depends="engine.clean,engine.full,engine.min" description="Creates the full and compressed distribution directories for The Render Engine"/>
<target name="dist.finish" description="Cleanup tasks to perform after building the distribution">
<delete quiet="true" includeemptydirs="true" dir="${dist.home}/engine"/>
<delete quiet="true" includeemptydirs="true" dir="${full.home}/temp"/>
<delete quiet="true" includeemptydirs="true" dir="${min.home}/temp"/>
</target>
<target name="upload" description="Upload a single file to the GoogleCode site">
<gcupload
projectname="renderengine"
filename="${upload.file}"
targetfilename="${upload.targetFile}"
summary="${upload.targetDescription}"
labels="Featured,${upload.targetLabel},OpSys-All" />
</target>
<target name="dist.upload" description="Upload the distribution to the GoogleCode site">
<!-- Full -->
<antcall target="upload">
<param name="upload.file" value="${dist.home}/${app.name}_${app.version}.zip"/>
<param name="upload.targetFile" value="renderengine_${app.version}.zip"/>
<param name="upload.targetDescription" value="The Render Engine - ${app.version} (full)"/>
<param name="upload.targetLabels" value="Type-Source"/>
</antcall>
<!-- Compiled -->
<antcall target="upload">
<param name="upload.file" value="${dist.home}/${app.name}_${app.version}-min.zip"/>
<param name="upload.targetFile" value="renderengine_${app.version}-min.zip"/>
<param name="upload.targetDescription" value="The Render Engine - ${app.version} (compressed)"/>
<param name="upload.targetLabels" value="Type-SourceMin"/>
</antcall>
<!-- GZipped -->
<antcall target="upload">
<param name="upload.file" value="${dist.home}/${app.name}_${app.version}-min-gzip.zip"/>
<param name="upload.targetFile" value="renderengine_${app.version}-min-gzip.zip"/>
<param name="upload.targetDescription" value="The Render Engine - ${app.version} (gzipped)"/>
<param name="upload.targetLabels" value="Type-SourceMin"/>
</antcall>
</target>
<!-- =========================== ENGINE BUILD TARGETS ========================== -->
<target name="engine.build" description="Main engine build, concatenates source files and replaces some tags">
<echo message="Building ${engine.file}" />
<concat destfile="${engine.file}">
<fileset dir="${engine.src}" includes="engine.intro.js" />
<fileset dir="${engine.src}" includes="debug.console.js" />
<fileset dir="${engine.src}" includes="debug.profiler.js" />
<fileset dir="${engine.src}" includes="lang.math2.js" />
<fileset dir="${engine.src}" includes="engine.support.js" />
<fileset dir="${engine.src}" includes="engine.linker.js" />
<fileset dir="${engine.src}" includes="engine.main.js" />
<fileset dir="${engine.src}" includes="engine.script.js" />
<fileset dir="${engine.src}" includes="debug.metrics.js" />
<fileset dir="${engine.src}" includes="engine.init.js" />
</concat>
<replaceregexp match="@BUILD_VERSION" replace="${build.version}" flags="g" byline="true" file="${engine.file}" />
<replaceregexp match="@BUILD_DATE" replace="${build.date}" flags="g" byline="true" file="${engine.file}" />
<replaceregexp match="@ENGINE_VERSION" replace="${build.version}" flags="g" byline="true" file="${engine.file}" />
<replaceregexp match="@HOME_URL" replace="${build.homeurl}" flags="g" byline="true" file="${engine.file}" />
<replaceregexp match="@REF_NAME" replace="${build.refname}" flags="g" byline="true" file="${engine.file}" />
<echo message="${engine.file} built." />
</target>
<target name="engine.runtime" description="Build a single file compilation of the engine for testing">
<!-- Build the single-engine distribution -->
<antcall target="engine.build">
<param name="engine.file" value="${basedir}/engine/runtime/engine.js"/>
</antcall>
</target>
<target name="engine.runtime.min" description="Build a single file compilation of the engine, compressed">
<!-- Build the single-engine distribution -->
<antcall target="engine.build">
<param name="engine.file" value="${basedir}/engine/runtime/tempengine.js"/>
</antcall>
<java jar="${compiler.jar}" fork="true" failonerror="true"
jvm="${compiler.jvm}">
<arg line="--js ${basedir}/engine/runtime/tempengine.js --js_output_file ${basedir}/engine/runtime/engine.js"/>
</java>
<delete quiet="true">
<fileset dir="${basedir}/engine/runtime" includes="tempengine.js"/>
</delete>
</target>
<!-- Strip out R.debug.Console.log, R.debug.Console.debug, and R.debug.Console.info messages. We'll leave in
R.debug.Console.warn and R.debug.Console.error for obvious reasons. -->
<target name="engine.nodebug.full" depends="engine.full" description="Build a version of the engine with all debug messages removed">
<!-- LOGS -->
<replaceregexp match="R.debug.Console.log\(.*?\);" replace="" flags="g" byline="true">
<fileset dir="${full.home}">
<include name="**/*.js"/>
</fileset>
</replaceregexp>
<!-- DEBUGS -->
<replaceregexp match="R.debug.Console.debug\(.*?\);" replace="" flags="g" byline="true">
<fileset dir="${full.home}">
<include name="**/*.js"/>
</fileset>
</replaceregexp>
<!-- INFOS -->
<replaceregexp match="R.debug.Console.info\(.*?\);" replace="" flags="g" byline="true">
<fileset dir="${full.home}">
<include name="**/*.js"/>
</fileset>
</replaceregexp>
<!-- ENGINE METRICS -->
<replaceregexp match="Engine.addMetric\(.*?\);" replace="" flags="g" byline="true">
<fileset dir="${full.home}">
<include name="**/*.js"/>
</fileset>
</replaceregexp>
<replaceregexp match="Engine.removeMetric\(.*?\);" replace="" flags="g" byline="true">
<fileset dir="${full.home}">
<include name="**/*.js"/>
</fileset>
</replaceregexp>
</target>
<!-- =============================== ENGINE CLEAN ========================== -->
<target name="engine.clean" description="Prepares for creation of distribution">
<!-- Remove the target directory of the build -->
<delete quiet="true" includeemptydirs="true">
<fileset dir="${dist.home}" includes="**/*"/>
</delete>
<!-- Create the distribution home directory -->
<mkdir dir="${dist.home}"/>
<!-- Build the engine runtime -->
<antcall target="engine.build">
<param name="engine.file" value="${dist.home}/engine/runtime/engine.js"/>
</antcall>
</target>
<!-- ============================= ENGINE ZIP ============================ -->
<target name="engine.dist" depends="engine.full" description="Create and zip the engine distributions">
<!--<zip basedir="${min.home}" destfile="${dist.home}/${app.name}_${app.version}-min.zip"/> -->
<zip basedir="${full.home}" destfile="${dist.home}/${app.name}_${app.version}.zip"/>
</target>
<!-- ======================== DIRECTORY STRUCTURE FOR DIST ========================= -->
<target name="makedirs" description="Create the directory structure">
<mkdir dir="${build.home}"/>
<mkdir dir="${build.home}/temp"/>
<mkdir dir="${build.home}/engine"/>
<mkdir dir="${build.home}/engine/collision"/>
<mkdir dir="${build.home}/engine/collision/broadphase"/>
<mkdir dir="${build.home}/engine/components"/>
<mkdir dir="${build.home}/engine/components/collision"/>
<mkdir dir="${build.home}/engine/components/input"/>
<mkdir dir="${build.home}/engine/components/logic"/>
<mkdir dir="${build.home}/engine/components/physics"/>
<mkdir dir="${build.home}/engine/components/render"/>
<mkdir dir="${build.home}/engine/components/transform"/>
<mkdir dir="${build.home}/engine/configs"/>
<mkdir dir="${build.home}/engine/css"/>
<mkdir dir="${build.home}/engine/fonts"/>
<mkdir dir="${build.home}/engine/lang"/>
<mkdir dir="${build.home}/engine/libs"/>
<mkdir dir="${build.home}/engine/math"/>
<mkdir dir="${build.home}/engine/objects"/>
<mkdir dir="${build.home}/engine/particles"/>
<mkdir dir="${build.home}/engine/physics"/>
<mkdir dir="${build.home}/engine/rendercontexts"/>
<mkdir dir="${build.home}/engine/resources"/>
<mkdir dir="${build.home}/engine/resources/loaders"/>
<mkdir dir="${build.home}/engine/resources/types"/>
<mkdir dir="${build.home}/engine/runtime"/>
<mkdir dir="${build.home}/engine/sound"/>
<mkdir dir="${build.home}/engine/storage"/>
<mkdir dir="${build.home}/engine/struct"/>
<mkdir dir="${build.home}/engine/text"/>
<mkdir dir="${build.home}/engine/ui"/>
<mkdir dir="${build.home}/engine/util"/>
</target>
<target name="makedirs2" description="Create the directories for tools, tests, tutorials">
<mkdir dir="${build.home}/demos"/>
<mkdir dir="${build.home}/tools"/>
<mkdir dir="${build.home}/tutorials"/>
<mkdir dir="${build.home}/setup"/>
<mkdir dir="${build.home}/test"/>
</target>
<!-- ======================== COPY UNCOMPRESSED & PRECOMPRESSED FILES ========================= -->
<target name="basecopy" description="Copy the uncompressed files">
<!-- Copy the engine CSS -->
<copy todir="${build.home}/engine/css">
<fileset dir="${engine.home}/css">
<include name="*.css"/>
<include name="*.png"/>
<include name="*.jpg"/>
<include name="*.gif"/>
<exclude name="**/Thumbs.db"/>
</fileset>
</copy>
<!-- Copy the font description files and images -->
<copy todir="${build.home}/engine/fonts">
<fileset dir="${engine.home}/fonts" includes="${font.set}">
<exclude name="**/.svn"/>
<exclude name="**/Thumbs.db"/>
</fileset>
</copy>
<!-- Copy the supporting libraries -->
<copy todir="${build.home}/engine/libs">
<fileset dir="${engine.home}/libs">
<include name="AC_OETags.js"/>
<include name="base.js"/>
<include name="Box2dWeb-2.1.a.3.js"/>
<include name="jquery.js"/>
<include name="jquery.ext.engine.js"/>
<include name="soundmanager2.js"/>
<include name="soundmanager2.swf"/>
<include name="soundmanager2_flash9.swf"/>
<include name="sylvester.js"/>
<include name="trimpath-query-1.1.14.js"/>
</fileset>
</copy>
<!-- Copy the browser specific configurations -->
<copy todir="${build.home}/engine/configs">
<fileset dir="${engine.home}/configs">
<include name="*.config"/>
</fileset>
</copy>
<!-- Copy the simple webserver launcher -->
<copy todir="${build.home}">
<fileset file="${basedir}/run.bat"/>
</copy>
</target>
<target name="basecopy2" description="Copy tutorials, setup, and tests">
<!-- Copy the tests -->
<copy todir="${build.home}/test">
<fileset dir="${basedir}/test" includes="${test.set}">
<exclude name="**/.svn"/>
</fileset>
</copy>
<!-- Copy the tutorials -->
<copy todir="${build.home}/tutorials">
<fileset dir="${basedir}/tutorials" includes="**">
<exclude name="**/.svn"/>
<exclude name="**/Thumbs.db"/>
</fileset>
</copy>
<!-- Copy the server setup files -->
<copy todir="${build.home}/setup">
<fileset dir="${basedir}/setup">
<include name="**/*.*"/>
<exclude name="**/.svn"/>
</fileset>
</copy>
</target>
<!-- ======================= COPY DEMOS & TOOLS =============================== -->
<target name="copydemos" description="Copy demonstrations and tools">
<!-- Copy the demonstrations -->
<copy todir="${build.home}/demos">
<fileset dir="${basedir}/demos" includes="${demo.set}">
<exclude name="**/.svn"/>
<exclude name="**/Thumbs.db"/>
</fileset>
</copy>
<!-- Copy the tools -->
<copy todir="${build.home}/tools">
<fileset dir="${basedir}/tools" includes="${tool.set}">
<exclude name="**/.svn"/>
<exclude name="**/Thumbs.db"/>
</fileset>
</copy>
</target>
<!-- ======================= COPY LICENSES & DOCS =============================== -->
<target name="licenses" description="Copy licenses and docs">
<!-- Copy the license and readme files -->
<copy todir="${build.home}">
<fileset file="${basedir}/MIT_LICENSE.txt"/>
<fileset file="${basedir}/README.txt"/>
</copy>
<replaceregexp match="@BUILD_VERSION" replace="${build.version}" flags="g" byline="true" file="${build.home}/README.txt" />
<replaceregexp match="@BUILD_DATE" replace="${build.date}" flags="g" byline="true" file="${build.home}/README.txt" />
<replaceregexp match="@HOME_URL" replace="${build.homeurl}" flags="g" byline="true" file="${build.home}/README.txt" />
</target>
<!-- ======================= ENGINE FULL SOURCE DISTIBUTION ========================= -->
<target name="engine.full" description="Create the full source distribution of the engine">
<!-- ### START ### Pre-compilation tasks -->
<antcall target="makedirs">
<param name="build.home" value="${full.home}"/>
</antcall>
<antcall target="makedirs2">
<param name="build.home" value="${full.home}"/>
</antcall>
<antcall target="basecopy">
<param name="build.home" value="${full.home}"/>
<param name="source.flag" value=".src"/>
</antcall>
<antcall target="basecopy2">
<param name="build.home" value="${full.home}"/>
<param name="source.flag" value=".src"/>
</antcall>
<antcall target="copydemos">
<param name="build.home" value="${full.home}"/>
</antcall>
<antcall target="licenses">
<param name="build.home" value="${full.home}"/>
</antcall>
<!-- ### FINISH ### Pre-compilation tasks -->
<!-- Copy the engine files -->
<copy todir="${full.home}/engine">
<fileset dir="${basedir}/engine">
<include name="*.js"/>
</fileset>
</copy>
<copy todir="${full.home}/engine/runtime">
<fileset dir="${dist.home}/engine/runtime">
<include name="engine.js"/>
</fileset>
</copy>
<!-- Copy the collision models -->
<copy todir="${full.home}/engine/collision">
<fileset dir="${basedir}/engine/collision">
<include name="*.js"/>
</fileset>
</copy>
<copy todir="${full.home}/engine/collision/broadphase">
<fileset dir="${basedir}/engine/collision/broadphase">
<include name="*.js"/>
</fileset>
</copy>
<!-- Copy the object components -->
<copy todir="${full.home}/engine/components">
<fileset dir="${basedir}/engine/components">
<include name="*.js"/>
</fileset>
</copy>
<copy todir="${full.home}/engine/components/collision">
<fileset dir="${basedir}/engine/components/collision">
<include name="*.js"/>
</fileset>
</copy>
<copy todir="${full.home}/engine/components/input">
<fileset dir="${basedir}/engine/components/input">
<include name="*.js"/>
</fileset>
</copy>
<copy todir="${full.home}/engine/components/logic">
<fileset dir="${basedir}/engine/components/logic">
<include name="*.js"/>
</fileset>
</copy>
<copy todir="${full.home}/engine/components/physics">
<fileset dir="${basedir}/engine/components/physics">
<include name="*.js"/>
</fileset>
</copy>
<copy todir="${full.home}/engine/components/render">
<fileset dir="${basedir}/engine/components/render">
<include name="*.js"/>
</fileset>
</copy>
<copy todir="${full.home}/engine/components/transform">
<fileset dir="${basedir}/engine/components/transform">
<include name="*.js"/>
</fileset>
</copy>
<!-- Copy the language additions -->
<copy todir="${full.home}/engine/lang">
<fileset dir="${basedir}/engine/lang">
<include name="*.js"/>
</fileset>
</copy>
<!-- Copy the math objects -->
<copy todir="${full.home}/engine/math">
<fileset dir="${basedir}/engine/math">
<include name="*.js"/>
</fileset>
</copy>
<!-- Copy the starter objects -->
<copy todir="${full.home}/engine/objects">
<fileset dir="${basedir}/engine/objects">
<include name="*.js"/>
</fileset>
</copy>
<!-- Copy the particle systems -->
<copy todir="${full.home}/engine/particles">
<fileset dir="${basedir}/engine/particles">
<include name="*.js"/>
</fileset>
</copy>
<!-- Copy the physics simulation -->
<copy todir="${full.home}/engine/physics">
<fileset dir="${basedir}/engine/physics">
<include name="*.js"/>
</fileset>
</copy>
<!-- Copy the render contexts -->
<copy todir="${full.home}/engine/rendercontexts">
<fileset dir="${basedir}/engine/rendercontexts">
<include name="*.js"/>
</fileset>
</copy>
<!-- Copy the resource loaders and types -->
<copy todir="${full.home}/engine/resources/loaders">
<fileset dir="${basedir}/engine/resources/loaders">
<include name="*.js"/>
</fileset>
</copy>
<copy todir="${full.home}/engine/resources/types">
<fileset dir="${basedir}/engine/resources/types">
<include name="*.js"/>
</fileset>
</copy>
<!-- Copy the sound systems -->
<copy todir="${full.home}/engine/sound">
<fileset dir="${basedir}/engine/sound">
<include name="*.js"/>
</fileset>
</copy>
<!-- Copy the storage objects -->
<copy todir="${full.home}/engine/storage">
<fileset dir="${basedir}/engine/storage">
<include name="*.js"/>
</fileset>
</copy>
<!-- Copy the data structures -->
<copy todir="${full.home}/engine/struct">
<fileset dir="${basedir}/engine/struct">
<include name="*.js"/>
</fileset>
</copy>
<!-- Copy the text rendering -->
<copy todir="${full.home}/engine/text">
<fileset dir="${basedir}/engine/text">
<include name="*.js"/>
</fileset>
</copy>
<!-- Copy the UI controls -->
<copy todir="${full.home}/engine/ui">
<fileset dir="${basedir}/engine/ui">
<include name="*.js"/>
</fileset>
</copy>
<!-- Copy the utility classes -->
<copy todir="${full.home}/engine/util">
<fileset dir="${basedir}/engine/util">
<include name="*.js"/>
</fileset>
</copy>
<!-- Exclude any specified files -->
<delete quiet="true">
<fileset dir="${full.home}" includes="${exclude.set}"/>
</delete>
</target>
<!-- ================== ENGINE MINIFIED/COMPRESSED DISTRIBUTION ===================== -->
<target name="min.nodebug" description="Remove debug, log, and info messages">
<!-- LOGS -->
<replaceregexp match="R.debug.Console.log\(.*?\);" replace="" flags="g" byline="true" file="${input.file}"/>
<!-- DEBUGS -->
<replaceregexp match="R.debug.Console.debug\(.*?\);" replace="" flags="g" byline="true" file="${input.file}"/>
<!-- INFOS -->
<replaceregexp match="R.debug.Console.info\(.*?\);" replace="" flags="g" byline="true" file="${input.file}"/>
<!-- ENGINE METRICS -->
<replaceregexp match="Engine.addMetric\(.*?\);" replace="" flags="g" byline="true" file="${input.file}"/>
<replaceregexp match="Engine.removeMetric\(.*?\);" replace="" flags="g" byline="true" file="${input.file}"/>
<!-- PRAGMA DEBUG BLOCKS -->
<replaceregexp match="\/\*\s*pragma:DEBUG_START\s*\*\/(.|\n)*?\/\*\s*pragma:DEBUG_END\s*\*\/" replace="" flags="gm" file="${input.file}"/>
</target>
<target name="engine.compile" description="Use the Google Closure Compiler to compress the code">
<copy todir="${min.home}/temp">
<fileset dir="${basedir}">
<include name="${input.file}"/>
</fileset>
</copy>
<antcall target="min.nodebug">
<param name="input.file" value="${min.home}/temp/${input.file}"/>
</antcall>
<java jar="${compiler.jar}" fork="true" failonerror="true"
jvm="${compiler.jvm}">
<arg line="--js ${min.home}/temp/${input.file} --js_output_file ${min.home}/${input.file}"/>
</java>
</target>
<target name="engine.compress" description="Use the Yahoo!UI Compressor to compress the code">
<copy todir="${min.home}/temp">
<fileset dir="${basedir}">
<include name="${input.file}"/>
</fileset>
</copy>
<antcall target="min.nodebug">
<param name="input.file" value="${min.home}/temp/${input.file}"/>
</antcall>
<java classname="com.yahoo.platform.yui.compressor.YUICompressor">
<arg line="--nomunge --disable-optimizations --preserve-semi --line-break 200 -o ${min.home}/${input.file} ${min.home}/temp/${input.file}"/>
<classpath>
<pathelement path="${compressor.jar}"/>
</classpath>
</java>
</target>
<target name="engine.min" description="Create the minified/compressed distribution of the engine">
<!-- ### START ### Pre-compilation tasks -->
<!-- MINIMIZED -->
<antcall target="makedirs">
<param name="build.home" value="${min.home}"/>
</antcall>
<antcall target="basecopy">
<param name="build.home" value="${min.home}"/>
<param name="source.flag" value=""/>
</antcall>
<antcall target="licenses">
<param name="build.home" value="${min.home}"/>
</antcall>
<!-- ### FINISH ### Pre-compilation tasks -->
<!-- Compress and copy the engine files -->
<echo message="Compressing engine..."/>
<antcall target="${compress.option}">
<param name="basedir" value="${dist.home}"/>
<param name="input.file" value="engine/runtime/engine.js"/>
</antcall>
<concat destfile="${dist.home}/engine/engine.js">
<fileset dir="${make.dir}" includes="intro.js" />
<fileset dir="${min.home}/engine/runtime" includes="engine.js" />
</concat>
<replaceregexp match="@BUILD_VERSION" replace="${build.version}" flags="g" byline="true" file="${dist.home}/engine/engine.js" />
<replaceregexp match="@BUILD_DATE" replace="${build.date}" flags="g" byline="true" file="${dist.home}/engine/engine.js" />
<replaceregexp match="@ENGINE_VERSION" replace="${build.version}" flags="g" byline="true" file="${dist.home}/engine/engine.js" />
<replaceregexp match="@HOME_URL" replace="${build.homeurl}" flags="g" byline="true" file="${engine.file}" />
<replaceregexp match="@REF_NAME" replace="${build.refname}" flags="g" byline="true" file="${engine.file}" />
<copy todir="${min.home}/engine/runtime">
<fileset dir="${dist.home}/engine">
<include name="engine.js"/>
</fileset>
</copy>
<antcall target="${compress.option}">
<param name="input.file" value="engine/engine.baseobject.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="engine/engine.container.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="engine/engine.events.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="engine/engine.fnv1hash.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="engine/engine.game.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="engine/engine.hostobject.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="engine/engine.math2d.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="engine/engine.mathprimitives.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="engine/engine.object2d.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="engine/engine.particles.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="engine/engine.pooledobject.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="engine/engine.rendercontext.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="engine/engine.resourceloader.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="engine/engine.spatialcontainer.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="engine/engine.timers.js"/>
</antcall>
<!-- Compress and copy the object components -->
<echo message="Compressing components..."/>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.base.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.basebody.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.basejoint.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.billboard2d.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.boxbody.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.boxcollider.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.circlebody.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.circlecollider.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.collider.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.distancejoint.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.host.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.image.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.input.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.keyboardinput.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.logic.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.mouseinput.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.mover2d.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.notifier.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.render.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.revolutejoint.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.sprite.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.touchinput.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.transform2d.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.vector2d.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="components/component.wiimoteinput.js"/>
</antcall>
<!-- Compress and copy the render contexts -->
<echo message="Compressing rendercontexts..."/>
<antcall target="${compress.option}">
<param name="input.file" value="rendercontexts/context.canvascontext.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="rendercontexts/context.documentcontext.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="rendercontexts/context.htmldivcontext.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="rendercontexts/context.htmlelement.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="rendercontexts/context.render2d.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="rendercontexts/context.scrollingbackground.js"/>
</antcall>
<!-- Compress and copy the resource loaders -->
<echo message="Compressing resourceloaders..."/>
<antcall target="${compress.option}">
<param name="input.file" value="resourceloaders/loader.bitmapfont.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="resourceloaders/loader.image.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="resourceloaders/loader.level.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="resourceloaders/loader.object.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="resourceloaders/loader.remote.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="resourceloaders/loader.remotefile.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="resourceloaders/loader.sound.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="resourceloaders/loader.sprite.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="resourceloaders/loader.xml.js"/>
</antcall>
<!-- Copy the collision models -->
<echo message="Compressing spatial..."/>
<antcall target="${compress.option}">
<param name="input.file" value="spatial/container.spatialgrid.js"/>
</antcall>
<!-- Copy the text rendering -->
<echo message="Compressing textrender..."/>
<antcall target="${compress.option}">
<param name="input.file" value="textrender/text.abstractrender.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="textrender/text.bitmap.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="textrender/text.context.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="textrender/text.renderer.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="textrender/text.vector.js"/>
</antcall>
<!-- Copy the starter objects -->
<echo message="Compressing objects..."/>
<antcall target="${compress.option}">
<param name="input.file" value="objects/object.physicsactor.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="objects/object.spriteactor.js"/>
</antcall>
<!-- Copy the box2d physics engine -->
<echo message="Compressing Box2d physics engine..."/>
<antcall target="${compress.option}">
<param name="input.file" value="physics/physics.simulation.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="physics/collision/b2AABB.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="physics/collision/b2Bound.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="physics/collision/b2BoundValues.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="physics/collision/b2BroadPhase.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="physics/collision/b2BufferedPair.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="physics/collision/b2Collision.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="physics/collision/b2ContactID.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="physics/collision/b2ContactPoint.js"/>
</antcall>
<antcall target="${compress.option}">
<param name="input.file" value="physics/collision/b2Distance.js"/>
</antcall>
<antcall target="${compress.option}">