aboutsummaryrefslogtreecommitdiff
path: root/reader/build.gradle.kts
blob: 0386ea5e09b19d9178c29518ea7e7884101ecb04 (plain)
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
plugins {
    application
    jacoco
    id("com.adarshr.test-logger") version "4.0.0"
}

repositories {
    mavenCentral()

    // Repository with JCardSim, Globalplatform, etc, ...
    maven("https://javacard.pro/maven")
    maven("https://deadcode.me/mvn")
}

dependencies {
    implementation(project(":common"))
    implementation(project(":applet"))

    testImplementation(platform("org.junit:junit-bom:5.10.2"))
    testImplementation("org.junit.jupiter:junit-jupiter")
    testImplementation("org.junit-pioneer:junit-pioneer:2.2.0")
    testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

java {
    sourceCompatibility = JavaVersion.VERSION_15
}

application {
    applicationName = "ECTesterReader"
    mainClass = "cz.crcs.ectester.reader.ECTesterReader"
    version = "0.3.3"
}

tasks.named<Test>("test") {
    useJUnitPlatform()
    // Report is always generated after tests run
    finalizedBy(tasks.jacocoTestReport)
}

tasks.jacocoTestReport {
    reports {
        xml.required = true
    }
}

testlogger {
    theme = com.adarshr.gradle.testlogger.theme.ThemeType.MOCHA
    showStandardStreams = true
}

tasks.register<Jar>("uberJar") {
    archiveFileName = "ECTesterReader.jar"
    duplicatesStrategy = DuplicatesStrategy.WARN

    from(sourceSets.main.get().output)

    manifest {
        attributes["Main-Class"] = application.mainClass
    }

    dependsOn(configurations.runtimeClasspath)
    from({
        configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it).matching { exclude("META-INF/*.DSA", "META-INF/*.SF", "META-INF/*.RSA", "META-INF/versions/*/module-info.class", "apdu4j/*") } }
    })
}