Skip to content

Commit df509d5

Browse files
committed
Update build.gradle and add checkstyle.xml
1. Update setting of 'scripts' as sourceSet. Original method caused issues with checkstyle. 2. Update checkstyle to use config/checkstyle/checkstyle.xml file, which is adapted from google-checks.xml. This allows for more granular control over checkstyle configurations.
1 parent 107229a commit df509d5

File tree

2 files changed

+378
-18
lines changed

2 files changed

+378
-18
lines changed

build.gradle

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
1-
/*
2-
* This file was generated by the Gradle 'init' task.
3-
*
4-
* This is a general purpose Gradle build.
5-
* To learn more about Gradle by exploring our Samples at https://docs.gradle.org/8.3/samples
6-
*/
71
plugins {
82
id 'java'
93
id "com.adarshr.test-logger" version "3.2.0"
104
id "checkstyle"
115
}
126

13-
sourceSets {
14-
main {
15-
java {
16-
srcDirs = ['src/main/java', 'scripts']
17-
}
18-
}
7+
sourceSets.main.java.srcDirs += ['scripts']
8+
9+
checkstyle {
10+
toolVersion = '10.2'
1911
}
2012

2113
repositories {
@@ -32,9 +24,3 @@ java {
3224
languageVersion = JavaLanguageVersion.of(11)
3325
}
3426
}
35-
36-
checkstyle {
37-
def archive = configurations.checkstyle.resolve().find { it.name.startsWith("checkstyle") }
38-
config = resources.text.fromArchiveEntry(archive, "google_checks.xml")
39-
}
40-

0 commit comments

Comments
 (0)