Skip to content
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

Update from Gradle 6.9 to Gradle 8.0 #168

Merged
merged 25 commits into from
Feb 17, 2023
Merged

Conversation

TWiStErRob
Copy link
Collaborator

Closes #154

  • Including some necessary plugin updates.
  • Keeping Kotlin 1.3 as target compatibility.
  • Ensured that the generated artifacts are mostly the same.
    • Bytecode for most classes matches, where it doesn't I'm not sure what's different. There's a tiny diff in @kotlin.Metadata, probably a minor Kotlin 1.3.x diff.
    • MANIFEST.MF is the same
    • -sources.jar is the same
    • -javadoc.jar is still empty (😲)
    • Gradle plugin marker is correct
    • .pom files are the same (bar some expected trivial changes)
    • .module files are the same, bar some expected changes (full diff):
      • apiElements and runtimeElements were removed

> Configure project :buildSrc
e: P:\projects\contrib\github-nexus-publish-plugin\buildSrc\build.gradle.kts:14:5: Unresolved reference: experimentalWarning

> Configure project :buildSrc
The KotlinDslPluginOptions.experimentalWarning property has been deprecated. This is scheduled to be removed in Gradle 8.0. Flag has no effect since `kotlin-dsl` no longer relies on experimental features.
        at Build_gradle$3.execute(build.gradle.kts:14)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
… and Gradle 8.x

* What went wrong:
org/gradle/api/plugins/MavenPlugin

* Try:
> Run with --info or --debug option to get more log output.

* Exception is:
java.lang.NoClassDefFoundError: org/gradle/api/plugins/MavenPlugin
        at com.github.jengelman.gradle.plugins.shadow.ShadowJavaPlugin$1.execute(ShadowJavaPlugin.groovy:101)
pluginBundle was deprecated in Gradle 7.6 and removed in Gradle 8.0:
https://plugins.gradle.org/plugin/com.gradle.plugin-publish/1.0.0

maven-publish is auto-applied
…ngs can go wrong.

> Task :compileKotlin FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileKotlin'.
> 'compileJava' task (current target is 11) and 'compileKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.
  Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain
…le 7.6. Building with Gradle 8.0 will obviously also warn. Let's suppress it for now, this will be dealt with in gradle-nexus#152
Also in gradle-nexus#167, but it's annoying not being able to get a green build locally.
…ures on older Gradle versions.

For example: NexusPublishPluginTests.should close staging repository
```
> Task :closeSonatypeStagingRepository FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':closeSonatypeStagingRepository'.
> kotlin.jvm.internal.PropertyReference1Impl.<init>(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
```
> Task :compileKotlin
w: API version 1.3 is deprecated and its support will be removed in a future version of Kotlin

> Task :compileTestKotlin
w: API version 1.3 is deprecated and its support will be removed in a future version of Kotlin

> Task :compileCompatTestKotlin
w: API version 1.3 is deprecated and its support will be removed in a future version of Kotlin
It's done by the plugin-publish plugin too.
In the Gradle Metadata (.module) it duplicates artifacts if called multiple times.
There is built-in support for standard configuration in plugin-publish and shadow plugins.
It doesn't change anything in the output publishToMavenLocal, it was probably for an older combination of Gradle / plugin-publish / shadow plugins.
…compatible @kotlin.Metadata in the .class files.
build.gradle.kts Show resolved Hide resolved
build.gradle.kts Show resolved Hide resolved
build.gradle.kts Show resolved Hide resolved
@TWiStErRob TWiStErRob requested a review from vlsi February 17, 2023 17:03
Copy link
Contributor

@vlsi vlsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.
I especially like the way you structure commits and add relevant comments pointing to issues, and the reasons.

@TWiStErRob
Copy link
Collaborator Author

@szpak this is RTM as you see fit.

@szpak
Copy link
Contributor

szpak commented Feb 17, 2023

Thanks @TWiStErRob. And thanks @vlsi for the review. Just some nitpicking and we can merge it.

@szpak szpak added this pull request to the merge queue Feb 17, 2023
Merged via the queue into gradle-nexus:master with commit ea86f41 Feb 17, 2023
@szpak szpak added this to the 1.2.0 milestone Feb 17, 2023
@TWiStErRob TWiStErRob deleted the gradle8 branch February 17, 2023 21:58
@TWiStErRob
Copy link
Collaborator Author

... and of course 1 hour later, Gradle 8.0.1 is out. 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants