compile options should be set after evaulation process

Signed-off-by: Shaka Huang <shakalaca@gmail.com>
This commit is contained in:
Shaka Huang 2020-06-27 14:29:22 +08:00 committed by John Wu
parent fc6ef7dd57
commit 4b8e92f00a

View File

@ -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 {