From d800fda561c7012666d868a7a6a60b78ce8d50f1 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sun, 26 Nov 2023 17:05:07 -0800 Subject: [PATCH] String arguments should not be blank --- README.md | 2 +- .../bld/java/com/example/ExampleBuild.java | 7 ++++-- .../bld/extension/CompileKotlinOperation.java | 12 +++++++++- .../bld/extension/CompileKotlinOptions.java | 22 ++++++++++--------- .../bld/extension/dokka/DokkaOperation.java | 6 +++-- 5 files changed, 33 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 0ce25a8..7b0c20c 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To install, please refer to the [extensions documentation](https://github.com/ri To compile the source code located in `src/main/kotlin` and `src/test/kotlin` from the current project: ```java -@BuildCommand(summary = "Compile the Kotlin project") +@BuildCommand(summary = "Compiles the Kotlin project") public void compile() throws IOException { new CompileKotlinOperation() .fromProject(this) diff --git a/examples/src/bld/java/com/example/ExampleBuild.java b/examples/src/bld/java/com/example/ExampleBuild.java index 4a39a60..5cabdf2 100644 --- a/examples/src/bld/java/com/example/ExampleBuild.java +++ b/examples/src/bld/java/com/example/ExampleBuild.java @@ -32,8 +32,11 @@ public class ExampleBuild extends Project { autoDownloadPurge = true; repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, RIFE2_RELEASES); + final var kotlin = version(1, 9, 21); scope(compile) - .include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", version(1, 9, 21))); + .include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin)) + .include(dependency("org.jetbrains.kotlin", "kotlin-stdlib-jdk7", kotlin)) + .include(dependency("org.jetbrains.kotlin", "kotlin-stdlib-jdk8", kotlin)); scope(test) .include(dependency("org.jetbrains.kotlin:kotlin-test-junit5:1.9.21")) .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 1))) @@ -57,7 +60,7 @@ public class ExampleBuild extends Project { new ExampleBuild().start(args); } - @BuildCommand(summary = "Compile the Kotlin project") + @BuildCommand(summary = "Compiles the Kotlin project") @Override public void compile() throws IOException { // The source code located in src/main/kotlin and src/test/kotlin will be compiled diff --git a/src/main/java/rife/bld/extension/CompileKotlinOperation.java b/src/main/java/rife/bld/extension/CompileKotlinOperation.java index 6fbbbee..534f2ad 100644 --- a/src/main/java/rife/bld/extension/CompileKotlinOperation.java +++ b/src/main/java/rife/bld/extension/CompileKotlinOperation.java @@ -94,6 +94,16 @@ public class CompileKotlinOperation extends AbstractOperation { } // -moduleName - if (moduleName_ != null) { + if (isNotBlank(moduleName_)) { args.add("-moduleName"); args.add(moduleName_); } // -moduleVersion - if (moduleVersion_ != null) { + if (isNotBlank(moduleVersion_)) { args.add("-moduleVersion"); args.add(moduleVersion_); }