New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.8] compileGroovy.destinationDir does not respect sourceSets.main.groovy.outputDir #5722
Comments
Let me first say that adding Instead please set the output directory directly on the corresponding compile task. Also, may I ask why you are changing it at all? What's the use case? That being said, this shouldn't just silently break. @big-guy I'm assigning you since you were the last one to change the Groovy plugin as part of the lazy task work. A potential fix might be removing this method and advising users to configure the compile task (the method is incubating and hopefully not too widespread). Alternatively we could restore the old behavior and remove it in another release, maybe even deprecate first. |
In Gradle 4.0, when each language was given its own output folder, the release notes told us to use See https://docs.gradle.org/4.0/release-notes.html#deprecated-apis
The use case is that Bnd allows the user to set things like source and output folders in a bnd file, and the Bnd Gradle plugin then needs to configure gradle to use those folders. So this includes java compilation and also groovy (since the Bnd Gradle plugin is built in the Bnd build and is written in groovy). I found this issue when testing the Bnd build with Gradle 4.8 and the Bnd Gradle plugin portion of the build failed since it could not locate the compileGroovy output in the configured output folder.
If you plan to remove the incubating |
One more question. Currently, setting compileTask.destinationDir = outputDir
sourceSets.main.output.dir(outputDir, builtBy: compileTask) |
Yes, if we remove this method, the classesDirs would have to react to setting the destination on the compile task directly. Given this has leaked so in so many places I guess we'll have to deprecate first before removing. |
@lacasseio #5726 fixed this issue too, right? |
My bad, I forgot to close this issue. |
Expected Behavior
compileGroovy.destinationDir
should default to the value set forsourceSets.main.groovy.outputDir
. This worked as expected until 4.8.Current Behavior
With Gradle 4.8,
compileGroovy.destinationDir
is ignoring the value ofsourceSets.main.groovy.outputDir
whensourceSets.main.groovy.outputDir
is set to a value.Context
My build fails since the compileGroovy output is placed in the wrong folder.
Steps to Reproduce (for bugs)
This simple
build.gradle
file shows the problem. When run on Gradle 4.7, both directories are the same. When run on Gradle 4.8, thecompileGroovy.destinationDir
value is not the same as the set value forsourceSets.main.groovy.outputDir
.Your Environment
The text was updated successfully, but these errors were encountered: