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

Upgrade Gradle wrapper to version 8.6 #520

Merged
merged 12 commits into from
Feb 29, 2024
Merged

Upgrade Gradle wrapper to version 8.6 #520

merged 12 commits into from
Feb 29, 2024

Conversation

blackwinter
Copy link
Member

Resolves #484. What about secondary objective "Simplify the release process"?

Reviewers: Please verify that all use cases as well as release steps are still working.

Changes:

  • install¹ -> publishToMavenLocal, uploadArchives -> publishAllPublicationsToMavenRepository: "The maven plugin has been deprecated. This is scheduled to be removed in Gradle 7.0. Please use the maven-publish plugin instead."
  • publish -> publishAllPublicationsToGitHubPackagesRepository (in .github/workflows/publish.yml): Action is intended to "Publish package to GitHub Packages", so use specific task.
  • editorconfig -> editorconfig-checker: Editorconfig plugin is not compatible with Gradle 8.x ("void org.gradle.workers.WorkerExecutor.submit(java.lang.Class, org.gradle.api.Action)") and upgrading to a compatible version (0.1.0) would raise the minimum Java version requirement to 16 (see also Include editorconfig-checker to complement editorconfig-gradle-plugin. metafacture-fix#179 and Upgrade Gradle wrapper to version 8.x. metafacture-fix#283). Surfaced some whitespace violations which had to be fixed.
  • signing.required: No longer dependent on presence of task uploadArchives. Is this needed?
  • signing.signPom, signArchives (fix): No longer configured. Is this needed? Is it done by default now?
  • testRuntime -> testRuntimeOnly: "The testRuntime configuration has been deprecated for dependency declaration. This will fail with an error in Gradle 7.0. Please use the testRuntimeOnly configuration instead."
  • runtime <configuration> -> runtimeClasspath.extendsFrom <configuration>: "Adding a Configuration as a dependency is a confusing behavior which isn't recommended. This behaviour has been deprecated and is scheduled to be removed in Gradle 8.0. If you're interested in inheriting the dependencies from the Configuration you are adding, you should use Configuration#extendsFrom instead."
  • archiveName -> archiveFileName.get(): "The AbstractArchiveTask.archiveName property has been deprecated. This is scheduled to be removed in Gradle 8.0. Please use the archiveFileName property instead."
  • classifier -> archiveClassifier: "Could not set unknown property 'classifier' for task [...] of type [...]."
  • main -> mainClass: "The JavaExec.main property has been deprecated. This is scheduled to be removed in Gradle 8.0. Please use the mainClass property instead."
  • outputDir -> classesDirectory: "The SourceDirectorySet.outputDir property has been deprecated. This is scheduled to be removed in Gradle 8.0. Please use the classesDirectory property instead."

(See also metafacture/metafacture-fix#57 and metafacture/metafacture-fix#341 as well as Upgrading Gradle 6 to 7 and Upgrading Gradle 7 to 8.)

Wiki changes (after pull request has been merged):

  • Code Quality and Style: Build Environment:
    -$ ./gradlew.sh install
    +$ ./gradlew.sh publishToMavenLocal
  • Maintainer Guidelines: Upload to Sonatype:
    -1. Now you can build and upload the release candidate to sonatype (note that `./gradlew` should inform you to make a "snapshot build". If the version doesn't end with `-SNAPSHOT` the artifacts will not be uploaded to sonatypes snapshot repository!). Also, comment out `releaseRepositoryUrl...` in your `gradle.properties` so that the `snapshotRepository` will be used. Then:
    +1. Now you can build and upload the release candidate to sonatype (note that `./gradlew` should inform you to make a "snapshot build". If the version doesn't end with `-SNAPSHOT` the artifacts will not be uploaded to sonatypes snapshot repository!):
    -./gradlew clean; ./gradlew install; ./gradlew uploadArchives
    +./gradlew clean; ./gradlew publishToMavenLocal; ./gradlew publishAllPublicationsToMavenRepository
  • Maintainer Guidelines: Publish to GithubPackages:
    Possibly replace gradlew publish with ./gradlew publishAllPublicationsToGitHubPackagesRepository?
  • Maintainer Guidelines: Making a release:
    -./gradlew clean; ./gradlew install; ./gradlew uploadArchives
    +./gradlew clean; ./gradlew publishToMavenLocal; ./gradlew publishAllPublicationsToMavenRepository

¹ Kept for compatibility purposes, but deprecated.

…gin`.

`editorconfig-gradle-plugin` doesn't have sufficient support for `.editorconfig` properties: https://github.com/ec4j/editorconfig-gradle-plugin#how-it-works

`editorconfig-checker` has been added in version 2.4.0 for linux amd64: https://github.com/editorconfig-checker/editorconfig-checker/releases/tag/2.4.0

See also metafacture/metafacture-fix#179.
Disable Editorconfig plugin due to incompatibility; compatible version would raise minimum required Java version to 16.

See also metafacture/metafacture-fix#341.
@blackwinter
Copy link
Member Author

blackwinter commented Feb 9, 2024

Possible next step: Address Gradle 9 deprecations.

  • build.gradle, line 85:
    The org.gradle.api.plugins.JavaPluginConvention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.6/userguide/upgrading_version_8.html#java_convention_deprecation
    The org.gradle.api.plugins.Convention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.6/userguide/upgrading_version_8.html#deprecated_access_to_conventions
    
  • build.gradle, line 86:
    The org.gradle.api.plugins.JavaPluginConvention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.6/userguide/upgrading_version_8.html#java_convention_deprecation
    The org.gradle.api.plugins.Convention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.6/userguide/upgrading_version_8.html#deprecated_access_to_conventions
    

Resolved with afbb5c8.

build.gradle Outdated Show resolved Hide resolved
Copy link
Member

@fsteeg fsteeg left a comment

Choose a reason for hiding this comment

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

What I use (install / publishToMavenLocal and check) seems to work fine.

(Both on Java 8 and 11.)

I did notice this log output, but I'm also getting that on master (even twice there):

Task :metafacture-biblio:compileTestJava
[Fatal Error] byte-buddy-parent-1.9.10.pom:789:1: Content is not allowed in trailing section.

@fsteeg fsteeg removed their assignment Feb 13, 2024
@blackwinter
Copy link
Member Author

Thanks for testing!

I did notice this log output, but I'm also getting that on master (even twice there):

Hm, I've never seen this message. Still don't.

Did you run on a clean build? Does --refresh-dependencies have any effect?

@fsteeg
Copy link
Member

fsteeg commented Feb 13, 2024

Did you run on a clean build? Does --refresh-dependencies have any effect?

No change with clean and --refresh-dependencies (both on Java 8 and 11).

@dr0i
Copy link
Member

dr0i commented Feb 16, 2024

Just tested the publishing to oss.sonatype.org to publish it to maven central. However, the publishAllPublicationsToMavenRepository just uploads files ending with .module (and the pom) to oss.sonatype.org, while we need .jar .javadoc and sources.jar (which all correctly appear in the local repo (~/.m2/...). I don't had time to further investigate - you haven't already an idea about why this is so?

Re "signing": yes I would say we should provide that. And the .asc are still generated - look at the the local maven repo 👍 .

@dr0i dr0i assigned blackwinter and unassigned dr0i Feb 16, 2024
@blackwinter
Copy link
Member Author

I don't had time to further investigate - you haven't already an idea about why this is so?

No, I don't have any idea either. It seems to be published correctly to localEmbedded (which may have been the reason for this repository in the first place, to be able to inspect the publication artifacts?):

     29 jar
     29 jar.md5
     29 jar.sha1
     29 jar.sha256
     29 jar.sha512
     29 module
     29 module.md5
     29 module.sha1
     29 module.sha256
     29 module.sha512
     29 pom
     29 pom.md5
     29 pom.sha1
     29 pom.sha256
     29 pom.sha512
     58 xml
     58 xml.md5
     58 xml.sha1
     58 xml.sha256
     58 xml.sha512

@blackwinter blackwinter assigned dr0i and unassigned blackwinter Feb 16, 2024
dr0i added a commit that referenced this pull request Feb 29, 2024
- remove "artifacts" and add "artifact" to have javadoc and sources build
- invoke `./gradlew publishToMavenLocal`: build and sign artifacts and put
  these into local maven repository
- invoke `./gradlew publishToSonatype` to build, sign and upload artifacts
  to sonatype
dr0i added a commit that referenced this pull request Feb 29, 2024
Executing `./gradlew metafacture-runner:signArchives` builds signed
distributions in metafacture-core/metafacture-runner/build/distributions/.
build.gradle Outdated Show resolved Hide resolved
build.gradle Outdated Show resolved Hide resolved
dr0i added a commit to dr0i/metafacture-core that referenced this pull request Feb 29, 2024
- add how to build and use distribution
- fix formatting
- remove "artifacts" and add "artifact" to have javadoc and sources build
- invoke `./gradlew publishToMavenLocal`: build and sign artifacts and put
  these into local maven repository
- invoke `./gradlew publishToSonatype` to build, sign and upload artifacts
  to sonatype
Executing `./gradlew metafacture-runner:signArchives` builds signed
distributions in metafacture-core/metafacture-runner/build/distributions/.
- add how to build and use distribution
- fix formatting
@dr0i
Copy link
Member

dr0i commented Feb 29, 2024

localEmbedded is good to be removed 👍
Switched to the newer gradle-nexus publish-plugin and added signing to distributions.
Wiki pages have to be updated accordingly if merged.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@blackwinter
Copy link
Member Author

Wiki pages have to be updated accordingly if merged.

I'm unclear as to what your removal of snapshotRepositoryUrl entails (see b7d0409). Will you update the Maintainer Guidelines? Or can you give me instructions on what to change specifically?

dr0i and others added 3 commits February 29, 2024 16:18
Co-authored-by: Jens Wille <[email protected]>
Co-authored-by: Jens Wille <[email protected]>
Co-authored-by: Jens Wille <[email protected]>
@dr0i
Copy link
Member

dr0i commented Feb 29, 2024

Re snapshotRepositoryUrl : see https://github.com/gradle-nexus/publish-plugin?tab=readme-ov-file#publishing-to-maven-central-via-sonatype-ossrh . I will update Maintainer Guidelines.

@blackwinter blackwinter merged commit cfafdea into master Feb 29, 2024
1 check passed
@blackwinter blackwinter deleted the 484-gradle8 branch February 29, 2024 15:31
@dr0i
Copy link
Member

dr0i commented Mar 4, 2024

Updated Maintainer Guidelines.

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.

Upgrade Gradle version and clean up build.
3 participants