-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathbuild.gradle
75 lines (65 loc) · 1.97 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
buildscript {
repositories {
mavenCentral()
maven { url "https://javacard.pro/maven" }
}
}
plugins {
id("java")
id("com.klinec.gradle.javacard") version "1.8.0" apply false
}
var jcHomeSet = System.getenv("JC_HOME") != null
if (!jcHomeSet) {
project.logger.warn("JC_HOME environment variable not set - doing a testing/fake build with jCardSim!")
project.logger.warn("YOU WILL NOT BE ABLE TO BUILD A JAVACARD APPLET THIS WAY")
}
group = "us.q3q"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
if (jcHomeSet) {
testImplementation(group: 'com.klinec', name: 'jcardsim', version: '3.0.5.11') {
// Javacard will be provided by the user at runtime through the JC_HOME env var
exclude(group: 'oracle.javacard', module: 'api_classic')
}
} else {
// Perform a full-test build, since there's no javacard SDK
implementation(group: 'com.klinec', name: 'jcardsim', version: '3.0.5.11')
}
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.8.1'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.8.1'
}
test {
useJUnitPlatform()
}
tasks.register('testJar', Jar) {
archiveBaseName = project.name + '-tests'
duplicatesStrategy = 'include'
from sourceSets.test.output + sourceSets.test.allSource
from {
sourceSets.test.runtimeClasspath.filter {
it.toString().indexOf("jcardsim-") != -1
}.collect {
zipTree(it)
}
}
}
if (jcHomeSet) {
apply plugin: "com.klinec.gradle.javacard"
javacard {
config {
cap {
packageName 'us.q3q.fido2'
version '0.4'
aid PackageID
output 'FIDO2.cap'
applet {
className 'us.q3q.fido2.FIDO2Applet'
aid ApplicationID
}
}
}
}
}