From 4b8e92f00abe57c725674b62b2c51302b9b77d2d Mon Sep 17 00:00:00 2001 From: Shaka Huang Date: Sat, 27 Jun 2020 14:29:22 +0800 Subject: [PATCH] compile options should be set after evaulation process Signed-off-by: Shaka Huang --- build.gradle | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index 04ef40501..bd6630883 100644 --- a/build.gradle +++ b/build.gradle @@ -41,15 +41,6 @@ subprojects { maven { url "http://oss.sonatype.org/content/repositories/snapshots" } } - if (getPlugins().hasPlugin('java')) { - tasks.withType(JavaCompile) { - // If building with JDK 9+, we need additional flags to generate compatible bytecode - if (JavaVersion.current() > JavaVersion.VERSION_1_8) { - options.compilerArgs += ['--release', '8'] - } - } - } - afterEvaluate { module -> if (getPlugins().hasPlugin('com.android.library') || getPlugins().hasPlugin('com.android.application')) { @@ -70,6 +61,15 @@ subprojects { } } + if (getPlugins().hasPlugin('java')) { + tasks.withType(JavaCompile) { + // If building with JDK 9+, we need additional flags to generate compatible bytecode + if (JavaVersion.current() > JavaVersion.VERSION_1_8) { + options.compilerArgs += ['--release', '8'] + } + } + } + if (module.name == 'app' || module.name == 'stub') { android { signingConfigs {