-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.xml
98 lines (85 loc) · 4.13 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
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:jacoco="antlib:org.jacoco.ant" basedir="." default="applet" name="Cryptonit Applet">
<mkdir dir="lib"/>
<get src="https://github.com/martinpaljak/ant-javacard/releases/download/v20.01.15/ant-javacard.jar" dest="lib" skipexisting="true" />
<get src="https://github.com/licel/jcardsim/raw/master/jcardsim-3.0.4-SNAPSHOT.jar" dest="lib" skipexisting="true" />
<get src="https://repo1.maven.org/maven2/org/bouncycastle/bcpkix-jdk15on/1.56/bcpkix-jdk15on-1.56.jar" dest="lib" skipexisting="true" />
<get src="https://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk15on/1.56/bcprov-jdk15on-1.56.jar" dest="lib" skipexisting="true" />
<get src="https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar" dest="lib" skipexisting="true" />
<get src="https://repo1.maven.org/maven2/junit/junit/4.12/junit-4.12.jar" dest="lib" skipexisting="true" />
<get src="https://repo1.maven.org/maven2/org/jacoco/org.jacoco.ant/0.8.5/org.jacoco.ant-0.8.5-nodeps.jar" dest="lib" skipexisting="true" />
<taskdef name="javacard" classname="pro.javacard.ant.JavaCard" classpath="lib/ant-javacard.jar"/>
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="lib/org.jacoco.ant-0.8.5-nodeps.jar"/>
<property name="jc.sdk" value="jc305u3_kit"/>
<target name="applet">
<javacard jckit="sdks/${jc.sdk}">
<cap output="Cryptonit.cap" sources="src/org/cryptonit" classes="classes" javaversion="1.7">
<applet class="org.cryptonit.CryptonitApplet" aid="A0:00:00:03:08:00:00:10:00"/>
</cap>
</javacard>
</target>
<property name="main.build.dir" value="build/main"/>
<property name="main.src.dir" value="src"/>
<property name="test.build.dir" value="build/test"/>
<property name="test.src.dir" value="test"/>
<property name="jacoco.dir" location="./jacoco"/>
<property name="jacoco.report.dir" location="${jacoco.dir}"/>
<property name="jacoco.exec.file" location="${jacoco.dir}/jacoco.exec"/>
<property name="ant.build.javac.source" value="1.7"/>
<property name="ant.build.javac.target" value="1.7"/>
<path id="classpath.main">
<pathelement location="lib/jcardsim-3.0.4-SNAPSHOT.jar"/>
</path>
<path id="classpath.test">
<pathelement location="lib/junit-4.12.jar"/>
<pathelement location="lib/hamcrest-core-1.3.jar"/>
<pathelement location="lib/bcpkix-jdk15on-1.56.jar"/>
<pathelement location="lib/bcprov-jdk15on-1.56.jar"/>
<pathelement location="lib/jcardsim-3.0.4-SNAPSHOT.jar"/>
<pathelement location="${main.build.dir}"/>
</path>
<target name="compile">
<mkdir dir="${main.build.dir}"/>
<javac srcdir="${main.src.dir}" destdir="${main.build.dir}" debug="true" includeantruntime="false">
<classpath refid="classpath.main"/>
</javac>
</target>
<target name="test-compile" depends="compile">
<mkdir dir="${test.build.dir}"/>
<javac srcdir="${test.src.dir}" destdir="${test.build.dir}" debug="true" includeantruntime="false">
<classpath refid="classpath.test"/>
</javac>
</target>
<target name="test" depends="test-compile">
<jacoco:coverage destfile="${jacoco.exec.file}">
<junit printsummary="on" haltonfailure="yes" fork="true">
<classpath>
<path refid="classpath.test"/>
<pathelement location="${test.build.dir}"/>
</classpath>
<formatter type="brief" usefile="false" />
<batchtest>
<fileset dir="${test.src.dir}" includes="**/*.java" />
</batchtest>
</junit>
</jacoco:coverage>
</target>
<target name="report" depends="test">
<jacoco:report>
<executiondata>
<file file="${jacoco.exec.file}"/>
</executiondata>
<structure name="Cryptonit">
<classfiles>
<fileset dir="${main.build.dir}"/>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${main.src.dir}"/>
</sourcefiles>
</structure>
<html destdir="${jacoco.report.dir}"/>
<csv destfile="${jacoco.report.dir}/report.csv"/>
<xml destfile="${jacoco.report.dir}/report.xml"/>
</jacoco:report>
</target>
</project>