-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
43 lines (39 loc) · 1.65 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
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="applets" name="HackerCard">
<!-- Applet building dependencies -->
<property name="JC222" value="ext/java_card_kit-2_2_2"/>
<property name="JC303" value="ext/java_card_kit-3_0_3"/>
<property name="OP20" value="ext/visa_openplatform-2_0"/>
<property name="GP211" value="ext/globalplatform-2_1_1"/>
<!-- ant-javacard task from javacard.pro -->
<taskdef name="javacard" classname="pro.javacard.ant.JavaCard" classpath="ext/ant-javacard.jar"/>
<macrodef name="applet">
<attribute name="class"/>
<attribute name="rid" default="FF4841434B"/> <!-- FF followed by HACK in hex-encoded ASCII -->
<attribute name="pix"/>
<attribute name="package"/>
<attribute name="capName" default="@{class}"/>
<sequential>
<echo level="info">
Building applet @{package}.@{class}
</echo>
<exec executable="sed" inputstring="${package}" outputproperty="packagepath">
<arg value="s/./\//g"/>
</exec>
<javacard jckit="${JC222}">
<cap output="bin/@{capName}.cap2" sources="src/${packagepath}">
<applet class="@{package}.@{class}" aid="@{rid}@{pix}"/>
</cap>
</javacard>
<javacard jckit="${JC303}">
<cap output="bin/@{capName}.cap3" sources="src/${packagepath}">
<applet class="@{package}.@{class}" aid="@{rid}@{pix}"/>
</cap>
</javacard>
</sequential>
</macrodef>
<target name="applets">
<applet package="andrewmontagne.hackercard" class="HackerCard" pix="000001"/>
<applet package="andrewmontagne.hackercard" class="Wallet" rid="F234123456" pix="100001"/>
</target>
</project>