From 8b743c3eb587a890265b9d8e135981ef3e4582fc Mon Sep 17 00:00:00 2001 From: Edgar Asatryan Date: Thu, 31 Mar 2022 22:16:50 +0400 Subject: [PATCH] chore(build): Fix warning for unaligned target compatibility. --- buildSrc/build.gradle.kts | 8 ++------ ....github.nstdio.http.ext.library-conventions.gradle.kts | 6 +++--- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 2240915..666740d 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -14,8 +14,6 @@ * limitations under the License. */ -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - plugins { `kotlin-dsl` } @@ -32,8 +30,6 @@ dependencies { implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20-RC2") } -tasks.withType { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() - } +kotlinDslPluginOptions { + jvmTarget.set(provider { java.targetCompatibility.toString() }) } diff --git a/buildSrc/src/main/kotlin/io.github.nstdio.http.ext.library-conventions.gradle.kts b/buildSrc/src/main/kotlin/io.github.nstdio.http.ext.library-conventions.gradle.kts index 25275fa..7f911bc 100644 --- a/buildSrc/src/main/kotlin/io.github.nstdio.http.ext.library-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/io.github.nstdio.http.ext.library-conventions.gradle.kts @@ -25,6 +25,9 @@ plugins { group = "io.github.nstdio" java { + targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_11 + withJavadocJar() withSourcesJar() } @@ -49,9 +52,6 @@ dependencies { } tasks.withType().configureEach { - sourceCompatibility = JavaVersion.VERSION_11.toString() - targetCompatibility = JavaVersion.VERSION_11.toString() - options.encoding = "UTF-8" options.compilerArgs = listOf("-Xlint:all", "-Xlint:-deprecation") }