-
Notifications
You must be signed in to change notification settings - Fork 26
/
build.xml
190 lines (148 loc) · 6.28 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="blooddy_crypto" default="compile">
<property file="build.properties" />
<property name="src" value="${basedir}/src" />
<property name="output" value="${basedir}/bin" />
<property name="swc" value="${output}/blooddy_crypto.swc" />
<property name="AIR_SDK_HOME" value="${flex.sdk}" />
<property name="FLEX_HOME" value="${flex.sdk}" />
<taskdef resource="flexTasks.tasks" classpath="${flex.sdk}/ant/lib/flexTasks.jar" />
<filelist id="workers.files" dir="${src}">
<file name="by/blooddy/crypto/Adler32.swf" />
<file name="by/blooddy/crypto/Base64.swf" />
<file name="by/blooddy/crypto/CRC32.swf" />
<file name="by/blooddy/crypto/MD5.swf" />
<file name="by/blooddy/crypto/SHA1.swf" />
<file name="by/blooddy/crypto/SHA2.swf" />
<file name="by/blooddy/crypto/serialization/JSONer.swf" />
<file name="by/blooddy/crypto/image/JPEGEncoder.swf" />
<file name="by/blooddy/crypto/image/PNGEncoder.swf" />
</filelist>
<target name="workers.delete">
<delete>
<filelist refid="workers.files" />
</delete>
</target>
<target name="worker.compile">
<mxmlc failonerror="true"
file="${src}/by/blooddy/crypto/process/Worker$Background.as"
output="${src}/${worker.path}/${worker.name}.swf"
swf-version="17"
>
<load-config filename="${flex.sdk}/frameworks/air-config.xml" />
<load-config filename="${basedir}/build.config.xml" />
<load-config filename="${basedir}/build.config.worker.xml" />
<source-path path-element="${src}" />
<includes symbol="${worker.package}.${worker.name}" />
<externs symbol="by.blooddy.crypto.process.Process$Concurrent" />
<externs symbol="by.blooddy.crypto.process.Worker$" />
</mxmlc>
</target>
<target name="workers.compile" depends="workers.delete">
<parallel failonany="true"><!-- сперва зависимые друг от друга -->
<antcall target="worker.compile">
<param name="worker.path" value="by/blooddy/crypto/image" />
<param name="worker.package" value="by.blooddy.crypto.image" />
<param name="worker.name" value="PNGEncoder" />
</antcall>
</parallel>
<parallel failonany="true">
<antcall target="worker.compile">
<param name="worker.path" value="by/blooddy/crypto/serialization" />
<param name="worker.package" value="by.blooddy.crypto.serialization" />
<param name="worker.name" value="JSONer" />
</antcall>
<antcall target="worker.compile">
<param name="worker.path" value="by/blooddy/crypto/image" />
<param name="worker.package" value="by.blooddy.crypto.image" />
<param name="worker.name" value="JPEGEncoder" />
</antcall>
<antcall target="worker.compile">
<param name="worker.path" value="by/blooddy/crypto" />
<param name="worker.package" value="by.blooddy.crypto" />
<param name="worker.name" value="Adler32" />
</antcall>
<antcall target="worker.compile">
<param name="worker.path" value="by/blooddy/crypto" />
<param name="worker.package" value="by.blooddy.crypto" />
<param name="worker.name" value="Base64" />
</antcall>
<antcall target="worker.compile">
<param name="worker.path" value="by/blooddy/crypto" />
<param name="worker.package" value="by.blooddy.crypto" />
<param name="worker.name" value="CRC32" />
</antcall>
<antcall target="worker.compile">
<param name="worker.path" value="by/blooddy/crypto" />
<param name="worker.package" value="by.blooddy.crypto" />
<param name="worker.name" value="MD5" />
</antcall>
<antcall target="worker.compile">
<param name="worker.path" value="by/blooddy/crypto" />
<param name="worker.package" value="by.blooddy.crypto" />
<param name="worker.name" value="SHA1" />
</antcall>
<antcall target="worker.compile">
<param name="worker.path" value="by/blooddy/crypto" />
<param name="worker.package" value="by.blooddy.crypto" />
<param name="worker.name" value="SHA2" />
</antcall>
</parallel>
</target>
<target name="workers.touch" depends="workers.delete">
<touch millis="0">
<filelist refid="workers.files" />
</touch>
</target>
<target name="library.compile" depends="workers.compile">
<compc failonerror="true"
output="${swc}"
swf-version="10"
include-classes="by.blooddy.crypto.Adler32 by.blooddy.crypto.Base64 by.blooddy.crypto.CRC32 by.blooddy.crypto.MD5 by.blooddy.crypto.SHA1 by.blooddy.crypto.SHA2 by.blooddy.crypto.serialization.JSON by.blooddy.crypto.serialization.JSONer by.blooddy.crypto.image.PNGEncoder by.blooddy.crypto.image.JPEGEncoder"
>
<load-config filename="${flex.sdk}/frameworks/air-config.xml" />
<load-config filename="${basedir}/build.config.xml" />
<source-path path-element="${src}" />
</compc>
</target>
<target name="library.release" depends="library.compile">
<unzip src="${swc}" dest="${output}" />
<replaceregexp file="${output}/catalog.xml" match="\x3Cscript\s[^\x3E]*?name=\x22\x22.+?\x3C\/script\x3E" flags="sg" replace="" byline="false" />
<replaceregexp file="${output}/catalog.xml" match="\x3Cdep\s[^\x3E]*?id=\x22(?!by\.|[^\x22]*?\$|avmplus\:DescribeType)[^\x22]*?\x22[^\x3E]*?\/\x3E" flags="sg" replace="" byline="false" />
<replaceregexp file="${output}/catalog.xml" match="(\x3C[^\x3E]*?\x3E)\s+" flags="sg" replace="\1" byline="false" />
<zip destfile="${swc}">
<filelist dir="${output}">
<file name="catalog.xml" />
<file name="library.swf" />
</filelist>
</zip>
<delete>
<filelist dir="${output}">
<file name="catalog.xml" />
<file name="library.swf" />
</filelist>
</delete>
</target>
<target name="compile.debug" description="Compile Debug Project">
<antcall target="library.compile" />
<antcall target="workers.touch" />
</target>
<target name="compile.release" description="Compile Release Project">
<antcall target="library.release" />
<antcall target="workers.touch" />
</target>
<target name="build.release" description="Compile Release Project">
<antcall target="compile.release" />
<zip destfile="${output}/blooddy_crypto_v0.0.0.zip">
<filelist dir="${output}">
<file name="blooddy_crypto.swc" />
</filelist>
<filelist dir="${basedir}">
<file name="LICENSE.md" />
</filelist>
</zip>
</target>
<target name="compile" description="Compile Project">
<antcall target="build.release" />
</target>
</project>