forked from chemhack/libSBGN.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
111 lines (94 loc) · 5.04 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
<?xml version="1.0" encoding="utf-8"?>
<project name="sb" default="usage">
<property name="base.dir" location="."/>
<property name="build.dir" value="${base.dir}/build"/>
<property name="closure-library.dir" value="${base.dir}/third-party/closure-library"/>
<property name="closure-compiler.jar" value="${base.dir}/third-party/closure-compiler/compiler-extra.jar"/>
<property name="js-src.dir" value="${base.dir}/src"/>
<property name="jsdoc.dir" value="${base.dir}/third-party/jsdoc-toolkit"/>
<property name="jsdoc-template.dir" value="${base.dir}/third-party/jsdoc-template"/>
<property name="doc.dir" value="${base.dir}/docs"/>
<path id="input-files">
<filelist dir="${js-src.dir}/api">
<file name="api.js"/>
</filelist>
</path>
<pathconvert pathsep=' -i ' property="jsfiles" refid="input-files"/>
<macrodef name="calcdeps">
<attribute name="inputfiles" default="${jsfiles}"/>
<attribute name="outputfile"/>
<attribute name="compilerjarfile" default="${closure-compiler.jar}"/>
<attribute name="compilationlevel" default="ADVANCED_OPTIMIZATIONS"/>
<attribute name="outputmode" default="compiled"/>
<element name="extraflags" optional="yes"/>
<sequential>
<mkdir dir="${build.dir}"/>
<exec executable="python" failonerror="true" logError="true" output="${build.dir}/@{outputfile}">
<arg value="${closure-library.dir}/closure/bin/calcdeps.py"/>
<arg line='-i @{inputfiles}'/>
<arg line='-p ${closure-library.dir}'/>
<arg line='-p ${js-src.dir}'/>
<arg line="-o @{outputmode}"/>
<arg line='-c "@{compilerjarfile}"'/>
<arg line='-f "--compilation_level=@{compilationlevel}"'/>
<arg line='-f "--debug=false"'/>
<arg line='-f "--define=goog.DEBUG=false"'/>
<arg line='-f "--generate_exports"'/>
<arg line='-f "--output_wrapper=(function(){%output%})();"'/>
<arg line='-f "--jscomp_warning=checkTypes"'/>
<arg line='-f "--jscomp_warning=accessControls"'/>
<arg line='-f "--jscomp_warning=missingProperties"'/>
<arg line='-f "--jscomp_warning=unknownDefines"'/>
<arg line='-f "--jscomp_warning=strictModuleDepCheck"'/>
<arg line='-f "--manage_closure_dependencies"'/>
<extraflags/>
</exec>
</sequential>
</macrodef>
<target name="clean" description="delete generated files">
<delete dir="${build.dir}"/>
</target>
<target name="build-deps" description="rebuild deps.js file, should be executed when namespace changed">
<exec executable="python" failonerror="true" logError="true" output="${build.dir}/deps.js">
<arg value="${closure-library.dir}/closure/bin/calcdeps.py"/>
<arg line='-p "${closure-library.dir}"'/>
<arg line='-p "${js-src.dir}"'/>
<arg line="-o deps"/>
</exec>
</target>
<target name="build-docs" description="build the JsDoc documentation">
<exec executable="java" failonerror="true" logError="true" output="${base.dir}/jsdoc.log">
<arg line="-jar ${jsdoc.dir}/jsrun.jar ${jsdoc.dir}/app/run.js -r=10 ${js-src.dir} -t=${jsdoc-template.dir} -d=${doc.dir}"/>
</exec>
</target>
<target name='compile-check' description='check by compiling all js files'>
<mkdir dir="${build.dir}"/>
<exec executable="python" failonerror="true" logError="true" output="${build.dir}/compile-check.js">
<arg value="${closure-library.dir}/closure/bin/calcdeps.py"/>
<arg line='-i ${js-src.dir}'/>
<arg line='-p ${closure-library.dir}'/>
<arg line='-p ${js-src.dir}'/>
<arg line="-o compiled"/>
<arg line='-c "${closure-compiler.jar}"'/>
<arg line='-f "--compilation_level=ADVANCED_OPTIMIZATIONS"'/>
<arg line='-f "--jscomp_warning=checkTypes"'/>
</exec>
</target>
<!-- Default Google Closure Compiler compilation levels -->
<target name="compile-advanced" description="Compile with ADVANCED_OPTIMIZATIONS setting">
<calcdeps outputfile="compiled-advanced.js"/>
</target>
<target name="compile-simple" description="Compile with SIMPLE_OPTIMIZATIONS setting">
<calcdeps outputfile="compiled-simple.js" compilationlevel="SIMPLE_OPTIMIZATIONS"/>
</target>
<target name="compile-whitespace-only" description="Compile with WHITESPACE_ONLY setting">
<calcdeps outputfile="compiled-whitespace-only.js" compilationlevel="WHITESPACE_ONLY"/>
</target>
<target name="compile" depends="compile-advanced" description="Compile with default settings">
</target>
<target name="usage" description="Display main targets by running 'ant -projecthelp'">
<java classname="org.apache.tools.ant.Main">
<arg value="-projecthelp"/>
</java>
</target>
</project>