forked from diffplug/spotless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spotlessSelf.gradle
71 lines (69 loc) · 1.66 KB
/
spotlessSelf.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
buildscript {
repositories {
jcenter()
}
}
// applied by SelfTest
plugins {
id 'com.diffplug.gradle.spotless'
id 'java'
}
repositories { jcenter() }
spotless {
def noInternalDepsClosure = {
String text = it
/*
* No good way to get around using this import:
* https://github.com/gradle/gradle/issues/3191
*/
String regex = "import org\\.gradle\\.api\\.internal\\.(?!plugins\\.DslObject)"
if ((text.contains('import org.gradle.internal.') || text.find(regex)) &&
!text.contains('def noInternalDepsClosure')) {
throw new AssertionError("Accidental internal import")
}
}
java {
target fileTree('.') {
include '**/*.java'
exclude '_ext/*/build/**'
}
custom 'noInternalDeps', noInternalDepsClosure
bumpThisNumberIfACustomStepChanges(1)
licenseHeaderFile 'spotless.license'
importOrderFile 'spotless.importorder'
eclipse().configFile 'spotless.eclipseformat.xml'
trimTrailingWhitespace()
removeUnusedImports()
}
groovyGradle {
target fileTree('.') {
include '**/*.gradle'
exclude '_ext/**'
}
paddedCell()
custom 'noInternalDeps', noInternalDepsClosure
bumpThisNumberIfACustomStepChanges(3)
greclipse().configFile('spotless.eclipseformat.xml', 'spotless.groovyformat.prefs')
}
freshmark {
target '**/*.md'
propertiesFile('gradle.properties')
properties {
it.put('yes', ':+1:')
it.put('no', ':white_large_square:')
}
}
format 'misc', {
target '**/*.md', '**/*.gitignore'
indentWithSpaces(2)
trimTrailingWhitespace()
endWithNewline()
}
format 'xml', {
target fileTree('.') {
include '**/*.xml', '**/*.xsd'
exclude '**/build/**'
}
eclipseWtp('xml').configFile 'spotless.xmlformat.prefs'
}
}