Commit 099e7038 authored by topjohnwu's avatar topjohnwu

Build compatible bytecode with newer JDKs

Fix #2898, close #2899
parent 1ededc63
...@@ -40,6 +40,16 @@ subprojects { ...@@ -40,6 +40,16 @@ subprojects {
maven { url "https://jitpack.io" } maven { url "https://jitpack.io" }
maven { url "http://oss.sonatype.org/content/repositories/snapshots" } 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 -> afterEvaluate { module ->
if (getPlugins().hasPlugin('com.android.library') || if (getPlugins().hasPlugin('com.android.library') ||
getPlugins().hasPlugin('com.android.application')) { getPlugins().hasPlugin('com.android.application')) {
......
#Sat Jun 20 05:36:13 PDT 2020
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment