Skip to content

Commit

Permalink
Build: Upgrade google-java-format to latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
manuzhang committed Aug 30, 2024
1 parent a07f862 commit baf5f09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
14 changes: 2 additions & 12 deletions baseline.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,7 @@ subprojects {
t.setDuplicatesStrategy(DuplicatesStrategy.WARN);
});
apply plugin: 'com.palantir.baseline-exact-dependencies'
// We need to update Google Java Format to 1.17.0+ to run spotless on JDK 8, but that requires dropping support for JDK 8.
if (JavaVersion.current() == JavaVersion.VERSION_21) {
task spotlessApply {
doLast {
throw new GradleException("Spotless plugin is currently disabled when running on JDK 21 (until we drop JDK 8). To run spotlessApply please use a different JDK version.")
}
}
} else {
apply plugin: 'com.diffplug.spotless'
}
apply plugin: 'com.diffplug.spotless'

pluginManager.withPlugin('com.palantir.baseline-checkstyle') {
checkstyle {
Expand All @@ -74,8 +65,7 @@ subprojects {
spotless {
java {
target 'src/main/java/**/*.java', 'src/test/java/**/*.java', 'src/testFixtures/java/**/*.java', 'src/jmh/java/**/*.java', 'src/integration/java/**/*.java'
// we use an older version of google-java-format that is compatible with JDK 8
googleJavaFormat("1.7")
googleJavaFormat()
removeUnusedImports()
licenseHeaderFile "$rootDir/.baseline/copyright/copyright-header-java.txt"
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ buildscript {
dependencies {
classpath 'io.github.goooler.shadow:shadow-gradle-plugin:8.1.8'
classpath 'com.palantir.baseline:gradle-baseline-java:5.61.0'
classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.13.0'
classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.24.0'
classpath 'gradle.plugin.org.inferred:gradle-processors:3.7.0'
classpath 'me.champeau.jmh:jmh-gradle-plugin:0.7.2'
classpath 'gradle.plugin.io.morethan.jmhreport:gradle-jmh-report:0.9.6'
Expand Down

0 comments on commit baf5f09

Please sign in to comment.