-
Notifications
You must be signed in to change notification settings - Fork 106
Expand file tree
/
Copy pathspotless.gradle
More file actions
44 lines (39 loc) · 972 Bytes
/
spotless.gradle
File metadata and controls
44 lines (39 loc) · 972 Bytes
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
// Spotless configuration
apply plugin: 'com.diffplug.spotless'
spotless {
// Format Gradle files
groovyGradle {
target fileTree('.') {
include '**/*.gradle'
exclude '**/build/**',
'**/generated/**',
'**/target/**',
'**/tmp/**',
'**/.mvn/**',
'**/demos/**/.mvn/**'
}
greclipse()
}
// Target all Java files within the project
java {
target fileTree('.') {
include '**/*.java'
exclude '**/build/**',
'**/generated/**',
'**/target/**',
'**/test/**',
'**/.mvn/**',
'**/demos/**/.mvn/**' // Skip build output, generated files, and .mvn folders
}
// Use Eclipse formatter with custom config
eclipse().configFile("${rootDir}/.spotless/roms-style.xml")
removeUnusedImports()
importOrder('java', 'javax', 'org', 'com', '')
}
lineEndings = 'UNIX'
encoding 'UTF-8'
}
// Add dependency for the Gradle task execution order
tasks.named('spotlessGroovyGradle') {
mustRunAfter 'spotlessJava'
}