-
Notifications
You must be signed in to change notification settings - Fork 411
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
Gradle 8.0 #2860
Closed
Closed
Gradle 8.0 #2860
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5eab3ae
Gradle 8.0
Goooler cd279cf
Shadow 7.1.2 in buildSrc
Goooler 2c5e250
binary-compatibility-validator 0.12.1
Goooler 4791920
Update examples/gradle/dokka-customFormat-example/gradle/wrapper/grad…
Goooler aa2aa1d
Merge branch 'master' into gradle8
Goooler 432f9f3
Gradle 8.0.2
Goooler 54c1d3e
Shadow 8.1.0
Goooler cf9d471
binary-compatibility-validator 0.13.0
Goooler ee5460b
Set apiVersion 1.4
Goooler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
examples/gradle/dokka-customFormat-example/gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
2 changes: 1 addition & 1 deletion
2
examples/gradle/dokka-gradle-example/gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
2 changes: 1 addition & 1 deletion
2
examples/gradle/dokka-kotlinAsJava-example/gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
2 changes: 1 addition & 1 deletion
2
examples/gradle/dokka-library-publishing-example/gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
2 changes: 1 addition & 1 deletion
2
examples/gradle/dokka-multimodule-example/gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
2 changes: 1 addition & 1 deletion
2
examples/gradle/dokka-multiplatform-example/gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
2 changes: 1 addition & 1 deletion
2
...ples/gradle/dokka-versioning-multimodule-example/gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
2 changes: 1 addition & 1 deletion
2
examples/plugin/hide-internal-api/gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
2 changes: 1 addition & 1 deletion
2
...ests/gradle/projects/it-multimodule-versioning-0/gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
hey @Goooler, thanks for the ping
Gradle 8 bumped the Kotlin language level to 1.8
Also, the
kotlin-dsl
plugin will automatically configure the language level (as well as other stuff), so there's no need to set it manually.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.
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.
Cause there are some outdated APIs used, seems we can't elevate API level to 1.8 for now, that's why I declare the overriding here.
https://github.com/Kotlin/dokka/actions/runs/4344123199/jobs/7587028523
https://github.com/Kotlin/dokka/actions/runs/4344122470/jobs/7587025547
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.
Ah right, okay.
The deprecations look like minor things to fix
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.
Yeah, I did, but more things in https://github.com/Kotlin/dokka/actions/runs/4343604835/jobs/7585857751
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.
Here detekt/detekt#1286
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.
The
kotlin-dsl
plugin just adds some sensible defaults, removing it won't help - those defaults would have to be added back in and it would make the build config more complicated and brittle. So my guess is the problems you're referring to, that detekt/detekt#1286 solved, would be caused by mis-configuration (e.g. adding a runtime dependency ongradleApi()
), or it using the Gradle embedded Kotlin. (Both of those problems seem have been resolved in newer Dekect plugin versions.)In any case, it's not relevant to this PR.
It's unclear. That's what the test failure seemed to suggest, but it doesn't make sense to me. The Android dependency shouldn't be 'aware' of the Gradle version†, so why should there be a missing class just because the Gradle version is different?
I'll do some digging today. It might be that we make DGP variants that are aware of the Gradle version, which on one hand is cool but on the other it will be a pain.
† While it is possible to publish plugins variants that are aware of the Gradle version that say "I'm only compatible with Gradle 7.6", so Gradle won't select them. But that's not the error (it would be a dependency resolution error), and AGP is older than the Gradle version that introduced this feature.
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.
Thanks for the context on
kotlin-dsl
! We'll keep an eye on it. So far it's not causing problems and I hope the integration tests cover it wellYeah, that's what I can't understand as well, the error is quite strange, considering the changes :( Unless AGP was using some Gradle API whch was removed/reworked
Thank you for taking a look!
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.
The actual cause of the test failure was hidden in the GitHub logs. I reproduced it locally, and here's the key parts of the stacktrace:
The
org.gradle.api.plugins.MavenPlugin
class was moved and marked as deprecated in Gradle 7, and now it's removed in Gradle 8 gradle/gradle#22807So yeah, Android-GP 4.0.1 isn't compatible with Gradle 8 (I also checked with 4.1.3 - same problem).
However, I think the test failure is caused by the test not creating a realistic scenario. It uses
org.gradle.testfixtures.ProjectBuilder
, which is intrinsically linked to the Gradle version used to build Dokka.dokka/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidAutoConfigurationTest.kt
Lines 13 to 20 in 14c05d7
In real life that's not going to happen - Android-GP would have to use Gradle 7 or lower.
As I see it, the workaround is to re-write
AndroidAutoConfigurationTest
to use Gradle TestKit, which Dokka already has set up, and to specify the Gradle version to be 7 or lower forAndroidAutoConfigurationTest
.dokka/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt
Lines 29 to 49 in 14c05d7
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.
Nice find! It indeed doesn't look like it's Dokka's problem in this case, since we do support AGP 4.X, but AGP 4.X itself is not compatible with Gradle 8 - not Dokka's fault
Refactoring the test to utilize TestKit would be good, preferably in a separate PR. Although I'm not sure if it'll be possible to check the same things as in
AndroidAutoConfigurationTest
- it requires access to the configured Dokka tasks. Maybe it could be done as verify tasks inside of the test project? We actually already have an integration test for Android -Android0GradleIntegrationTest
)