From 06b6493f696b8b404f65257733b19593eed88138 Mon Sep 17 00:00:00 2001 From: soloturn Date: Sun, 13 Feb 2022 07:33:00 +0100 Subject: [PATCH 1/5] gradle, only sign when properties are there --- build.gradle.kts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 66c0b840c..d237a76f3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -110,6 +110,8 @@ tasks.test { } signing { - useGpgCmd() - sign(publishing.publications["maven"]) + if (hasProperty("signing.gnupg.passphrase")) { + useGpgCmd() + sign(publishing.publications["maven"]) + } } From 255b5180fe47b91faa8c1945715006486d49704f Mon Sep 17 00:00:00 2001 From: soloturn Date: Sun, 13 Feb 2022 06:47:22 +0100 Subject: [PATCH 2/5] gradle, javadoc, add class-use + utf8 --- build.gradle.kts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index d237a76f3..f66a5a228 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -101,6 +101,8 @@ tasks.withType { this as StandardJavadocDocletOptions addBooleanOption("Xdoclint:none", true) addStringOption("Xmaxwarns", "1") + encoding = "UTF-8" + isUse = true } } From b18175b25c264eb1d68d2ecd45aff955d5f45bc6 Mon Sep 17 00:00:00 2001 From: soloturn Date: Sun, 13 Feb 2022 07:08:34 +0100 Subject: [PATCH 3/5] gradle, avoid configuring tasks not run --- build.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index f66a5a228..c7221cda7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -65,7 +65,7 @@ tasks.compileJava { } } -tasks.withType { +tasks.withType().configureEach { manifest { attributes["Main-Class"] = "net.sourceforge.plantuml.Run" attributes["Implementation-Version"] = archiveVersion @@ -92,11 +92,11 @@ publishing { } } -tasks.withType { +tasks.withType().configureEach { options.encoding = "UTF-8" } -tasks.withType { +tasks.withType().configureEach { options { this as StandardJavadocDocletOptions addBooleanOption("Xdoclint:none", true) From 6fe6a4c9884fd48fe190de8a7b8a4626410553a1 Mon Sep 17 00:00:00 2001 From: soloturn Date: Sat, 12 Feb 2022 18:49:30 +0100 Subject: [PATCH 4/5] gradle, reorder to permit fat jar and features --- build.gradle.kts | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index c7221cda7..e73e47908 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,9 +12,12 @@ plugins { signing } -repositories { - mavenLocal() - mavenCentral() +group = "net.sourceforge.plantuml" +description = "PlantUML" + +java { + withSourcesJar() + withJavadocJar() } dependencies { @@ -24,12 +27,9 @@ dependencies { testImplementation("org.scilab.forge:jlatexmath:1.0.7") } -group = "net.sourceforge.plantuml" -description = "PlantUML" - -java { - withSourcesJar() - withJavadocJar() +repositories { + mavenLocal() + mavenCentral() } sourceSets { @@ -72,18 +72,12 @@ tasks.withType().configureEach { attributes["Build-Jdk-Spec"] = System.getProperty("java.specification.version") from("manifest.txt") } - - dependsOn(configurations.runtimeClasspath) - from({ - configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) } - }) - - // source sets for java and resources are on "src", only put once into the jar - duplicatesStrategy = org.gradle.api.file.DuplicatesStrategy.EXCLUDE from("skin") { into("skin") } from("stdlib") { into("stdlib") } from("svg") { into("svg") } from("themes") { into("themes") } + // source sets for java and resources are on "src", only put once into the jar + duplicatesStrategy = DuplicatesStrategy.EXCLUDE } publishing { From 858903fec33a078dc45763f49e3f24ad0e69f898 Mon Sep 17 00:00:00 2001 From: soloturn Date: Sun, 13 Feb 2022 00:34:33 +0100 Subject: [PATCH 5/5] pdf optional dependencies --- build.gradle.kts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index e73e47908..a4d7f1656 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,6 +18,9 @@ description = "PlantUML" java { withSourcesJar() withJavadocJar() + registerFeature("pdf") { + usingSourceSet(sourceSets["main"]) + } } dependencies { @@ -25,6 +28,8 @@ dependencies { testImplementation("org.assertj:assertj-core:3.22.0") testImplementation("org.junit.jupiter:junit-jupiter:5.8.2") testImplementation("org.scilab.forge:jlatexmath:1.0.7") + "pdfRuntimeOnly"("org.apache.xmlgraphics:fop:2.6") + "pdfRuntimeOnly"("org.apache.xmlgraphics:batik-all:1.14") } repositories {