-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
87 lines (74 loc) · 3.9 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
<?xml version="1.0" encoding="UTF-8" ?>
<project default="convert" name="javacard-starter">
<!-- Build specific properties -->
<property name="target.classes" location="${basedir}/target/classes" />
<property name="target.javacard" location="${basedir}/target/javacard" />
<property name="source.java" location="${basedir}/src/main/java" />
<!-- Must point to the folder containing the JAR files from the JCDK -->
<property name="javacard.libs" location="${basedir}/lib" />
<!-- Must point to the folder containing the JAR file from the JCDK ant task -->
<property name="javacard.ant-task" location="${basedir}/lib" />
<!-- Must point to the folder containing the API export files from the JCDK -->
<property name="javacard.export" location="${basedir}/src/main/export" />
<property name="verbose" value="true" />
<property name="noverify" value="false" />
<!-- Path for JC tasks -->
<path id="classpath">
<fileset dir="${javacard.ant-task}">
<include name="*.jar" />
</fileset>
<fileset dir="${javacard.libs}">
<include name="*.jar" />
</fileset>
</path>
<!-- set the export path to the Java Card export files -->
<path id="export" description="set the export file path">
<fileset dir="${javacard.export}">
<include name="**/*.exp" />
</fileset>
<pathelement path="${javacard.export}" />
<pathelement path="${target.classes}" />
<pathelement path="${target.javacard}" />
</path>
<!-- Definitions for tasks for Java Card tools -->
<taskdef name="capgen" classname="com.sun.javacard.ant.tasks.CapgenTask" classpathref="classpath" />
<taskdef name="deploycap" classname="com.sun.javacard.ant.tasks.DeployCapTask" classpathref="classpath" />
<taskdef name="convert" classname="com.sun.javacard.ant.tasks.ConverterTask" classpathref="classpath" />
<taskdef name="verifyexport" classname="com.sun.javacard.ant.tasks.VerifyExpTask" classpathref="classpath" />
<taskdef name="verifycap" classname="com.sun.javacard.ant.tasks.VerifyCapTask" classpathref="classpath" />
<taskdef name="verifyrevision" classname="com.sun.javacard.ant.tasks.VerifyRevTask" classpathref="classpath" />
<typedef name="appletnameaid" classname="com.sun.javacard.ant.types.AppletNameAID" classpathref="classpath" />
<typedef name="jcainputfile" classname="com.sun.javacard.ant.types.JCAInputFile" classpathref="classpath" />
<target name="init">
<mkdir dir="${target.classes}" />
<mkdir dir="${target.javacard}" />
</target>
<target name="clean">
<delete dir="${target.classes}" />
<delete dir="${target.javacard}" />
<delete dir="${javacard.eeprom}" />
</target>
<target name="compile" depends="init" description="Compile source code to class files">
<!-- Compile the java code from ${src} to ${classes} -->
<javac debug="yes" optimize="no" srcdir="${source.java}" destdir="${target.classes}" source="1.5" target="1.5">
<classpath refid="classpath" />
</javac>
</target>
<target name="convert" depends="compile" description="Convert class files to cap files">
<convert packagename="chaining" packageaid="0xF0:0x00:0x00:0x01:0x00:0x01" majorminorversion="1.0" classdir="${target.classes}" outputdirectory="${target.classes}" jca="true" exp="true" cap="true" debug="true" verbose="${verbose}" noverify="${noverify}">
<appletnameaid aid="0xF0:0x00:0x00:0x01:0x00:0x01:0x00:0x01" appletname="chaining.ChainingApplet" />
<exportpath refid="export" />
<classpath refid="classpath" />
</convert>
</target>
<target name="copy-debug">
<mkdir dir="${target.debug}" />
<echo>Copying cap files</echo>
<copy flatten="true" todir="${target.debug}" verbose="true">
<fileset dir="${target.classes}" includes="**/*.cap" />
<fileset dir="${target.classes}" includes="**/*.exp" />
<fileset dir="${target.classes}" includes="**/*.jca" />
</copy>
</target>
<target name="all" depends="clean, convert" />
</project>