kordamp / gm

Gum is a Gradle/Maven/JBang wrapper written in Go
Apache License 2.0
59 stars 2 forks source link

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

Closed mmoayyed closed 11 months ago

mmoayyed commented 11 months ago

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:

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.

aalmiray commented 11 months ago

Shipped in v0.13.0

mmoayyed commented 11 months ago

Thank you!