From 1138978c22db1b308996f5701faa2423311cbf54 Mon Sep 17 00:00:00 2001 From: Emux Date: Thu, 3 Dec 2020 13:30:31 +0200 Subject: [PATCH] Use --release=7 for compiling the non-android libraries on Java >= 9 (#795) --- build.gradle | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.gradle b/build.gradle index ff9ed377..4cc8466c 100644 --- a/build.gradle +++ b/build.gradle @@ -50,5 +50,10 @@ subprojects { sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7 options.encoding = 'UTF-8' + if (JavaVersion.current().isJava9Compatible()) { + if (!project.properties.containsKey('android')) { + options.compilerArgs.addAll(['--release', '7']) + } + } } }