Remove bytecode compatibility workaround

This commit is contained in:
vvb2060 2021-11-25 14:45:29 +08:00 committed by John Wu
parent 65224ed22b
commit 7bd3e768db

View File

@ -8,11 +8,9 @@ import org.gradle.api.JavaVersion
import org.gradle.api.Project import org.gradle.api.Project
import org.gradle.api.tasks.StopExecutionException import org.gradle.api.tasks.StopExecutionException
import org.gradle.api.tasks.Sync import org.gradle.api.tasks.Sync
import org.gradle.api.tasks.compile.JavaCompile
import org.gradle.internal.os.OperatingSystem import org.gradle.internal.os.OperatingSystem
import org.gradle.kotlin.dsl.filter import org.gradle.kotlin.dsl.filter
import org.gradle.kotlin.dsl.named import org.gradle.kotlin.dsl.named
import org.gradle.kotlin.dsl.withType
import java.io.File import java.io.File
import java.io.OutputStream import java.io.OutputStream
import java.io.PrintStream import java.io.PrintStream
@ -41,15 +39,6 @@ fun Project.setupCommon() {
targetCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11
} }
} }
if (plugins.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.addAll(listOf("--release", "8"))
}
}
}
} }
private fun Project.setupAppCommon() { private fun Project.setupAppCommon() {