File tree Expand file tree Collapse file tree 3 files changed +42
-33
lines changed Expand file tree Collapse file tree 3 files changed +42
-33
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,12 @@ repositories {
10
10
}
11
11
12
12
dependencies {
13
- implementation(" com.diffplug.spotless:spotless-plugin-gradle:6.18.0" )
14
13
implementation(" info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.9.11" )
15
14
implementation(" io.franzbecker:gradle-lombok:5.0.0" )
16
- implementation(" io.github.cosmicsilence:gradle-scalafix:0.1.14" )
15
+
16
+ // Spotless dropped Java 8 support in version 2.33.0
17
+ if (JavaVersion .current().isJava11Compatible) {
18
+ implementation(" com.diffplug.spotless:spotless-plugin-gradle:6.18.0" )
19
+ implementation(" io.github.cosmicsilence:gradle-scalafix:0.1.14" )
20
+ }
17
21
}
Original file line number Diff line number Diff line change
1
+ project. apply(plugin : " com.diffplug.spotless" )
2
+ project. apply(plugin : " io.github.cosmicsilence.scalafix" )
3
+
4
+ spotless {
5
+ java {
6
+ googleJavaFormat()
7
+ }
8
+ scala {
9
+ scalafmt(" 2.6.3" ). configFile(project. rootProject. file(" scalafmt.conf" ))
10
+ }
11
+ }
12
+
13
+ scalafix {
14
+ configFile. set(project. rootProject. file(" scalafix.conf" ))
15
+
16
+ // Work around dependency resolution issues in April 2022
17
+ semanticdb. autoConfigure. set(true )
18
+ semanticdb. version. set(" 4.5.5" )
19
+ }
20
+
21
+ project. dependencies. scalafix(" com.github.liancheng:organize-imports_2.13:0.6.0" )
22
+
23
+
24
+ project. afterEvaluate {
25
+ // These need to be in afterEvaluate due to this plugin
26
+ // being conditionally applied for Java 11+ only
27
+ project. tasks. spotlessApply. configure { dependsOn(project. tasks. scalafix) }
28
+ project. tasks. spotlessCheck. configure { dependsOn(project. tasks. checkScalafix) }
29
+
30
+ // Scalafix adds tasks in afterEvaluate, so their configuration must be deferred
31
+ project. tasks. scalafix. finalizedBy(project. tasks. spotlessApply)
32
+ project. tasks. checkScalafix. finalizedBy(project. tasks. spotlessCheck)
33
+ }
Original file line number Diff line number Diff line change 1
- plugins {
2
- id(" com.diffplug.spotless" )
3
- id(" io.github.cosmicsilence.scalafix" )
4
- }
5
-
6
- spotless {
7
- java {
8
- googleJavaFormat()
9
- }
10
- scala {
11
- scalafmt(" 2.6.3" ).configFile(project.rootProject.file(" scalafmt.conf" ))
12
- }
13
- }
14
-
15
- scalafix {
16
- configFile.set(project.rootProject.file(" scalafix.conf" ))
17
-
18
- // Work around dependency resolution issues in April 2022
19
- semanticdb.autoConfigure.set(true )
20
- semanticdb.version.set(" 4.5.5" )
21
- }
22
-
23
- project.dependencies.scalafix(" com.github.liancheng:organize-imports_2.13:0.6.0" )
24
-
25
- project.tasks.spotlessApply.configure { dependsOn(project.tasks[" scalafix" ]) }
26
- project.tasks.spotlessCheck.configure { dependsOn(project.tasks[" checkScalafix" ]) }
27
-
28
- // Scalafix adds tasks in afterEvaluate, so their configuration must be deferred
29
- project.afterEvaluate {
30
- project.tasks[" scalafix" ].finalizedBy(project.tasks.spotlessApply)
31
- project.tasks[" checkScalafix" ].finalizedBy(project.tasks.spotlessCheck)
1
+ // Spotless dropped Java 8 support in version 2.33.0
2
+ if (JavaVersion .current().isJava11Compatible) {
3
+ apply (plugin = " project-convention-code-formatting-internal" )
32
4
}
You can’t perform that action at this time.
0 commit comments