-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.xml
81 lines (64 loc) · 2.95 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
<?xml version="1.0" encoding="utf-8"?>
<project name="project" default="all">
<property name="software-short" value="xio" />
<property name="level" value="ADVANCED_OPTIMIZATIONS" />
<property name="basedir" location="." />
<property name="src" value="${basedir}/src" />
<property name="lib" value="${basedir}/lib" />
<property name="bin" value="${basedir}/bin" />
<property name="closure-compiler" value="${lib}/google-closure-compiler/compiler.jar" />
<property name="closure-library" value="${lib}/google-closure-library" />
<property name="closure-library-deps" value="${closure-library}/closure/goog/deps.js" />
<property name="closure-library-depswriter" value="${closure-library}/closure/bin/build/depswriter.py" />
<property name="closure-library-builder" value="${closure-library}/closure/bin/build/closurebuilder.py" />
<property name="dependency-file" value="${software-short}-deps.js" />
<loadfile property="license" srcfile="./LICENSE.min" />
<target name="prebuild" description="Performs pre-build steps.">
<mkdir dir="${bin}" />
</target>
<!-- deps.js file generation for development and .js file collection -->
<target name="deps" description="Generates a dependency file for development.">
<exec executable="python" failonerror="true">
<arg line="${closure-library-depswriter}" />
<arg line="--output_file=${dependency-file}" />
<arg line="--root_with_prefix='${src} ../../../../src'"/>
<arg line="--root_with_prefix='${lib}/zlib.js ../../../../lib/zlib.js'"/>
</exec>
</target>
<!-- Build everything. -->
<target name="all" depends="deps,prebuild" description="Builds ${software-short}.js.">
<!-- Find all source files. -->
<pathconvert property="srcfiles" pathsep=" ">
<map from="${basedir}" to="-i ." />
<fileset dir="${src}" includes="**/*.js" />
</pathconvert>
<!-- Execute the closure builder. -->
<exec executable="python" failonerror="true">
<arg line="${closure-library-builder}" />
<arg line="--root ${src}" />
<!-- include the closure library -->
<arg line="--root ${closure-library}" />
<!-- include zlib.js -->
<arg line="--root ${lib}/zlib.js/src" />
<arg line="-o compiled" />
<arg line="-c ${closure-compiler}" />
<arg line="--output_file=${bin}/${software-short}.js" />
<arg line="-f --warning_level=VERBOSE" />
<arg line="-f --compilation_level=ADVANCED_OPTIMIZATIONS" />
<arg line="-f --jscomp_warning=missingProperties" />
<arg line="-f --jscomp_warning=checkTypes" />
<arg line="-f --define=goog.DEBUG=false" />
<arg line="-f --summary_detail_level=3" />
<arg line="-f --output_wrapper='${license}(function() {%output%}).call(this);'" />
<arg line="${srcfiles}" />
<arg line="-f --js=${closure-library-deps}" />
</exec>
</target>
<!-- Delete old build files. -->
<target name="clean">
<delete dir="${bin}" />
</target>
<!-- Rebuild all. -->
<target name="rebuild" depends="clean,all" />
</project>
<!-- vim: set expandtab ts=2 sw=2: -->