-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.xml
131 lines (113 loc) · 4.82 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
<project name="lanyard" default="all" basedir=".">
<property name="src.dir" value="${basedir}/src" />
<property name="contrib.dir" value="${basedir}/contrib" />
<property name="closure-compiler.dir" value="${contrib.dir}/closure-compiler" />
<property name="closure-library.dir" value="${contrib.dir}/closure-library" />
<property name="build.dir" value="${basedir}/build" />
<property name="test.dir" value="${basedir}/test" />
<property name="jsunit.dir" value="${test.dir}/jsunit" />
<property name="externs.dir" value="${basedir}/externs" />
<target name="clean" description="delete generated files" depends="test-clean">
<delete dir="${build.dir}" />
</target>
<macrodef name="calcdeps">
<attribute name="outputfile" />
<attribute name="compilerjarfile" default="${closure-compiler.dir}/compiler.jar" />
<attribute name="compilationlevel" default="ADVANCED_OPTIMIZATIONS" />
<attribute name="extraflags" default="" />
<attribute name="outputmode" default="compiled" />
<sequential>
<mkdir dir="${build.dir}" />
<exec executable="python"
output="${build.dir}/@{outputfile}"
logError="true"
failonerror="true">
<arg value="${closure-library.dir}/bin/calcdeps.py" />
<!-- Double-quote file arguments in case they contain spaces. -->
<!-- List of demo files begins here. -->
<arg line='-i "${basedir}/src/demo/BasicDemo.js"' />
<arg line='-p "${src.dir}"' />
<arg line='-p "${closure-library.dir}"' />
<arg line="-o @{outputmode}" />
<arg line='-c "@{compilerjarfile}"' />
<!-- <arg line='-f "- -create_source_map=${build.dir}/inspector.map"' /> -->
<arg line='-f "--compilation_level=@{compilationlevel}"' />
<arg line='-f "--jscomp_error=accessControls"' />
<arg line='-f "--jscomp_error=ambiguousFunctionDecl"' />
<arg line='-f "--jscomp_error=checkTypes"' />
<arg line='-f "--jscomp_error=deprecated"' />
<arg line='-f "--jscomp_error=checkVars"' />
<arg line='-f "--jscomp_error=externsValidation"' />
<arg line='-f "--jscomp_error=fileoverviewTags"' />
<arg line='-f "--jscomp_error=globalThis"' />
<arg line='-f "--jscomp_error=internetExplorerChecks"' />
<arg line='-f "--jscomp_error=invalidCasts"' />
<arg line='-f "--jscomp_error=missingProperties"' />
<arg line='-f "--jscomp_error=nonStandardJsDocs"' />
<arg line='-f "--jscomp_error=strictModuleDepCheck"' />
<arg line='-f "--jscomp_error=unknownDefines"' />
<arg line='-f "--jscomp_error=uselessCode"' />
<arg line='-f "--jscomp_error=visibility"' />
<arg line='-f "--warning_level=VERBOSE"' />
<arg line="@{extraflags}" />
</exec>
</sequential>
</macrodef>
<target name="advanced-no-debug">
<calcdeps outputfile="lanyard.js" compilerjarfile="${build.dir}/compiler.jar" />
</target>
<target name="advanced">
<calcdeps outputfile="lanyard.js" />
<!-- <gzip src="${build.dir}/lanyard.js" destfile="${build.dir}/lanyard.js.gz" /> -->
<!-- <delete file="${build.dir}/lanyard.js" /> -->
</target>
<target name="simple">
<calcdeps outputfile="lanyard.js" compilationlevel="SIMPLE_OPTIMIZATIONS" />
</target>
<target name="whitespace-only">
<calcdeps outputfile="lanyard.js" compilationlevel="WHITESPACE_ONLY" />
</target>
<target name="test-clean" description="delete generated files for test">
<delete dir="${jsunit.dir}/test-lanyard" />
<delete dir="${jsunit.dir}/logs" />
<delete dir="${basedir}/logs" />
</target>
<target name="test" depends="test-setup-jsunit">
<ant antfile="${jsunit.dir}/build.xml" inheritAll="false" target="standalone_test"></ant>
</target>
<target name="test-setup-jsunit" depends="advanced">
<copy file="${build.dir}/lanyard.js" tofile="${jsunit.dir}/test-lanyard/lanyard.js"/>
<copy todir="${jsunit.dir}/test-lanyard">
<fileset dir="${test.dir}/js" />
</copy>
</target>
<target name="style">
<exec executable="fixjsstyle"
logError="true"
failonerror="true">
<arg value="--strict" />
<arg value="-r" />
<arg value="${src.dir}" />
</exec>
</target>
<target name="lint">
<exec executable="gjslint"
logError="true"
failonerror="true">
<arg value="--strict" />
<arg value="-r" />
<arg value="${src.dir}" />
</exec>
</target>
<target name="doc">
<exec executable="${contrib.dir}/jsdoc-toolkit/jsrun.sh"
logError="true"
failonerror="true">
<arg value="${src.dir}" />
<arg value="${src.dir}/geom" />
<arg line='-t=${contrib.dir}/jsdoc-toolkit/templates/jsdoc' />
<arg line='-d=${build.dir}/doc' />
</exec>
</target>
<target name="all" depends="advanced" />
</project>