-
-
Notifications
You must be signed in to change notification settings - Fork 123
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
KotlinNullPointerException on antlr
dependency
#300
Comments
Well, I can get it to recognize the
|
I have used antlr, but it's been a while. Do you have an idea why the plugin wouldn't "see" any code from that jar being used? Btw, once I merge to main, you can add this to ignore the false warning dependencyAnalysis {
issues {
all {
onUnusedDependencies {
exclude("org.antlr:antlr4")
}
}
}
} |
I think it's correct that |
Ah, I see. So the plugin should probably make it a compileOnly
dependency. Hm. Maybe we can just upstream this.
On October 9, 2020, GitHub ***@***.***> wrote:
I think it's correct that antlr isn't used. It's the compiler that is
used at compile time but at runtime only antlr-runtile is used
(transitively)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://github.com/autonomousapps/dependency-analysis-android-gradle-
plugin/issues/300#issuecomment-706506339>, or unsubscribe
<https://github.com/notifications/unsubscribe-
auth/ABJG5PL2H46BI7ZOEY3KVT3SKAGPJANCNFSM4SJ6BA2Q>.
|
While I have merged the PR, this issue is not quite resolved to my satisfaction. |
Here it is, the antlr plugin sets the compile configuration as a descendant of the antlr configuration https://github.com/gradle/gradle/blob/master/subprojects/antlr/src/main/java/org/gradle/api/plugins/antlr/AntlrPlugin.java#L67-L68 and https://github.com/gradle/gradle/blob/7aa7d2d720eab2ab963974277d826bae9f05e57e/subprojects/plugins/src/main/java/org/gradle/api/plugins/JavaPlugin.java#L148, where we see it's placed directly on the |
I'm starting to think what I actually need is special-handling for non-standard configurations. This is now a design question. |
That's interesting... Is there a reason to do this instead of adding
I guess part of why that's hard here because it's hard to tell whether a given dependency was added by the user or by another plugin?... |
For me, I think I just need to draw the line somewhere. I can't support every plugin out of the box. But to avoid giving bad information to users, I think I might have the plugin ignore dependencies that are on a custom, not-well-known, configuration. I can imagine supporting additional plugins (like antlr), but that won't solve the general case, which is what I'm talking about now. |
The latest PR resolves this in a more general and satisfying way. The plugin should now ignore all "unusual" configurations. We can add support for them one at a time as it may seem useful. |
Reproducer project there: https://github.com/martinbonnin/test-antlr/
Calling
./gradlew buildHealth --stacktrace
fails with:This only happens on current
main
. The sample projects expects0.61.1-SNAPSHOT
in mavenLocal.0.61.0
is ok (although it displays "null" for configurations). I guess it has to do with the fact that theantlr
plugin adds the dependency automagically.The text was updated successfully, but these errors were encountered: