Skip to content

Commit a1e898f

Browse files
committed
Share common compiler args between src and test
Issue: SPR-15885
1 parent 3e2f6c8 commit a1e898f

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

build.gradle

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,19 @@ configure(allprojects) { project ->
9090
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
9191
}
9292

93-
def compilerArgs = [
94-
"-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile",
95-
"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
96-
"-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static",
97-
"-Xlint:try", "-Xlint:fallthrough", "-Xlint:rawtypes", "-Xlint:deprecation",
98-
"-Xlint:unchecked", "-Xlint:-options"
93+
def commonCompilerArgs = [
94+
"-Xlint:serial", "-Xlint:cast", "-Xlint:classfile", "-Xlint:dep-ann",
95+
"-Xlint:divzero", "-Xlint:empty", "-Xlint:finally", "-Xlint:overrides",
96+
"-Xlint:path", "-Xlint:processing", "-Xlint:static", "-Xlint:try", "-Xlint:-options"
9997
]
10098

101-
compileJava.options*.compilerArgs = compilerArgs + "-Werror"
99+
compileJava.options*.compilerArgs = commonCompilerArgs +
100+
["-Xlint:varargs", "-Xlint:fallthrough", "-Xlint:rawtypes",
101+
"-Xlint:deprecation", "-Xlint:unchecked", "-Werror"]
102102

103-
compileTestJava.options*.compilerArgs = compilerArgs
103+
compileTestJava.options*.compilerArgs = commonCompilerArgs +
104+
["-Xlint:-varargs", "-Xlint:-fallthrough","-Xlint:-rawtypes",
105+
"-Xlint:-deprecation", "-Xlint:-unchecked"]
104106

105107
compileJava {
106108
sourceCompatibility = 1.8

0 commit comments

Comments
 (0)