kordamp / gm

Gum is a Gradle/Maven/JBang wrapper written in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exit code is reported as a success, 0, even when build fails

mmoayyed opened this issue · comments

Running with Gradle 8.5 with Java 21 (though I don't think this matters much), it appears when a Gradle task fails the exit code is reported as a success or 0.

To reproduce:

  • Download and unpack this
  • Make a compilation error in the source code
  • Run gm build
  • At this point, you should see BUILD FAILED. The run: echo $? and you'd see: 0.

If I use the native Gradle wrapper directly with ./gradlew build:

Configuration on demand is an incubating feature.
Calculating task graph as no cached configuration is available for tasks: build

> Task :compileJava FAILED
/Users/misagh/Downloads/demo/src/main/java/com/example/demo/DemoApplication.java:11: error: not a statement
                xlvhxjkhvjkxchvkjxchvkjxchvjk
                ^
/Users/misagh/Downloads/demo/src/main/java/com/example/demo/DemoApplication.java:11: error: ';' expected
                xlvhxjkhvjkxchvkjxchvkjxchvjk
                                             ^
2 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
> Run with --info option to get more log output.
> Run with --scan to get full insights.

At this point, echo $? shows 1 which is the correct exit code.

Shipped in v0.13.0

Thank you!