|
18 | 18 |
|
19 | 19 | import com.diffplug.gradle.spotless.SpotlessExtension; |
20 | 20 | import com.diffplug.gradle.spotless.SpotlessPlugin; |
| 21 | +import com.diffplug.spotless.LineEnding; |
21 | 22 | import org.gradle.api.Plugin; |
22 | 23 | import org.gradle.api.Project; |
23 | 24 | import org.gradlex.conventions.base.LifecycleConventionsPlugin; |
@@ -45,16 +46,20 @@ public void apply(Project project) { |
45 | 46 | java.targetExclude("build/**"); |
46 | 47 | java.palantirJavaFormat(); |
47 | 48 | java.licenseHeader("// SPDX-License-Identifier: Apache-2.0\n", "package|import"); |
| 49 | + java.setLineEndings(LineEnding.UNIX); |
48 | 50 | }); |
| 51 | + // separate 'package-info' formatting due to https://github.com/diffplug/spotless/issues/532 |
49 | 52 | spotless.format("javaPackageInfoFiles", java -> { |
50 | | - java.targetExclude("build/**"); |
51 | | - // add a separate extension due to https://github.com/diffplug/spotless/issues/532 |
| 53 | + java.targetExclude("build"); |
52 | 54 | java.target("src/**/package-info.java"); |
53 | | - |
54 | 55 | java.licenseHeader("// SPDX-License-Identifier: Apache-2.0\n", "package|import|@"); |
| 56 | + java.setLineEndings(LineEnding.UNIX); |
55 | 57 | }); |
56 | 58 |
|
57 | 59 | // format the build itself |
58 | | - spotless.kotlinGradle(gradle -> gradle.ktfmt().kotlinlangStyle().configure(conf -> conf.setMaxWidth(120))); |
| 60 | + spotless.kotlinGradle(gradle -> { |
| 61 | + gradle.ktfmt().kotlinlangStyle().configure(conf -> conf.setMaxWidth(120)); |
| 62 | + gradle.setLineEndings(LineEnding.UNIX); |
| 63 | + }); |
59 | 64 | } |
60 | 65 | } |
0 commit comments