Skip to content

Commit

Permalink
Build: Use google-java-format 1.7 for JDK8 compatibility
Browse files Browse the repository at this point in the history
Given that CI runs builds with JDK 8 & 11, the google-java-format will
actually pick different google-java-format versions depending on the JDK
being used (JDK8=google-java-format 1.7 / JDK11=google-java-format
latest). Those different google-java-format version are actually
producing different formatting results, thus we have to use
google-java-format 1.7 here to make things consistent across JDK
versions.
  • Loading branch information
nastra authored and rdblue committed Jul 27, 2022
1 parent 6e7a5df commit 99b41eb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions baseline.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ subprojects {

pluginManager.withPlugin('com.diffplug.spotless') {
spotless {
// don't run spotlessCheck during gradle check task
enforceCheck = false
java {
target 'src/main/java/**/*.java', 'src/test/java/**/*.java', 'src/jmh/java/**/*.java'
googleJavaFormat()
// we use an older version of google-java-format that is compatible with JDK 8
googleJavaFormat("1.7")
removeUnusedImports()
licenseHeaderFile "$rootDir/.baseline/copyright/copyright-header-java.txt"
}
Expand Down

0 comments on commit 99b41eb

Please sign in to comment.