-
Notifications
You must be signed in to change notification settings - Fork 1
/
midp.xml
284 lines (241 loc) · 9.5 KB
/
midp.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
281
282
283
284
<!DOCTYPE project [
<!ENTITY Common SYSTEM "common.xml">
%Common;
]>
<!--
Bouncy Castle Build Configuration (midp)
This is the J2ME specific build file. It's been removed
from the bouncy.xml to make it easier to manage.
$RCSfile: midp.xml,v $
$Author: bouncy $
$Date: 2012-12-07 07:24:41 $
$Revision: 1.12 $
-->
<project name="midp" default="init" basedir=".">
<property environment="env" />
<property file="${user.home}/crypto_env.properties" />
<property file="./crypto_env.properties" />
<!-- Public callable targets -->
<target name="clean" depends="local-clean" />
<target name="test" depends="local-test" />
<target name="dist" depends="common-dist" />
<target name="package" depends="local-package" />
<target name="compile" depends="local-compile" />
<target name="jdoc" depends="common-jdoc" />
<!-- include common targets, properties -->
<property name="is.lw" value="true" />
<property name="master.jdk" value="j2me" />
&Common;
<!-- ** Private properties -->
<property name="midp.root" value="${user.j2me.home}" />
<property name="midp.classes" value="${midp.root}/lib/midp_2.1.jar" />
<property name="cldc.classes" value="${midp.root}/lib/cldc_1.1.jar" />
<property name="midp.preverify" value="preverify" />
<property name="midp.emulator" value="emulator" />
<property name="app.name" value="midp_test" />
<property name="app.dir"
location="./j2me/org/bouncycastle/crypto/examples/" />
<property name="app.jad" value="${app.name}.jad" />
<property name="app.mf" value="${app.name}.mf" />
<property name="app.jar" value="${app.name}.jar" />
<property name="master.verify" value="${master.home}/verify" />
<property name="zipdir" value="${master.lw-release}/zips" />
<property name="j2me.src" value="${master.home}/j2me" />
<!-- Copy all the files to this directory in the right order -->
<property name="build.root" value="${master.dist}" />
<property name="build.src" value="${build.root}/src" />
<property name="test.src" value="${basedir}/test/src" />
<path id="compile.cp">
<pathelement location="${master.classes}" />
<pathelement location="${midp.classes}" />
<pathelement location="${cldc.classes}" />
</path>
<property name="midp.classpath" refid="compile.cp" />
<!-- *** Private Targets *** -->
<!-- compile -->
<patternset id="j2me.java-compatibility" >
<include name="java/**/*.java" />
<exclude name="java/**/*Test.java" />
</patternset>
<target name="local-clean" >
<antcall target="common-clean" />
<delete dir="${master.verify}" />
</target>
<!-- override the standard lw-compile due to the extra midp reqs -->
<target name="local-compile" depends="init" if="is.lw" >
<echo message="Checking environment" />
<whichresource class="org.bouncycastle.crypto.BlockCipher"
property="foundBC" />
<fail if="foundBC"
message="BouncyCastle on the classpath. Check $JAVA_HOME/lib/ext" />
<echo message="Doing special javac for the java.lang.* classes" />
<javac srcdir="${j2me.src}:${master.src}"
destdir="${master.classes}"
bootclasspath="${midp.classes}"
includeAntRuntime="no"
includeJavaRuntime="no"
debug="off"
optimize="off">
<patternset refid="j2me.java-compatibility" />
<classpath refid = "compile.cp" />
</javac>
<echo message="Copying main crypto files" />
<copy todir="${build.src}">
<fileset dir="${master.src}" >
<include name="**/asn1/**/*.java" />
<include name="**/crypto/**/*.java" />
<include name="**/cert/*.java" />
<include name="**/cert/crmf/*.java" />
<include name="**/cert/selector/*.java" />
<include name="**/cms/**/*.java" />
<include name="**/operator/**/*.java" />
<include name="**/math/**/*.java" />
<include name="**/util/encoders/*.java" />
<include name="**/util/test/*.java" />
<include name="**/util/*.java" />
<include name="**/util/io/StreamOverflowException.java" />
<include name="**/util/io/Tee*.java" />
<include name="**/util/io/Streams.java" />
<include name="**/encoders/*.java" />
<exclude name="**/math/ntru/**/*.java" />
<exclude name="**/math/ntru/*.java" />
<exclude name="**/crypto/**/*NTRU*.java" />
<exclude name="**/crypto/engines/IndexGenerator.java" />
<exclude name="**/crypto/examples/*.java" />
<exclude name="**/jcajce/**/*.java" />
<exclude name="**/bcpg/*.java" />
<exclude name="**/openpgp/*.java" />
<exclude name="**/cms/CMSAuthenticated*.java" />
<exclude name="**/cms/CMSCompressed*.java" />
<exclude name="**/cms/CMSProcessableFile.java" />
<exclude name="**/cms/*PBE*.java" />
<exclude name="**/util/Dump.java" />
<exclude name="**/smime/util/*.java" />
<exclude name="**/x509/util/Stream*.java" />
<exclude name="**/x509/X509Stream*.java" />
</fileset>
</copy>
<echo message="Copying test files" />
<copy todir="${build.src}">
<fileset dir="${test.src}" >
<include name="**/asn1/**/*.java" />
<include name="**/crypto/**/*.java" />
<include name="**/math/**/*.java" />
<exclude name="**/jcajce/**/*.java" />
<exclude name="**/bcpg/*.java" />
<exclude name="**/openpgp/*.java" />
<exclude name="**/AllTests.java" />
<exclude name="**/tls/test/*.java" />
<exclude name="**/asn1/test/*.java" />
<exclude name="**/crypto/engines/test/*.java" />
<exclude name="**/*NTRU*.java" />
<exclude name="**/ntru/**/*.java" />
<exclude name="**/crypto/test/AESVectorFileTest.java" />
<exclude name="**/crypto/test/EAXTest.java" />
<exclude name="**/crypto/test/GCMReorderTest.java" />
<exclude name="**/crypto/test/HCFamilyVecTest.java" />
<exclude name="**/crypto/test/RSABlindedTest.java" />
<exclude name="**/crypto/test/SCryptTest.java" />
<exclude name="**/util/encoders/test/*.java" />
<exclude name="**/math/ec/test/*.java" />
</fileset>
</copy>
<echo message="Copying j2me files" />
<copy todir="${build.src}" overwrite="true" verbose="false" >
<fileset dir="${j2me.src}" >
<include name="org/**/*.java" />
<exclude name="CVS" />
<exclude name="**/crypto/examples/*.java" />
</fileset>
</copy>
<echo message="Compiling main crypto" />
<javac srcdir="${build.src}"
destdir="${master.classes}"
bootclasspath="${midp.classes}"
includeAntRuntime="no"
includeJavaRuntime="no"
debug="off"
optimize="off">
<classpath refid = "compile.cp" />
</javac>
<antcall target="preverify" />
</target>
<target name="preverify">
<exec executable="${midp.root}/bin/${midp.preverify}"
failonerror="true" >
<arg line="-d ${master.verify} -classpath ${midp.classes} ${master.classes}" />
</exec>
</target>
<target name="local-package">
<antcall target="clean" />
<antcall target="compile" />
<antcall target="zipmaker" />
<antcall target="dist" />
</target>
<target name="zipmaker" >
<mkdir dir="${zipdir}" />
<zip destfile="${zipdir}/cldc_classes.zip"
basedir="${master.verify}"
excludes="**/test/**" />
<zip destfile="${zipdir}/cldc_crypto.zip"
basedir="${master.verify}"
excludes="**/asn1/**, **/test/**" />
<zip destfile="${zipdir}/cldc_sources.zip">
<fileset dir="${build.src}" />
<fileset dir="${j2me.src}" />
</zip>
</target>
<target name="example-jar" >
<jar
compress="true"
jarfile="${app.jar}"
manifest="${app.dir}/${app.mf}"
basedir="${master.verify}">
</jar>
</target>
<target name="blowfish">
<java classname="org.bouncycastle.crypto.test.BlowfishTest"
fork="yes">
<classpath refid="compile.cp" />
</java>
</target>
<target name="rsa">
<java classname="org.bouncycastle.crypto.test.RSATest"
newenvironment="true"
fork="yes">
<classpath refid="compile.cp" />
</java>
</target>
<target name="example" depends="example-jar" >
<copy file ="${app.dir}/${app.jad}" todir="." />
<exec
executable="${midp.root}/bin/${midp.emulator}"
failonerror="true" >
<arg line="-Xdescriptor:${app.jad}" />
</exec>
<!--
<delete file="${app.name}.jad" />
<delete file="${app.jar}" />
-->
</target>
<target name="local-test">
<antcall target="zipmaker" />
<echo message="Doing classpath based regression tests (crypto)" />
<java classname="org.bouncycastle.crypto.test.RegressionTest"
fork="yes">
<classpath refid="compile.cp" />
</java>
<echo message="Doing classpath based regression tests (asn1)" />
<java classname="org.bouncycastle.asn1.test.RegressionTest"
fork="yes">
<classpath refid="compile.cp" />
</java>
</target>
<target name="biginteger-test" >
<!-- uses the current classes -->
<java classname="org.bouncycastle.crypto.test.BigIntegerTest"
fork="yes" >
<classpath refid="compile.cp" />
</java>
</target>
</project>