-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.xml
178 lines (143 loc) · 5.77 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="sjl" default="all" basedir="./" xmlns:ac="antlib:net.sf.antcontrib">
<property file="build.properties"/>
<target name="all" depends="clean,pack_javascript,build-docs" />
<target name="dist" depends="all, package-release, clean, package-release-src"/>
<target name="clean">
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${path.build}" includes="**/*"/>
</delete>
</target>
<target name="pack_javascript" depends="_create_build_tree">
<antcall target="package-bootstrap"></antcall>
<antcall target="compress-javascript-shrinksafe"/>
<antcall target="addlicense"/>
<antcall target="copy-to-test"/>
</target>
<target name="_create_build_tree">
<mkdir dir="${path.build.doc}"/>
<mkdir dir="${path.build.bin}"/>
<mkdir dir="${path.build.release}"/>
</target>
<target name="package-bootstrap" depends="package-corelibs, package-ajile, package-common, package-init"/>
<target name="package-corelibs">
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${path.src}" includes="bootstrap.js"/>
</delete>
<apply executable="java" dest="${path.build.release}" parallel="false" failonerror="true" force="true" verbose="true">
<arg line="-jar ${path.lib}/custom_rhino.jar -c"/>
<srcfile/>
<fileset dir="${path.src}/com/sjl/lang" includes="Util*,DOM*,OO*"/>
<!--<fileset dir="${path.src}/com/sjl" includes="History.js"/>-->
<mapper id="js_out" type="glob" from="*" to="${path.build.release}/bootstrap.js"/>
<redirector createemptyfiles="true" append="true" output="${path.build.release}/bootstrap.js"/>
</apply>
</target>
<target name="package-ajile">
<concat append="true" fixlastline="true" destfile="${path.build.release}/bootstrap.js">
<fileset dir="${path.src}" includes="com.iskitz.ajile.js"/>
</concat>
</target>
<target name="package-common">
<apply executable="java" dest="${path.build.release}" parallel="false" failonerror="true" force="true" verbose="true">
<arg line="-jar ${path.lib}/custom_rhino.jar -c"/>
<srcfile/>
<fileset dir="${path.src}/com/sjl/application" includes="Environment.js"/>
<fileset dir="${path.src}/com/sjl" includes="DOMParser.js,TearDown.js,EventDispatcher.js,DOMEventDispatcher.js"/>
<fileset dir="${path.src}/com/sjl/io" includes="ResourceLoader.js"/>
<mapper id="js_out" type="glob" from="*" to="${path.build.release}/bootstrap.js"/>
<redirector createemptyfiles="true" append="true" output="${path.build.release}/bootstrap.js"/>
</apply>
<concat destfile="${path.build.release}/bootstrap.js" append="true">
<filelist dir="${path.src}/com/sjl/io" files="ResourceLoader.ie.stub"/>
</concat>
</target>
<target name="package-init">
<apply executable="java" dest="${path.build.release}" parallel="false" failonerror="true" force="true" verbose="true">
<arg line="-jar ${path.lib}/custom_rhino.jar -c"/>
<srcfile/>
<fileset dir="${path.src}" includes="index.js"/>
<mapper id="js_out" type="glob" from="*" to="${path.build.release}/bootstrap.js"/>
<redirector createemptyfiles="true" append="true" output="${path.build.release}/bootstrap.js"/>
</apply>
</target>
<target name="compress-javascript-shrinksafe">
<copy todir="${path.build.release}">
<fileset dir="${path.src}" excludesfile="build_exclusions"/>
</copy>
<apply executable="java" dest="${path.build.release}" parallel="false" failonerror="true" force="true" verbose="true">
<arg line="-jar ${path.lib}/custom_rhino.jar -c"/>
<srcfile/>
<fileset dir="${path.src}" excludesfile="build_exclusions"/>
<mapper id="js_out" type="glob" from="*.js" to="${path.build.release}/*.js"/>
<redirector createemptyfiles="true">
<outputmapper refid="js_out"/>
</redirector>
</apply>
</target>
<target name="copy-to-test">
<copy todir="${path.test}">
<fileset dir="${path.build.release}"/>
</copy>
</target>
<target name="addlicense">
<ac:for param="file">
<fileset id="missing" dir="${path.build.release}" includes="**/*.js">
<not>
<contains text="* @license http://www.opensource.org/licenses/bsd-license.php New BSD License"/>
</not>
</fileset>
<sequential>
<copy file="@{file}" tofile="@{file}.withlicense">
<filterchain>
<concatfilter prepend="${path.lib}/license-js.stub.txt"/>
</filterchain>
</copy>
<move file="@{file}.withlicense" tofile="@{file}"/>
</sequential>
</ac:for>
</target>
<target name="build-docs">
<copy todir="${path.build.doc}/apiviewer">
<fileset dir="${path.lib}/apiviewer"/>
</copy>
<apply executable="perl" parallel="true">
<arg value="${path.lib}/jsdoc/jsdoc.pl"/>
<arg value="--package-naming"/>
<arg value="--project-name=${project.name}"/>
<arg value="-p"/>
<arg value="--recursive"/>
<arg value="--nested-file-naming"/>
<arg value="--format=xml"/>
<arg value="-d=${path.build.doc}"/>
<fileset dir="${path.src}" casesensitive="yes">
<filename name="**/*.js"/>
<filename name="**/*Blowfish*" negate="true"/>
<filename name="**/*iskitz*" negate="true"/>
</fileset>
</apply>
<antcall target="fix-docs-xml"/>
</target>
<target name="fix-docs-xml">
<exec executable="php">
<arg value="${path.lib}/js_fix_CDATA_entities.php"/>
</exec>
</target>
<target name="package-release">
<tar destfile="${path.build.bin}/${project.name}-${project.version}.tar">
<tarfileset dir="${path.build.release}">
</tarfileset>
<tarfileset dir="${project.basedir}">
<include name="**.txt"/>
</tarfileset>
</tar>
</target>
<target name="package-release-src">
<tar destfile="${path.build.bin}/${project.name}-${project.version}-src.tar">
<tarfileset dir="./">
<exclude name="**/.git/**"/>
<exclude name="**/test/**"/>
</tarfileset>
</tar>
</target>
</project>