-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.xml
85 lines (58 loc) · 2.35 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
<project name="glslprep" basedir="." default="build">
<target name="build" description="build all" depends="library,minifier" />
<property name="srcdir" value="${basedir}/src" />
<property name="js_codebase" value="${srcdir}" />
<target name="clean" description="delete build output">
<delete file="${basedir}/${ant.project.name}.min.js" />
</target>
<target name="library">
<compile-js
entry-point="glslminify"
output-file="${basedir}/glslminify.min.js">
<arg line="--define glslminify.EXPORT_API" />
<arg value="--output_wrapper_file" /><arg file="${srcdir}/glslminify.wrapper.txt" />
<arg line="--compilation_level ADVANCED_OPTIMIZATIONS" />
<arg value="--use_types_for_optimization" />
</compile-js>
</target>
<target name="minifier">
<compile-js
entry-point="glslprep"
output-file="${basedir}/glslprep.js">
<arg prefix="--jscomp_off=" line="es5Strict undefinedNames" />
<arg value="--output_wrapper_file" /><arg file="${srcdir}/glslprep.wrapper.txt" />
<arg value="--use_types_for_optimization" />
<arg prefix="--externs=externs/" line="node_common.js" />
</compile-js>
</target>
<target name="debug-deps">
<exec executable="python" output="${srcdir}/goog/deps.js">
<arg file="${basedir}/tools/calcdeps.py" />
<arg value="-i"/><arg file="${srcdir}" />
<arg value="-p"/><arg file="${srcdir}" />
<arg line="-o deps" />
</exec>
</target>
<macrodef name="compile-js">
<attribute name="entry-point" />
<attribute name="output-file" />
<element name="extra" optional="true" implicit="true" />
<sequential>
<java jar="${basedir}/tools/closure-compiler.jar"
failonerror="true" fork="true">
<arg value="--js" /><arg file="${srcdir}/**.js" />
<arg value="--js_output_file" /><arg file="@{output-file}" />
<arg value="--closure_entry_point" /><arg value="@{entry-point}" />
<arg value="--generate_exports" /><!-- required by glslunit interna -->
<arg value="--only_closure_dependencies" />
<arg line="--warning_level VERBOSE --summary_detail_level 3" />
<arg prefix="--jscomp_error="
line="accessControls checkTypes" />
<arg prefix="--jscomp_warning="
line="inferredConstCheck missingProperties typeInvalidation undefinedNames" />
<jvmarg line="-server -XX:+TieredCompilation" />
<extra />
</java>
</sequential>
</macrodef>
</project>