From 7a327d5a8fffe75882ecb076298f957661247bb6 Mon Sep 17 00:00:00 2001 From: dankito Date: Mon, 16 Nov 2020 02:19:12 +0100 Subject: [PATCH] Migrated from Kotlin script to Groovy as couldn't figure out how to create fat jar with Kotlin script --- EpcQrCodeJavaFxApp/build.gradle | 49 ++++++++++++++++++++ EpcQrCodeJavaFxApp/build.gradle.kts | 71 ----------------------------- gradle.properties | 2 + 3 files changed, 51 insertions(+), 71 deletions(-) create mode 100644 EpcQrCodeJavaFxApp/build.gradle delete mode 100644 EpcQrCodeJavaFxApp/build.gradle.kts diff --git a/EpcQrCodeJavaFxApp/build.gradle b/EpcQrCodeJavaFxApp/build.gradle new file mode 100644 index 0000000..dacddcd --- /dev/null +++ b/EpcQrCodeJavaFxApp/build.gradle @@ -0,0 +1,49 @@ +apply plugin: 'kotlin' +apply plugin: 'application' + + +group = "net.codinux.banking.epcqrcode.javafx" + +mainClassName = "net.codinux.banking.epcqrcode.EpcQrCodeJavaFxAppKt" + + +sourceCompatibility = JavaVersion.VERSION_1_8 +targetCompatibility = JavaVersion.VERSION_1_8 + +compileKotlin { + kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8 +} +compileTestKotlin { + kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8 +} + + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion" + + api project(":EpcQrCode") + + implementation "net.dankito.utils:java-fx-utils:1.0.8" +} + + + +jar { + zip64 = 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 'Main-Class': mainClassName, + 'Implementation-Title': "EPC QR Code", + 'Implementation-Version': "1.0.0-SNAPSHOT" + } + + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + + from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } + +} \ No newline at end of file diff --git a/EpcQrCodeJavaFxApp/build.gradle.kts b/EpcQrCodeJavaFxApp/build.gradle.kts deleted file mode 100644 index c24e7bf..0000000 --- a/EpcQrCodeJavaFxApp/build.gradle.kts +++ /dev/null @@ -1,71 +0,0 @@ -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() { - kotlinOptions.jvmTarget = "1.8" -} - - -dependencies { - implementation(kotlin("stdlib-jdk8")) - - api(project(":EpcQrCode")) - - implementation("net.dankito.utils:java-fx-utils:1.0.8") -} - - -application { - mainClassName = mainClassName -} - - -tasks.withType { - 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) } - }) -} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 30c8140..19903dc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,4 +3,6 @@ kotlin.js.generate.executable.default=false xcodeproj=./EpcQrCodeiOSApp +kotlinVersion=1.4.10 + quarkusVersion=1.8.2.Final