-
Notifications
You must be signed in to change notification settings - Fork 166
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
Plugin breaks aar module #523
Comments
It appears this started happening with |
Can you provide a build scan and and the output of the error you see? |
Error message has nothing directly to do with the plugin, it just complains that classes are missing:
Here is the scan: https://gradle.com/s/aqt5juhhezx4u Sorry to be so blunt, but I have attached repro project above, why was the build scan also necessary? Are you having troubles reproducing it from the attached sample? |
I generally try to avoid running untrusted code from maintainers I'm not familiar with. Nothing personal, I'm just being security conscious. Personally, I'm not familiar with As far as I'm aware this plugin doesn't modify any classpaths other than the ones that it creates for itself. I don't understand how this plugin could impact the success/failure of another plugin's compilation. @Tapchicoma thoughts here? |
Feel free to replace all my gradle distribution files with your own, so you are not running anything untrusted. |
I'm having the same problem , could you find the root issue causing it? Thanks! |
I had a similar issue, maybe this will help someone. In my case we have dependency on additional java module, added to the project. So I manually excluded that java module from adding ktlint stuff.
I think with aars it should work the same. |
I am having the same issue and I think I was able to bypass it with the following
From what I can see from dependency insights, this line is making |
@JLLeitschuh @Tapchicoma AIUI, the |
@tbroyer I tried your solution on the consuming side (that is, on my module applying the ktlint plugin)
and that seems to work as well |
I'm happy to merge any PRs that fix this issue with tests demonstrating the bug and fixing it. I have to admit, I don't actually fully understand the problem here or why it's occurring. I don't why this is causing issues:
What is consuming this configuration other than the KtLint plugin. If something else is consuming the ktlint configuration, that sounds like a bug in the downstream plugin, not in this plugin directly. But again, I may be completely misunderstanding the issue. |
Let's look at it the other way around: is there any reason for the Here's a small reproducer: // settings.gradle.kts
include("producer", "consumer") // producer/build.gradle.kts
plugins {
id("org.jlleitschuh.gradle.ktlint") version "10.1.0"
}
configurations.create("default")
artifacts.add("default", buildFile) // consumer/build.gradle.kts
plugins {
`java-library`
}
dependencies {
implementation(project(":consumer"))
} Now run What seems to happen here is that the You could argue that the I tested, and adding: isCanBeResolved = true
isCanBeConsumed = false
isVisible = false to the |
Fwiw (emphasis mine):
|
Keeping the default of being consumable exposes them to variant-aware resolution when the project is depended upon from another project. Also configure the configurations as non-visible for similar reasons: those are specific to this project's build and there's no reason to consume them from another project. Fix JLLeitschuh#523
Excelent description! |
Keeping the default of being consumable exposes them to variant-aware resolution when the project is depended upon from another project. Also configure the configurations as non-visible for similar reasons: those are specific to this project's build and there's no reason to consume them from another project. Fix #523
When ktlint plugin is applied to a module that just holds AAR artifact (via
allprojects
block), it appears to break that module's output - build complains about classes from that module missing.Steps to reproduce:
build.gradle
and comment outapply plugin
line forktlint
The text was updated successfully, but these errors were encountered: