EpcQrCode/EpcQrCodeJavaFxApp/build.gradle.kts

71 lines
1.7 KiB
Plaintext

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm")
application
}
group = "net.codinux.banking.epcqrcode.javafx"
val mainClassName = "net.codinux.banking.epcqrcode.EpcQrCodeJavaFxAppKt"
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
jvmTarget = "1.8"
}
val compileTestKotlin: KotlinCompile by tasks
compileTestKotlin.kotlinOptions {
jvmTarget = "1.8"
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks.withType<KotlinCompile>() {
kotlinOptions.jvmTarget = "1.8"
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation(project(":EpcQrCode"))
implementation("net.dankito.utils:java-fx-utils:1.0.8")
}
application {
mainClassName = mainClassName
}
tasks.withType<Jar> {
isZip64 = true
// If one of the source JARs is signed, merging it into one fat jar destroys the signature -> remove signatures
// (but may runs into problems with jars that require a valid signature like BouncyCastle, see
// https://stackoverflow.com/questions/51455197/gradle-fatjar-could-not-find-or-load-main-class)
exclude("META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA")
manifest {
attributes(mapOf(
"Main-Class" to mainClassName,
"Implementation-Title" to "EPC QR Code",
"Implementation-Version" to "1.0.0-SNAPSHOT"
))
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
// To add all of the dependencies
from(sourceSets.main.get().output)
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
})
}