From a1e898fd39a776216adb01874c144b9174505d96 Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Tue, 22 Aug 2017 18:09:19 +0200 Subject: [PATCH] Share common compiler args between src and test Issue: SPR-15885 --- build.gradle | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 79bce1b424..625cd8adeb 100644 --- a/build.gradle +++ b/build.gradle @@ -90,17 +90,19 @@ configure(allprojects) { project -> resolutionStrategy.cacheChangingModulesFor 0, 'seconds' } - def compilerArgs = [ - "-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile", - "-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally", - "-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static", - "-Xlint:try", "-Xlint:fallthrough", "-Xlint:rawtypes", "-Xlint:deprecation", - "-Xlint:unchecked", "-Xlint:-options" + def commonCompilerArgs = [ + "-Xlint:serial", "-Xlint:cast", "-Xlint:classfile", "-Xlint:dep-ann", + "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally", "-Xlint:overrides", + "-Xlint:path", "-Xlint:processing", "-Xlint:static", "-Xlint:try", "-Xlint:-options" ] - compileJava.options*.compilerArgs = compilerArgs + "-Werror" + compileJava.options*.compilerArgs = commonCompilerArgs + + ["-Xlint:varargs", "-Xlint:fallthrough", "-Xlint:rawtypes", + "-Xlint:deprecation", "-Xlint:unchecked", "-Werror"] - compileTestJava.options*.compilerArgs = compilerArgs + compileTestJava.options*.compilerArgs = commonCompilerArgs + + ["-Xlint:-varargs", "-Xlint:-fallthrough","-Xlint:-rawtypes", + "-Xlint:-deprecation", "-Xlint:-unchecked"] compileJava { sourceCompatibility = 1.8