Gradle not showing groovyc output

Is anyone else having problems with 1.0m5 where it won’t display the errors/output from groovyc, even when running with the --debug flag? It just shows the forked groovyc returned error code 1.

I keep having to edit my build.gradle to not have the compiler fork in order to see the compile errors. Doing so causes other problems for me but at least it I can see the compile errors. It’s very similar to GRADLE-324, but this is with 1.0 milestone 5 on Mac OS X with Java 1.6.0_26.

Are you sure? It’s easy to overlook the groovyc output above the “forked groovyc returned error code 1” error message.

Yes, I’m sure. A separate test project does appear to work as expected (showing compile errors w/o needing --debug or disabling forking). Not sure why there’s a difference because my build files are similar (just fewer dependencies in one and it’s not part of a multi-project build). I keep having issues with the stock AST transformations (which is the problem I alluded to earlier; when forking is disabled groovyc fails to recognize them and compilation fails). The other project doesn’t use them.

For the affected project when I specify the --debug flag the output goes from Ivy resolving dependencies to the TaskExecutionException. The exception lists the forked groovyc exit code as the only cause, but when I disable forking the chain of exceptions changes to a TEE caused by ‘Compilation Failed’ with MultipleCompilationErrorsException as the root cause. The root exception’s message includes the compile error output from groovyc.

I’ll see if I can sanitize the project enough to provide it as a test case for you.

Maybe the Spock AST transform reports an error (or groovyc an internal error) and this is not handled correctly somewhere along the road.

I’m not using Spock. I was using the @Log, @Immutable, and @Canonical AST transformations. If there are Groovy syntax errors the compile fails w/o the output. Once I fix the syntax errors, then the compile has issues processing the AST transformations. Switching it back to forking somehow changes the behavior and allows it to correctly process the AST transformations and compile the Groovy code.

I have a potentially related issue with a sample project at:

Gradle M6 and “Forked groovyc returned error code: 1” when using spock?