forked from OpenJavaCard/openjavacard-ndef
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
239 lines (223 loc) · 8.85 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="javacard-ndef"
default="build"
basedir=".">
<description>JavaCard implementation of an NDEF Type 4 tag</description>
<!-- Point this to your JavaCard kit -->
<property name="jckit" value="ext/javacard-sdks/jc222_kit"/>
<!-- Point this to your Proguard kit -->
<property name="proguard" value="/opt/proguard"/>
<!-- Cleanup target -->
<target name="clean"
description="clean up">
<delete dir="build"/>
</target>
<!-- Build-all target -->
<target name="build"
description="build everything"
depends="build-full-plain,build-tiny-plain,build-stub-plain">
</target>
<!-- Dummy test target -->
<target name="test"/>
<!-- Target for updating in-repository prebuilt files -->
<target name="prebuilt"
description="update prebuilt files"
depends="build">
<delete dir="prebuilt"/>
<copy todir="prebuilt">
<fileset dir="build/javacard"/>
</copy>
</target>
<!-- Ant extension for JavaCard -->
<target name="ext-javacard">
<ant dir="ext/ant-javacard"/>
<taskdef name="javacard"
classpath="ext/ant-javacard/ant-javacard.jar"
classname="pro.javacard.ant.JavaCard"/>
</target>
<!-- Ant extensions for Proguard -->
<target name="ext-proguard">
<taskdef classpath="${proguard}/lib/proguard.jar"
resource="proguard/ant/task.properties"/>
</target>
<!-- Create directories for build output -->
<target name="build-dirs">
<mkdir dir="build/jar"/>
<mkdir dir="build/javacard"/>
<mkdir dir="build/classes"/>
<mkdir dir="build/classes/client"/>
<mkdir dir="build/classes/full-plain"/>
<mkdir dir="build/classes/full-proguard"/>
<mkdir dir="build/classes/stub-plain"/>
<mkdir dir="build/classes/stub-proguard"/>
<mkdir dir="build/classes/tiny-plain"/>
<mkdir dir="build/classes/tiny-proguard"/>
</target>
<target name="build-full-plain"
depends="ext-javacard,build-dirs">
<!-- Compile code -->
<javac srcdir="applet-full/src/main/java"
destdir="build/classes/full-plain"
classpath="${jckit}/lib/api.jar"
includeantruntime="false"
source="1.5" target="1.5">
<compilerarg value="-Xlint"/>
<compilerarg value="-Xlint:-options"/>
<compilerarg value="-Xlint:-serial"/>
</javac>
<!-- Plain CAP file -->
<javacard jckit="${jckit}">
<cap output="build/javacard/openjavacard-ndef-full-plain.cap"
jar="build/javacard/openjavacard-ndef-full-plain.jar"
classes="build/classes/full-plain"
aid="D276000177100211010001"
version="0.0">
<applet aid="D27600017710021101000101"
class="org.openjavacard.ndef.full.NdefApplet"/>
</cap>
</javacard>
</target>
<target name="build-full-proguard"
depends="ext-javacard,ext-proguard,build-full-plain">
<!-- Run the class files through proguard -->
<proguard>
-verbose
-printseeds
-printusage
-ignorewarnings
-applymapping proguard-full.map
-injars build/classes/full-plain
-outjars build/classes/full-proguard
-printmapping build/javacard/openjavacard-ndef-full-proguard.map
-libraryjars ${jckit}/lib/api.jar
-dontwarn java.lang.Class
-allowaccessmodification
-keep public class * implements javacard.framework.Applet {
public static void install(byte[], short, byte);
}
</proguard>
<!-- Obfuscated CAP file -->
<javacard jckit="${jckit}">
<cap output="build/javacard/openjavacard-ndef-full-proguard.cap"
jar="build/javacard/openjavacard-ndef-full-proguard.jar"
classes="build/classes/full-proguard"
aid="D276000177100211110001"
version="0.0">
<applet aid="D27600017710021111000101"
class="full.A"/>
</cap>
</javacard>
</target>
<target name="build-stub-plain"
depends="ext-javacard,build-dirs">
<!-- Compile code -->
<javac srcdir="applet-stub/src/main/java"
destdir="build/classes/stub-plain"
classpath="${jckit}/lib/api.jar"
includeantruntime="false"
source="1.5" target="1.5">
<compilerarg value="-Xlint"/>
<compilerarg value="-Xlint:-options"/>
<compilerarg value="-Xlint:-serial"/>
</javac>
<!-- Plain CAP file -->
<javacard jckit="${jckit}">
<cap output="build/javacard/openjavacard-ndef-stub-plain.cap"
jar="build/javacard/openjavacard-ndef-stub-plain.jar"
classes="build/classes/stub-plain"
aid="D276000177100211020001"
version="0.0">
<applet aid="D27600017710021102000101"
class="org.openjavacard.ndef.stub.NdefApplet"/>
</cap>
</javacard>
</target>
<target name="build-stub-proguard"
depends="ext-javacard,ext-proguard,build-stub-plain">
<!-- Run the class files through proguard -->
<proguard>
-verbose
-printseeds
-printusage
-ignorewarnings
-injars build/classes/stub-plain
-outjars build/classes/stub-proguard
-printmapping build/javacard/openjavacard-ndef-stub-proguard.map
-libraryjars ${jckit}/lib/api.jar
-dontwarn java.lang.Class
-allowaccessmodification
-keep public class * {
public *;
}
-keep public interface * {
public *;
}
</proguard>
<!-- Obfuscated CAP file -->
<javacard jckit="${jckit}">
<cap output="build/javacard/openjavacard-ndef-stub-proguard.cap"
jar="build/javacard/openjavacard-ndef-stub-proguard.jar"
classes="build/classes/stub-proguard"
aid="D276000177100211120001"
version="0.0">
<applet aid="D27600017710021112000101"
class="org.openjavacard.ndef.stub.NdefApplet"/>
</cap>
</javacard>
</target>
<target name="build-tiny-plain"
depends="ext-javacard,build-dirs">
<!-- Compile code -->
<javac srcdir="applet-tiny/src/main/java"
destdir="build/classes/tiny-plain"
classpath="${jckit}/lib/api.jar"
includeantruntime="false"
source="1.5" target="1.5">
<compilerarg value="-Xlint"/>
<compilerarg value="-Xlint:-options"/>
<compilerarg value="-Xlint:-serial"/>
</javac>
<!-- Plain CAP file -->
<javacard jckit="${jckit}">
<cap output="build/javacard/openjavacard-ndef-tiny-plain.cap"
jar="build/javacard/openjavacard-ndef-tiny-plain.jar"
classes="build/classes/tiny-plain"
aid="D276000177100211030001"
version="0.0">
<applet aid="D27600017710021103000101"
class="org.openjavacard.ndef.tiny.NdefApplet"/>
</cap>
</javacard>
</target>
<target name="build-tiny-proguard"
depends="ext-javacard,ext-proguard,build-tiny-plain">
<!-- Run the class files through proguard -->
<proguard>
-verbose
-printseeds
-printusage
-ignorewarnings
-applymapping proguard-tiny.map
-injars build/classes/tiny-plain
-outjars build/classes/tiny-proguard
-printmapping build/javacard/openjavacard-ndef-tiny-proguard.map
-libraryjars ${jckit}/lib/api.jar
-dontwarn java.lang.Class
-allowaccessmodification
-keep public class * implements javacard.framework.Applet {
public static void install(byte[], short, byte);
}
</proguard>
<!-- Obfuscated CAP file -->
<javacard jckit="${jckit}">
<cap output="build/javacard/openjavacard-ndef-tiny-proguard.cap"
jar="build/javacard/openjavacard-ndef-tiny-proguard.jar"
classes="build/classes/tiny-proguard"
aid="D276000177100211130001"
version="0.0">
<applet aid="D27600017710021113000101"
class="tiny.A"/>
</cap>
</javacard>
</target>
</project>