Skip to content

Commit ec540cf

Browse files
rPramlgbrail
authored andcommitted
Made spotless as separate convention
1 parent d4691a4 commit ec540cf

2 files changed

Lines changed: 21 additions & 13 deletions

File tree

buildSrc/src/main/groovy/rhino.java-conventions.gradle

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
plugins {
66
id 'java-library'
7-
id 'com.diffplug.spotless'
7+
id 'rhino.spotless-conventions'
88
}
99

1010
int testJavaVersion = -1
@@ -56,15 +56,3 @@ test {
5656
useJUnitPlatform()
5757
}
5858

59-
spotless {
60-
// There is no version of googleJavaFormat that works for Java 11 and 17,
61-
// and different versions format differently. We're using a version that
62-
// requires at least Java 17.
63-
if (JavaVersion.current() >= JavaVersion.VERSION_17) {
64-
java {
65-
googleJavaFormat('1.23.0').aosp()
66-
}
67-
} else {
68-
System.out.println("Not running Spotless: Java language version is " + JavaVersion.current())
69-
}
70-
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// This file contains Gradle "conventions" that we use in all of our projects.
2+
// It is the appropriate set of conventions to use for modules that will not be
3+
// published, such as test modules.
4+
5+
plugins {
6+
id 'com.diffplug.spotless'
7+
}
8+
9+
spotless {
10+
// There is no version of googleJavaFormat that works for Java 11 and 17,
11+
// and different versions format differently. We're using a version that
12+
// requires at least Java 17.
13+
if (JavaVersion.current() >= JavaVersion.VERSION_17) {
14+
java {
15+
googleJavaFormat('1.23.0').aosp()
16+
}
17+
} else {
18+
System.out.println("Not running Spotless: Java language version is " + JavaVersion.current())
19+
}
20+
}

0 commit comments

Comments
 (0)