Skip to content

Commit d8b8271

Browse files
committed
chore(build): add spotless for build files
1 parent f60624b commit d8b8271

File tree

5 files changed

+49
-2
lines changed

5 files changed

+49
-2
lines changed

build-logic/build.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,24 @@
77
plugins {
88
// Support convention plugins written in Groovy. Convention plugins are build scripts in 'src/main' that automatically become available as plugins in the main build.
99
id 'groovy-gradle-plugin'
10+
id 'com.diffplug.spotless'
1011
}
1112

1213
repositories {
1314
// Use the plugin portal to apply community plugins in convention plugins.
1415
gradlePluginPortal()
1516
}
17+
18+
spotless {
19+
encoding 'UTF-8'
20+
21+
groovy {
22+
importOrder('java|javax', 'org', 'com', 'com.diffplug', '', '\\#')
23+
removeSemicolons()
24+
greclipse()
25+
excludeJava()
26+
}
27+
groovyGradle {
28+
greclipse()
29+
}
30+
}

build-logic/settings.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
* This settings file is used to specify which projects to include in your build-logic build.
55
* This project uses @Incubating APIs which are subject to change.
66
*/
7+
plugins {
8+
// https://github.com/diffplug/spotless/blob/main/plugin-gradle/CHANGES.md
9+
id 'com.diffplug.spotless' version '7.0.2' apply false
10+
}
711

812
dependencyResolutionManagement {
913
// Reuse version catalog from the main build.
@@ -13,3 +17,4 @@ dependencyResolutionManagement {
1317
}
1418

1519
rootProject.name = 'build-logic'
20+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
plugins {
2+
id 'buildlogic.spotless-common-conventions'
3+
}
4+
5+
spotless {
6+
groovyGradle {
7+
greclipse()
8+
}
9+
}

build.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
plugins {
2+
id 'buildlogic.spotless-gradle-conventions'
3+
}
4+
5+
subprojects {
6+
apply plugin: 'buildlogic.spotless-gradle-conventions'
7+
}
8+
9+
allprojects {
10+
repositories {
11+
mavenCentral()
12+
}
13+
}

settings.gradle

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@
77
*/
88

99
pluginManagement {
10-
// Include 'plugins build' to define convention plugins.
11-
includeBuild('build-logic')
10+
// Include 'plugins build' to define convention plugins.
11+
includeBuild('build-logic')
12+
13+
repositories {
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
1217
}
1318

1419
plugins {

0 commit comments

Comments
 (0)