102 lines
2.3 KiB
Groovy
102 lines
2.3 KiB
Groovy
apply plugin: 'javacard'
|
|
apply plugin: 'org.junit.platform.gradle.plugin'
|
|
|
|
buildscript {
|
|
repositories {
|
|
maven { url 'http://releases.marmeladburk.fidesmo.com/' }
|
|
mavenCentral()
|
|
maven { url 'https://jitpack.io' }
|
|
}
|
|
|
|
dependencies {
|
|
classpath 'com.fidesmo:gradle-javacard:0.2.7'
|
|
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.1.1'
|
|
classpath 'com.github.status-im.status-keycard-java:desktop:2.0.0'
|
|
}
|
|
}
|
|
|
|
javacard {
|
|
sdkVersion = "3.0.4"
|
|
|
|
cap {
|
|
aid = '0xA0:0x00:0x00:0x08:0x04:0x00:0x01'
|
|
packageName = 'im.status.keycard'
|
|
applet {
|
|
aid = '0xA0:0x00:0x00:0x08:0x04:0x00:0x01:0x01'
|
|
className = 'KeycardApplet'
|
|
}
|
|
applet {
|
|
aid = '0xA0:0x00:0x00:0x08:0x04:0x00:0x01:0x02'
|
|
className = 'NDEFApplet'
|
|
}
|
|
|
|
version = '2.0'
|
|
}
|
|
}
|
|
|
|
def testTarget = project.properties['im.status.keycard.test.target']
|
|
if (!testTarget) {
|
|
testTarget = 'card'
|
|
}
|
|
|
|
def pairingPass = project.properties['im.status.keycard.test.pairing']
|
|
if (!pairingPass) {
|
|
pairingPass = 'KeycardTest'
|
|
}
|
|
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven { url 'https://jitpack.io' }
|
|
}
|
|
|
|
dependencies {
|
|
testCompile(files("../jcardsim/jcardsim-3.0.5-SNAPSHOT.jar"))
|
|
testCompile('org.web3j:core:2.3.1')
|
|
testCompile('org.bitcoinj:bitcoinj-core:0.14.5')
|
|
testCompile('com.github.status-im.status-keycard-java:desktop:425d085')
|
|
testCompile('org.bouncycastle:bcprov-jdk15on:1.60')
|
|
testCompile("org.junit.jupiter:junit-jupiter-api:5.1.1")
|
|
testRuntime("org.junit.jupiter:junit-jupiter-engine:5.1.1")
|
|
}
|
|
|
|
junitPlatform {
|
|
filters {
|
|
tags {
|
|
exclude 'manual'
|
|
}
|
|
}
|
|
}
|
|
|
|
task wrapper(type: Wrapper) {
|
|
gradleVersion = '4.7'
|
|
}
|
|
|
|
task install (type: im.status.keycard.build.InstallTask)
|
|
|
|
if (testTarget == 'card') {
|
|
tasks.install.dependsOn(convertJavacard)
|
|
tasks.test.dependsOn(install)
|
|
}
|
|
|
|
compileJava {
|
|
sourceCompatibility = 1.6
|
|
targetCompatibility = 1.6
|
|
}
|
|
|
|
compileTestJava {
|
|
sourceCompatibility = 1.8
|
|
targetCompatibility = 1.8
|
|
}
|
|
|
|
afterEvaluate {
|
|
def jvmArgs = ["-Dim.status.keycard.test.target=${testTarget}", "-Dim.status.keycard.test.pairing=${pairingPass}"]
|
|
|
|
if (testTarget == 'simulator') {
|
|
jvmArgs.push('-noverify')
|
|
}
|
|
|
|
def junitPlatformTestTask = tasks.getByName('junitPlatformTest')
|
|
junitPlatformTestTask.jvmArgs(jvmArgs)
|
|
}
|