-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.xml
348 lines (316 loc) · 15 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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
<?xml version="1.0" encoding="UTF-8"?>
<project name="openjavacard-libraries" default="build">
<description>OpenJavaCard Libraries</description>
<property name="ext.ant-javacard" value="ext/ant-javacard"/>
<property name="ext.jcardsim" value="ext/jcardsim"/>
<property name="sdk.jc222" value="ext/javacard-sdks/jc222_kit"/>
<property name="sdk.globalplatform" value="ext/globalplatform-exports"/>
<property name="jar.jcardsim" value="${ext.jcardsim}/jcardsim-2.2.2-all.jar"/>
<property name="version.lib.auth" value="0.0"/>
<property name="version.lib.ber" value="0.0"/>
<property name="version.lib.cbor" value="0.0"/>
<property name="version.lib.codec" value="0.0"/>
<property name="version.lib.ctlv" value="0.0"/>
<property name="version.lib.cvmpin" value="0.0"/>
<property name="version.lib.debug" value="0.0"/>
<property name="version.lib.fortuna" value="0.0"/>
<property name="version.lib.isofs" value="0.0"/>
<property name="version.lib.password" value="0.0"/>
<property name="version.lib.rsa" value="0.0"/>
<property name="version.lib.string" value="0.0"/>
<property name="version.app.demo" value="0.0"/>
<target name="clean" description="Delete build output">
<delete dir="build"/>
</target>
<target name="prepare" description="Prepare build environment">
<ant dir="${ext.ant-javacard}"/>
<mkdir dir="build/jar"/>
<mkdir dir="build/javacard"/>
<mkdir dir="build/classes"/>
</target>
<target name="build" description="Build everything" depends="prepare">
<antcall target="build-lib-auth"/>
<antcall target="build-lib-ber"/>
<antcall target="build-lib-ctlv"/>
<antcall target="build-lib-cvmpin"/>
<antcall target="build-lib-debug"/>
<antcall target="build-lib-fortuna"/>
<antcall target="build-lib-isofs"/>
<antcall target="build-lib-password"/>
<antcall target="build-lib-rsa"/>
<antcall target="build-lib-string"/>
<antcall target="build-app-demo"/>
</target>
<target name="test" description="Run tests" depends="build">
<antcall target="testonly"/>
</target>
<target name="testonly" description="Run tests without building">
<mkdir dir="build/tests/lib-ber"/>
<path id="classpath.tests">
<pathelement path="build/classes/lib-ber"/>
<pathelement location="/usr/share/java/junit4.jar"/>
<pathelement path="${jar.jcardsim}"/>
</path>
<javac srcdir="library-ber/src/test/java"
destdir="build/tests/lib-ber"
includeantruntime="false"
classpathref="classpath.tests"/>
<junit printSummary="no" fork="yes" failureproperty="junit.failure">
<classpath>
<pathelement path="build/tests/lib-ber"/>
<pathelement path="build/classes/lib-ber"/>
<pathelement location="/usr/share/java/junit4.jar"/>
<pathelement path="${jar.jcardsim}"/>
</classpath>
<formatter type="plain" />
<formatter type="plain" usefile="false" />
<batchtest todir="build/tests">
<fileset dir="library-ber/src/test/java" includes="**/*.java" />
</batchtest>
</junit>
<fail if="junit.failure" message="Unit test(s) failed. See reports!"/>
</target>
<target name="prebuilt" description="Update prebuilt files" depends="build">
<delete dir="prebuilt"/>
<copy todir="prebuilt">
<fileset dir="build/jar"/>
<fileset dir="build/javacard"/>
</copy>
</target>
<target name="ant-javacard">
<taskdef name="javacard"
classpath="${ext.ant-javacard}/ant-javacard.jar"
classname="pro.javacard.ant.JavaCard"/>
</target>
<target name="javadoc">
<javadoc packagenames="org.openjavacard.lib.*"
defaultexcludes="yes"
destdir="build/javadoc"
author="true"
version="true"
use="true"
windowtitle="OpenJavaCard Libraries API">
<doctitle><![CDATA[<h1>OpenJavaCard Libraries API</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 2018-2020 promovicz</i>]]></bottom>
<group title="BER-TLV processing">
<package name="org.openjavacard.lib.ber"/>
</group>
<group title="String processing">
<package name="org.openjavacard.lib.string"/>
</group>
<group title="Fortuna PRNG">
<package name="org.openjavacard.lib.fortuna"/>
</group>
<group title="RSA cipher extensions">
<package name="org.openjavacard.lib.rsa"/>
</group>
<group title="Debug library">
<package name="org.openjavacard.lib.debug"/>
</group>
<group title="Password functions">
<package name="org.openjavacard.lib.password"/>
</group>
<group title="ISO7816 file system">
<package name="org.openjavacard.lib.isofs"/>
</group>
<group title="Compact-TLV processing">
<package name="org.openjavacard.lib.ctlv"/>
</group>
<group title="CVM PIN wrapper">
<package name="org.openjavacard.lib.cvmpin"/>
</group>
<sourcepath>
<pathelement path="library-ber/src/main/java"/>
<pathelement path="library-ctlv/src/main/java"/>
<pathelement path="library-debug/src/main/java"/>
<pathelement path="library-fortuna/src/main/java"/>
<pathelement path="library-isofs/src/main/java"/>
<pathelement path="library-password/src/main/java"/>
<pathelement path="library-rsa/src/main/java"/>
<pathelement path="library-string/src/main/java"/>
<pathelement path="library-ctlv/src/main/java"/>
<pathelement path="library-cvmpin/src/main/java"/>
</sourcepath>
<classpath>
<pathelement path="${sdk.jc222}/lib/api.jar"/>
<pathelement path="${sdk.globalplatform}/org.globalplatform-1.7/gpapi-globalplatform.jar"/>
</classpath>
</javadoc>
</target>
<target name="build-lib-ber" depends="ant-javacard">
<javacard jckit="${sdk.jc222}">
<cap output="build/javacard/openjavacard-lib-ber-${version.lib.ber}.cap"
jar="build/javacard/openjavacard-lib-ber-${version.lib.ber}.jar"
classes="build/classes/lib-ber"
export="build/classes/lib-ber"
sources="library-ber/src/main/java"
aid="D276000177100310010001"
package="org.openjavacard.lib.ber"
version="${version.lib.ber}">
</cap>
</javacard>
</target>
<target name="build-lib-string" depends="ant-javacard">
<javacard jckit="${sdk.jc222}">
<cap output="build/javacard/openjavacard-lib-string-${version.lib.string}.cap"
jar="build/javacard/openjavacard-lib-string-${version.lib.string}.jar"
classes="build/classes/lib-string"
export="build/classes/lib-string"
sources="library-string/src/main/java"
aid="D276000177100310020001"
package="org.openjavacard.lib.string"
version="${version.lib.string}">
</cap>
</javacard>
</target>
<target name="build-lib-fortuna" depends="ant-javacard">
<javacard jckit="${sdk.jc222}">
<cap output="build/javacard/openjavacard-lib-fortuna-${version.lib.fortuna}.cap"
jar="build/javacard/openjavacard-lib-fortuna-${version.lib.fortuna}.jar"
classes="build/classes/lib-fortuna"
export="build/classes/lib-fortuna"
sources="library-fortuna/src/main/java"
aid="D276000177100310030001"
package="org.openjavacard.lib.fortuna"
version="${version.lib.fortuna}">
</cap>
</javacard>
</target>
<target name="build-lib-rsa" depends="ant-javacard">
<javacard jckit="${sdk.jc222}">
<cap output="build/javacard/openjavacard-lib-rsa-${version.lib.rsa}.cap"
jar="build/javacard/openjavacard-lib-rsa-${version.lib.rsa}.jar"
classes="build/classes/lib-rsa"
export="build/classes/lib-rsa"
sources="library-rsa/src/main/java"
aid="D276000177100310040001"
package="org.openjavacard.lib.rsa"
version="${version.lib.rsa}">
</cap>
</javacard>
</target>
<target name="build-lib-debug" depends="ant-javacard">
<javacard jckit="${sdk.jc222}">
<cap output="build/javacard/openjavacard-lib-debug-${version.lib.debug}.cap"
jar="build/javacard/openjavacard-lib-debug-${version.lib.debug}.jar"
classes="build/classes/lib-debug"
export="build/classes/lib-debug"
sources="library-debug/src/main/java"
aid="D276000177100310050001"
package="org.openjavacard.lib.debug"
version="${version.lib.debug}">
</cap>
</javacard>
</target>
<target name="build-lib-auth" depends="ant-javacard">
<javacard jckit="${sdk.jc222}">
<cap output="build/javacard/openjavacard-lib-auth-${version.lib.auth}.cap"
jar="build/javacard/openjavacard-lib-auth-${version.lib.auth}.jar"
classes="build/classes/lib-auth"
export="build/classes/lib-auth"
sources="library-auth/src/main/java"
aid="D276000177100310060001"
package="org.openjavacard.lib.auth"
version="${version.lib.auth}">
</cap>
</javacard>
</target>
<target name="build-lib-password" depends="ant-javacard">
<javacard jckit="${sdk.jc222}">
<cap output="build/javacard/openjavacard-lib-password-${version.lib.password}.cap"
jar="build/javacard/openjavacard-lib-password-${version.lib.password}.jar"
classes="build/classes/lib-password"
export="build/classes/lib-password"
sources="library-password/src/main/java"
aid="D276000177100310070001"
package="org.openjavacard.lib.password"
version="${version.lib.password}">
</cap>
</javacard>
</target>
<target name="build-lib-cbor" depends="ant-javacard">
<javacard jckit="${sdk.jc222}">
<cap output="build/javacard/openjavacard-lib-cbor-${version.lib.cbor}.cap"
jar="build/javacard/openjavacard-lib-cbor-${version.lib.cbor}.jar"
classes="build/classes/lib-cbor"
export="build/classes/lib-cbor"
sources="library-cbor/src/main/java"
aid="D276000177100310080001"
package="org.openjavacard.lib.cbor"
version="${version.lib.cbor}">
<import jar="build/classes/lib-cbor"
exps="build/classes/lib-cbor"/>
</cap>
</javacard>
</target>
<target name="build-lib-isofs" depends="ant-javacard">
<javacard jckit="${sdk.jc222}">
<cap output="build/javacard/openjavacard-lib-isofs-${version.lib.isofs}.cap"
jar="build/javacard/openjavacard-lib-isofs-${version.lib.isofs}.jar"
classes="build/classes/lib-isofs"
export="build/classes/lib-isofs"
sources="library-isofs/src/main/java"
aid="D276000177100310090001"
package="org.openjavacard.lib.isofs"
version="${version.lib.isofs}">
<import jar="build/classes/lib-ber"
exps="build/classes/lib-ber"/>
</cap>
</javacard>
</target>
<target name="build-lib-ctlv" depends="ant-javacard">
<javacard jckit="${sdk.jc222}">
<cap output="build/javacard/openjavacard-lib-ctlv-${version.lib.ctlv}.cap"
jar="build/javacard/openjavacard-lib-ctlv-${version.lib.ctlv}.jar"
classes="build/classes/lib-ctlv"
export="build/classes/lib-ctlv"
sources="library-ctlv/src/main/java"
aid="D2760001771003100A0001"
package="org.openjavacard.lib.ctlv"
version="${version.lib.ctlv}">
</cap>
</javacard>
</target>
<target name="build-lib-cvmpin" depends="ant-javacard">
<javacard jckit="${sdk.jc222}">
<cap output="build/javacard/openjavacard-lib-cvmpin-${version.lib.cvmpin}.cap"
jar="build/javacard/openjavacard-lib-cvmpin-${version.lib.cvmpin}.jar"
classes="build/classes/lib-cvmpin"
export="build/classes/lib-cvmpin"
sources="library-cvmpin/src/main/java"
aid="D2760001771003100B0001"
package="org.openjavacard.lib.cvmpin"
version="${version.lib.cvmpin}">
<import jar="${sdk.globalplatform}/org.globalplatform-1.1/gpapi-globalplatform.jar"
exps="${sdk.globalplatform}/org.globalplatform-1.1/exports"/>
</cap>
</javacard>
</target>
<target name="build-app-demo" depends="ant-javacard">
<javacard jckit="${sdk.jc222}">
<cap output="build/javacard/openjavacard-app-demo-${version.app.demo}.cap"
jar="build/javacard/openjavacard-app-demo-${version.app.demo}.jar"
classes="build/classes/app-demo"
export="build/classes/app-demo"
sources="applet-demo/src/main/java"
aid="D276000177100210010001"
package="org.openjavacard.app.demo"
version="${version.app.demo}">
<import jar="build/classes/lib-ber"
exps="build/classes/lib-ber"/>
<import jar="build/classes/lib-string"
exps="build/classes/lib-string"/>
<import jar="build/classes/lib-fortuna"
exps="build/classes/lib-fortuna"/>
<import jar="build/classes/lib-password"
exps="build/classes/lib-password"/>
<import jar="build/classes/lib-ctlv"
exps="build/classes/lib-ctlv"/>
<import jar="build/classes/lib-debug"
exps="build/classes/lib-debug"/>
<applet aid="D27600017710021001000101"
class="org.openjavacard.app.demo.DemoApplet"/>
</cap>
</javacard>
</target>
</project>