From c952b980bba1d5b20afdbd0c36ecc5b3a4cd38b6 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Mon, 24 Jun 2024 20:13:27 -0700 Subject: [PATCH] Ensured exit status is set on failure --- README.md | 2 +- .../bld/java/com/example/ExampleBuild.java | 2 +- .../bld/extension/CompileKotlinOperation.java | 25 ++++++++++--------- .../extension/CompileKotlinOperationTest.java | 3 +-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 8c1d080..e1c974a 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ To compile the source code located in `src/main/kotlin` and `src/test/kotlin` fr ```java @BuildCommand(summary = "Compiles the Kotlin project") -public void compile() throws IOException { +public void compile() throws Exception { new CompileKotlinOperation() .fromProject(this) .execute(); diff --git a/examples/src/bld/java/com/example/ExampleBuild.java b/examples/src/bld/java/com/example/ExampleBuild.java index 352cb20..7461aff 100644 --- a/examples/src/bld/java/com/example/ExampleBuild.java +++ b/examples/src/bld/java/com/example/ExampleBuild.java @@ -57,7 +57,7 @@ public class ExampleBuild extends Project { @BuildCommand(summary = "Compiles the Kotlin project") @Override - public void compile() throws IOException { + public void compile() throws Exception { // The source code located in src/main/kotlin and src/test/kotlin will be compiled new CompileKotlinOperation() .fromProject(this) diff --git a/src/main/java/rife/bld/extension/CompileKotlinOperation.java b/src/main/java/rife/bld/extension/CompileKotlinOperation.java index 45aa507..0a69592 100644 --- a/src/main/java/rife/bld/extension/CompileKotlinOperation.java +++ b/src/main/java/rife/bld/extension/CompileKotlinOperation.java @@ -21,6 +21,7 @@ import rife.bld.BaseProject; import rife.bld.extension.kotlin.CompileOptions; import rife.bld.extension.kotlin.CompilerPlugin; import rife.bld.operations.AbstractOperation; +import rife.bld.operations.exceptions.ExitStatusException; import rife.tools.FileUtils; import java.io.File; @@ -214,10 +215,12 @@ public class CompileKotlinOperation extends AbstractOperation classpath, Collection sources, File destination, File friendPaths) - throws IOException { + throws ExitStatusException { if (sources.isEmpty() || destination == null) { return; } @@ -299,18 +301,17 @@ public class CompileKotlinOperation extends AbstractOperation