From b93da8749eb3da4527ce9a3b2837b6ef6068fb79 Mon Sep 17 00:00:00 2001 From: Nico Mexis Date: Thu, 22 Feb 2024 10:47:01 +0100 Subject: [PATCH] Add Java version switch --- buildSrc/src/main/groovy/dex2jar.build-conventions.gradle | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/groovy/dex2jar.build-conventions.gradle b/buildSrc/src/main/groovy/dex2jar.build-conventions.gradle index 776d20ae..5672a7b7 100644 --- a/buildSrc/src/main/groovy/dex2jar.build-conventions.gradle +++ b/buildSrc/src/main/groovy/dex2jar.build-conventions.gradle @@ -28,15 +28,16 @@ jar { } } +final javaVersion = JavaVersion.VERSION_1_8 java { - sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = targetCompatibility = javaVersion withSourcesJar() withJavadocJar() } javadoc { options.encoding = 'UTF-8' - options.source = '8' + options.source = javaVersion.majorVersion } dependencies { @@ -47,7 +48,7 @@ dependencies { [compileJava, compileTestJava]*.options.collect { options -> { options.encoding = 'UTF-8' - options.release.set(8) + options.release.set(javaVersion.majorVersion.toInteger()) } }