-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
280 lines (209 loc) · 9.96 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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
<?xml version="1.0" encoding="UTF-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!--
Require min Ant 1.9.1
-->
<project name="hashlib" default="main" basedir="."
xmlns:if="ant:if"
xmlns:unless="ant:unless" >
<target name="clean">
<delete dir="${basedir}/bin-release" />
<delete dir="${basedir}/bin-deploy" />
<delete dir="${basedir}/docs" />
</target>
<target name="before" depends="clean">
<!-- override -->
<property file="user.properties"/>
<!-- config -->
<property name="FLEX_HOME_MAC" value="/sdk/flex/4_6" />
<property name="FLEX_HOME_WIN" value="c:/sdk/flex/4_6" />
<property name="build.info" value="true" />
<property name="build.component" value="true" />
<property name="build.noswc" value="false" />
<property name="build.noabc" value="false" />
<property name="build.documentation" value="true" />
<property name="build.fatswc" value="true" />
<property name="build.nodoc" value="false" />
<property name="build.release" value="true" />
<property name="build.nozip" value="false" />
<condition property="FLEX_HOME" value="${FLEX_HOME_MAC}">
<os family="mac" />
</condition>
<condition property="FLEX_HOME" value="${FLEX_HOME_WIN}">
<os family="windows" />
</condition>
<tstamp>
<format property="TODAY" pattern="dd MMMM yyyy" />
<format property="TODAY_FILE" pattern="Y-MM-dd" />
</tstamp>
<property name="project.name" value="${ant.project.name}" />
<property name="project.fullname" value="Hashing Library" />
<property file="${basedir}/src/version.properties"/>
<property name="project.version" value="${version.major}.${version.minor}.${version.build}" />
<taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
<mkdir dir="${basedir}/bin-release" />
<mkdir dir="${basedir}/bin-deploy" />
<mkdir dir="${basedir}/docs/${project.name}" />
<!-- debug -->
<sequential if:true="${build.info}">
<echo message="${project.fullname}" />
<echo message="${project.name} v${project.version}" />
<echo message="properties:" />
<echo message=" FLEX_HOME = ${FLEX_HOME}" />
<echo message=" TODAY = ${TODAY}" />
<echo message=" TODAY_FILE = ${TODAY_FILE}" />
<echo message="actions:" />
<echo message=" component = ${build.component}" />
<echo message=" documentation = ${build.documentation}" />
<echo message=" release = ${build.release}" />
<echo message="options:" />
<echo message=" build.noswc = ${build.noswc}" />
<echo message=" build.noabc = ${build.noabc}" />
<echo message=" build.nodoc = ${build.nodoc}" />
<echo message=" build.fatswc = ${build.fatswc}" />
<echo message=" build.nozip = ${build.nozip}" />
</sequential>
</target>
<target name="main" depends="before,clean,compile,after">
</target>
<target name="compile">
<antcall target="compile-swc" if:true="${build.component}"/>
<antcall target="compile-abc" if:true="${build.component}"/>
<antcall target="compile-doc" if:true="${build.documentation}"/>
<antcall target="compile-release" if:true="${build.release}"/>
</target>
<target name="compile-swc">
<sequential unless:true="${build.noswc}">
<compc
output="${basedir}/bin-release/${project.name}.swc"
>
<load-config>${basedir}/build/flex-config.xml</load-config>
<strict>false</strict>
<optimize>true</optimize>
<warnings>false</warnings>
<verbose-stacktraces>true</verbose-stacktraces>
<compute-digest>false</compute-digest>
<external-library-path dir="${basedir}/lib-swc" append="true">
<include name="redtamarin.swc"/>
</external-library-path>
<include-sources dir="src" includes="${project.name}.as" />
</compc>
</sequential>
</target>
<target name="compile-abc">
<sequential unless:true="${build.noabc}">
<exec executable="redbean" dir="${basedir}" failonerror="true">
</exec>
<move file="${basedir}/${project.name}.abc" todir="${basedir}/bin-release" />
</sequential>
</target>
<target name="compile-doc">
<sequential unless:true="${build.nodoc}">
<asdoc
output="${basedir}/docs/${project.name}"
templates-path="${basedir}/build/doc/templates/"
main-title="${project.fullname}"
footer="${project.name} v${project.version}"
window-title="${project.fullname} v${project.version}"
left-frameset-width="256"
keep-xml="${build.fatswc}"
skip-xsl="false"
warnings="false"
strict="false"
failonerror="true"
fork="true"
>
<verbose-stacktraces>true</verbose-stacktraces>
<load-config>${basedir}/build/flex-config.xml</load-config>
<external-library-path dir="${basedir}/lib-swc" append="true">
<include name="redtamarin.swc"/>
</external-library-path>
<!-- this does not work, not all methods and properties are not documented -->
<!--
<doc-sources path-element="${basedir}/src/${project.name}.as"/>
-->
<!-- this alternative works -->
<doc-sources path-element="${basedir}/src"/>
<source-path path-element="${basedir}/src" />
<exclude-sources path-element="${basedir}/src/${project.name}.as" />
<package-description-file>${basedir}/build/doc/package.description.xml</package-description-file>
</asdoc>
<!--
<asdoc
output="${basedir}/docs/${project.name}"
templates-path="${basedir}/build/doc/templates/"
main-title="${project.fullname}"
footer="${project.name} v${project.version}"
window-title="${project.fullname} v${project.version}"
left-frameset-width="256"
keep-xml="${build.fatswc}"
skip-xsl="false"
warnings="false"
strict="false"
failonerror="true"
fork="true"
>
<verbose-stacktraces>true</verbose-stacktraces>
<load-config filename="${FLEX_HOME}/frameworks/air-config.xml"/>
<doc-sources path-element="${basedir}/src"/>
<source-path path-element="${basedir}/src" />
<external-library-path dir="${FLEX_HOME}/frameworks/libs/air/" append="true">
<include name="airglobal.swc"/>
</external-library-path>
<external-library-path dir="${basedir}/lib-swc" append="true">
<include name="redtamarin.swc"/>
</external-library-path>
<exclude-sources path-element="${basedir}/src/${project.name}.as" />
<package-description-file>${basedir}/build/doc/package.description.xml</package-description-file>
</asdoc>
-->
<sequential if:true="${build.fatswc}">
<!-- update swc with asdoc xml -->
<zip destfile="${basedir}/bin-release/${project.name}.swc" update="true">
<zipfileset dir="${basedir}/docs/${project.name}/tempdita" prefix="docs">
<include name="*.xml" />
<include name="*.dita" />
<exclude name="ASDoc_Config.xml" />
<exclude name="overviews.xml" />
</zipfileset>
</zip>
</sequential>
<delete dir="${basedir}/docs/${project.name}/tempdita" />
</sequential>
</target>
<target name="compile-release">
<sequential unless:true="${build.nozip}">
<!-- generate documentation.zip -->
<zip destfile="${basedir}/bin-release/documentation.zip"
basedir="${basedir}/docs/${project.name}"
unless:true="${build.nodoc}" />
<!-- copy all files to deploy dir -->
<copy todir="${basedir}/bin-deploy">
<fileset dir="${basedir}">
<include name="*.txt" />
<include name="*.md" />
<include name="LICENSE" />
</fileset>
<fileset dir="${basedir}/bin-release">
<include name="*.swc" />
<include name="*.abc" />
</fileset>
<file file="${basedir}/bin-release/documentation.zip" unless:true="${build.nodoc}" />
</copy>
<!-- zip all files -->
<zip destfile="${basedir}/bin-deploy/${project.name}-${project.version}.zip"
basedir="${basedir}/bin-deploy" />
<!-- delete all files except the zip -->
<delete includeemptydirs="true">
<fileset dir="${basedir}/bin-deploy">
<include name="**/*"/>
<exclude name="${project.name}-${project.version}.zip"/>
</fileset>
</delete>
</sequential>
</target>
<target name="after">
</target>
</project>