palantir / palantir-java-format

A modern, lambda-friendly, 120 character Java formatter.
Apache License 2.0
407 stars 43 forks source link

Upgrade to Gradle 8 #1011

Closed mandrean closed 2 months ago

mandrean commented 5 months ago

Seems to work for me?

❯ cd ~/src/github.com/palantir/palantir-java-format

❯ java -version
openjdk version "21" 2023-09-19 LTS
OpenJDK Runtime Environment Temurin-21+35 (build 21+35-LTS)
OpenJDK 64-Bit Server VM Temurin-21+35 (build 21+35-LTS, mixed mode)

❯ gradle -version
------------------------------------------------------------
Gradle 8.5
------------------------------------------------------------

Build time:   2023-11-29 14:08:57 UTC
Revision:     28aca86a7180baa17117e0e5ba01d8ea9feca598

Kotlin:       1.9.20
Groovy:       3.0.17
Ant:          Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM:          21 (Eclipse Adoptium 21+35-LTS)
OS:           Mac OS X 14.3 aarch64

❯ gradle spotlessApply

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.5/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 532ms
15 actionable tasks: 15 up-to-date
palantirtech commented 5 months ago

Thanks for your interest in palantir/palantir-java-format, @mandrean! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

koppor commented 4 months ago

@mandrean A gradle wrapper update also involves updating gradlew, gradlew.sh, and the .jar file. These updates are not included in your PR. - Simply calling the spotlessApply task is not enough. You need to build and test the plugin using ./gradlew check.

My output is:

$ gradle check
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\git-repositories\palantir-java-format\idea-plugin\build.gradle' line: 18

* What went wrong:
A problem occurred evaluating project ':idea-plugin'.
> Failed to apply plugin 'org.jetbrains.intellij'.
   > Could not create task ':idea-plugin:buildPlugin'.
      > 'void org.gradle.api.internal.artifacts.publish.ArchivePublishArtifact.<init>(org.gradle.api.tasks.bundling.AbstractArchiveTask)'

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.5/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 17s

Note that I used my installed gradle version 8.5.

koppor commented 4 months ago

@mandrean Please create a pull request on your own repository (https://github.com/mandrean/palantir-java-format/pulls). Then, you GitHub actions of this repository will run. I am curious what the Gradle Wrapper Validation Action will say...

Update OMG, the validator validates the .jar only -- https://github.com/gradle/actions/issues/283

koppor commented 4 months ago

Related: Automatic update of gradle wrapper: https://github.com/palantir/palantir-java-format/pull/995

CRogers commented 2 months ago

Automation upgraded to Gradle 8: https://github.com/palantir/palantir-java-format/pull/1028