From 6816da044a55e967bd897176302b491febaa39b0 Mon Sep 17 00:00:00 2001 From: Igor Manushin Date: Tue, 17 Dec 2019 22:10:13 +0000 Subject: [PATCH] Extract common jvm target value, add jvmTarget into documentation. Close #2157 (#2183) --- README.md | 6 ++++++ build.gradle.kts | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index eae45900c..7e5b9b316 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,12 @@ detekt { filters = ".*/resources/.*,.*/build/.*" baseline = file("my-detekt-baseline.xml") // Just if you want to create a baseline file. } + +tasks { + withType { + this.jvmTarget = "1.8" + } +} ``` See [bintray](https://bintray.com/arturbosch/code-analysis/detekt) for releases and [artifactory](https://oss.jfrog.org/artifactory/webapp/#/artifacts/browse/tree/General/oss-snapshot-local/io/gitlab/arturbosch/detekt/detekt-cli/) for snapshots. diff --git a/build.gradle.kts b/build.gradle.kts index 590446cb4..21dd2336d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -103,10 +103,12 @@ subprojects { jacoco.toolVersion = jacocoVersion } + val projectJvmTarget = "1.8" + tasks.withType().configureEach { exclude("resources/") exclude("build/") - jvmTarget = "1.8" + jvmTarget = projectJvmTarget } val userHome = System.getProperty("user.home") @@ -164,7 +166,7 @@ subprojects { } tasks.withType().configureEach { - kotlinOptions.jvmTarget = "1.8" + kotlinOptions.jvmTarget = projectJvmTarget // https://youtrack.jetbrains.com/issue/KT-24946 kotlinOptions.freeCompilerArgs = listOf( "-progressive",