Skip to content

Commit 8a5d23c

Browse files
committed
Simplify build.gradle JavaCompile settings
1 parent b1f291e commit 8a5d23c

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

build.gradle

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@ ext.commit = System.getenv("GIT_COMMIT") ?: 'unknown'
2020

2121
// Source compiler configuration
2222
tasks.withType(JavaCompile) {
23-
options.compilerArgs += ['-Xlint:all', '-Xlint:-path']
24-
options.deprecation = true
25-
options.encoding = 'utf8'
23+
sourceCompatibility = 8
24+
targetCompatibility = 8
25+
options.with {
26+
deprecation = true
27+
encoding = 'UTF-8'
28+
compilerArgs << "-Xlint:all" << "-Xlint:-path" << "-Xlint:-processing"
29+
}
2630
}
2731

2832
repositories {
@@ -41,12 +45,6 @@ dependencies {
4145
provided 'com.github.javaparser:javaparser-core:2.3.0'
4246
}
4347

44-
tasks.withType(JavaCompile) {
45-
sourceCompatibility = 8
46-
targetCompatibility = 8
47-
options.compilerArgs << "-Xlint:all" << "-Xlint:-processing"
48-
}
49-
5048
jar {
5149
baseName = project.name
5250
duplicatesStrategy = DuplicatesStrategy.EXCLUDE

0 commit comments

Comments
 (0)