forked from Yubico/ykneo-oath
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
80 lines (69 loc) · 1.79 KB
/
build.gradle
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
apply plugin: 'javacard'
buildscript {
repositories {
mavenCentral()
maven { url('http://releases.marmeladburk.fidesmo.com/') }
}
dependencies {
classpath 'com.fidesmo:gradle-javacard:0.2.3'
}
}
repositories {
mavenCentral()
}
dependencies {
testCompile 'junit:junit:4.11'
testCompile 'com.licel:jcardsim:2.2.2'
}
javacard {
cap {
def aidPrefix = "0xa0:0x00:0x00:0x05:0x27:0x21"
aid = "${aidPrefix}:0x01"
packageName = 'pkgYkneoOath'
version = '1.0'
applet {
aid = "${aidPrefix}:0x01:0x01"
className = 'YkneoOath'
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.0'
}
compileTestJava {
/* By default the gradle plugin compiles everthing with 1.2 compatibilty. Change the tests to be
* compiled with a java version suitable for the usage of jUnit.
*/
sourceCompatibility = '1.6'
targetCompatibility = '1.6'
}
/* Change soruce sets to be compatible with the original yubico project layout.
*/
sourceSets {
main {
java {
srcDir 'applet/src'
}
}
test {
java {
srcDir 'test/test'
}
resources {
srcDir ' test/resources'
}
/* Gradle prepends automatically all compile dependencies to the testCompile and testRuntime
* configuration. So the java card api.jar needs to be filtered from the class path otherwise
* it couldn't be overwritten by jcardsim.
*
* In the longterm this might be solvable in javaCard gradle plugin.
*/
runtimeClasspath = project.sourceSets.test.runtimeClasspath.filter { !it.path.endsWith("lib/api.jar") }
}
}
/* Gradle seems to forget the dependencies of the test task if the classpath is altered, therefore
* they have to be set manually.
*/
test {
dependsOn(testClasses)
}