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
Report or fail build when kotlin-compiler-embeddable
version is overridden
#5645
Comments
kotlin-compiler-embeddable
version is overriddenkotlin-compiler-embeddable
version is overridden
I think this would be really valuable.
Are you suggesting querying the |
That was my initial thinking. But actually I think a more robust method is to check it in detekt-cli. We can check What do you think about that approach? |
Yup that also works 👍 I'd say that firing a warning + linking to a issue/page that explains this would be the way to go |
I'm going with a failure instead of a warning - even if the mismatched Kotlin version might work (which can happen if it's just a difference in minor version, e.g. 1.7.0 instead of 1.7.10) it will eventually end in failure if not corrected. A warning might be lost in the noise. But 100% agree on linking to a doc page with pointers on how to correct it. |
I thought a bit about it, and maybe this ends up being too aggressive? We would be the only Gradle plugin in the ecosystem doing this. We can't expect every user to align on the Kotlin version we impose (i.e. we're not compose).
I actually think this gives us more freedom as otherwise we might be forced to release a point release whenever Kotlin releases EDIT: typo |
Assume you meant "can't"? In any case, that's not the expectation - remember that detekt has its own dependency configuration, which requires a specific Kotlin version. The project itself can use any Kotlin version it likes and detekt doesn't impose a specific version for the project. However the project should not override detekt's dependency configuration otherwise there will be unhandled errors, or with the PR, at least there's a more useful error with a link to the docs to allow users to fix it themselves. |
Yup that was a typo of mine.
When you say the project itself you mean the runtime right? What happens if a user is applying another gradle plugin which includes a higher version of |
Any other dependency configuration except the
If the plugin is overriding the dependency version used in the The other alternative is just to give up on this approach and have the Gradle plugin use the uber jar as the dependency. That should solve things for good but has other drawbacks. |
Expected Behavior
detekt runs successfully using the expected version of the
kotlin-compiler-embeddable
dependency. If the version of the dependency is overridden in the user's build, either warn the user or fail the build, with a link to documentation explaining the issue and some ways to deal with it.Current Behavior
This keeps coming up as an issue that detekt doesn't properly handle.
Context
#5644 #5582 #5551 #5021 #4786 #4287
The text was updated successfully, but these errors were encountered: