Skip to content

Commit 0fb2fbf

Browse files
committedJan 14, 2020
For a long time, we have done a weird workaround to apply spotless on spotless itself, because gradle didn't support bootstrapping. Now it does, so we don't have to do that weird thing, which is good because it was also very slow.
1 parent feaf747 commit 0fb2fbf

File tree

3 files changed

+16
-28
lines changed

3 files changed

+16
-28
lines changed
 

‎build.gradle

+5
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@ plugins {
1111
id 'org.jdrupes.mdoclet' version '1.0.5' apply false
1212
// https://github.com/spotbugs/spotbugs/releases
1313
id "com.github.spotbugs" version "2.0.0" apply false
14+
// here
15+
id 'com.diffplug.gradle.spotless' version '3.27.0'
1416
}
1517

18+
// this is... not the canonical way to do spotless :)
19+
apply from: 'spotlessSelf.gradle'
20+
1621
// root eclipse project
1722
apply plugin: 'com.diffplug.gradle.eclipse.resourcefilters'
1823
eclipseResourceFilters {

‎plugin-gradle/build.gradle

+10-15
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,19 @@ dependencies {
2828

2929
tasks.eclipse.dependsOn(pluginUnderTestMetadata)
3030

31-
/////////////////////
32-
// SPOTLESS (fake) //
33-
/////////////////////
34-
task spotlessCheck(type: JavaExec) {
35-
classpath sourceSets.test.runtimeClasspath
36-
main = 'com.diffplug.gradle.spotless.SelfTestCheck'
37-
}
38-
check.dependsOn(spotlessCheck)
39-
40-
task spotlessApply(type: JavaExec) {
41-
classpath sourceSets.test.runtimeClasspath
42-
main = 'com.diffplug.gradle.spotless.SelfTestApply'
43-
}
4431
test { testLogging.showStandardStreams = true }
4532

46-
test { useJUnit { excludeCategories 'com.diffplug.spotless.category.NpmTest' } }
33+
test {
34+
useJUnit {
35+
excludeCategories 'com.diffplug.spotless.category.NpmTest'
36+
}
37+
}
4738

48-
task npmTest(type: Test) { useJUnit { includeCategories 'com.diffplug.spotless.category.NpmTest' } }
39+
task npmTest(type: Test) {
40+
useJUnit {
41+
includeCategories 'com.diffplug.spotless.category.NpmTest'
42+
}
43+
}
4944

5045
//////////////////////////
5146
// GRADLE PLUGIN PORTAL //

‎spotlessSelf.gradle

+1-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
1-
buildscript {
2-
repositories {
3-
jcenter()
4-
}
5-
}
6-
7-
// applied by SelfTest
8-
plugins {
9-
id 'com.diffplug.gradle.spotless'
10-
id 'java'
11-
}
12-
13-
repositories { jcenter() }
1+
apply plugin: 'com.diffplug.gradle.spotless'
142
spotless {
153
def noInternalDepsClosure = {
164
String text = it

0 commit comments

Comments
 (0)