-
Notifications
You must be signed in to change notification settings - Fork 200
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
Ensure Kotlin dependencies are properly handled when not forced #825
Ensure Kotlin dependencies are properly handled when not forced #825
Conversation
odd, the test suite breaks with this change |
You're right, this breaks additional tests. I was getting failures in I'll take another look. |
iirc, that happens when you run with a newer jdk. You can use jenv, asdf, etc. to set a local one for the project. Trying right now with jdk11 on master to see if it passes locally. I don't recall what the issue was, but remember being confused by that test failure too |
yep, jdk11 worked locally for master |
val latest = configuration.allDependencies | ||
.filterIsInstance<ExternalDependency>() | ||
.filterNot(kotlinDeps) | ||
.filter { configuration.hierarchy.size > 1 && kotlinDeps(it) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe filterNot
? trying locally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
passes except for your new test, which I think might be a formatting difference?
PluginUpdateDetectionSpec > kotlin plugin in the implementation configuration is properly handled FAILED
Condition not satisfied:
result.output.contains """The following dependencies have later milestone versions: - org.jetbrains.kotlin:kotlin-gradle-plugin [$KOTLIN_VERSION -> """
| | | |
| | false 1.6.0
|
| > Task :dependencyUpdates
|
| ------------------------------------------------------------
| : Project Dependency Updates (report to plain text file)
| ------------------------------------------------------------
|
| The following dependencies are using the latest milestone version:
| - org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0
| - org.jetbrains.kotlin:kotlin-stdlib:1.6.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think detecting by isForced
might be what's needed.
This will handle the case of detecting Kotlin plugins properly.
658d6c2
to
7e792e9
Compare
A little more context: I saw the comments about plugins trying to force versions, so that led me to this path. My approach to fixing this has been to preserve the special case logic for But after talking with @jvandort, it seems So I'm wondering if any of the special casing for Kotlin is still necessary? If I remove it all, I get the same passing build. Perhaps it is no longer useful? I couldn't find any existing tests that hinted at why it was still there. Do you know how we could create one to confirm if it is needed? |
I released to unblock, but happy to revisit the removal of that code if its useless nowadays. |
@ben-manes Can you take a look at #826 when you get a chance? I think this is all that is needed. I added tests for the kotlin stdlib dependency that was the origin of the special case in the |
that's awesome, thank you @tresat! |
This will handle the case of Kotlin plugins (applied to the parentless classpath configuration).