diff --git a/Changelog.md b/Changelog.md index 3541c260..bf4a0d1e 100644 --- a/Changelog.md +++ b/Changelog.md @@ -6,11 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## Fixed +- Use the same Kotlin version across runtime JAR files + +## [0.17.0] - 2020-08-25 ## Changed - Update _Kotlin_ plugin to 1.4.0, see [release notes](https://kotlinlang.org/docs/reference/whatsnew14.html#mixing-named-and-positional-arguments) - Update _kotlinter-gradle_ to version _3.0.0_, see [release notes](https://github.com/jeremymailen/kotlinter-gradle/releases/tag/3.0.0) -## [0.16.0] - 2020-08-25 +## [0.16.0] - 2020-08-24 ## Changed - Update _Detekt_ to version _1.11.2_ see [release notes](https://github.com/detekt/detekt/releases/tag/v1.11.2) diff --git a/build.gradle b/build.gradle index 147d4ea5..ab11f3cb 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,38 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + buildscript { repositories.google() + configurations.configureEach { + resolutionStrategy.eachDependency { details -> + if (details.requested.group == "org.jetbrains.kotlin") { + details.useVersion "1.4.0" + details.because "Runtime JAR files in the classpath should have the same version" + } + } + } } + plugins { - id 'com.starter.config' version '0.16.0' - id 'com.starter.versioning' version '0.16.0' + id 'com.starter.config' version '0.17.0' + id 'com.starter.versioning' version '0.17.0' } commonConfig { javaFilesAllowed false } + +allprojects { + tasks.withType(KotlinCompile).configureEach { + kotlinOptions { + apiVersion = '1.3' + } + } + configurations.configureEach { + resolutionStrategy.eachDependency { details -> + if (details.requested.group == "org.jetbrains.kotlin") { + details.useVersion "1.4.0" + details.because "Runtime JAR files in the classpath should have the same version" + } + } + } +} diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 89e655a2..caa201c7 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-gradle-plugin' id "org.jmailen.kotlinter" version "3.0.0" - id 'org.jetbrains.kotlin.jvm' version'1.3.72' + id 'org.jetbrains.kotlin.jvm' version '1.4.0' } repositories { @@ -10,10 +10,6 @@ repositories { gradlePluginPortal() } -tasks.named("lintKotlinMain") { - dependsOn("formatKotlin") -} - dependencies { implementation "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5" implementation "org.jetbrains.kotlin:kotlin-gradle-plugin" diff --git a/issuechecker/cli/src/main/kotlin/com/project/starter/issuechecker/cli/Main.kt b/issuechecker/cli/src/main/kotlin/com/project/starter/issuechecker/cli/Main.kt index f26f5f37..f893ba80 100644 --- a/issuechecker/cli/src/main/kotlin/com/project/starter/issuechecker/cli/Main.kt +++ b/issuechecker/cli/src/main/kotlin/com/project/starter/issuechecker/cli/Main.kt @@ -20,7 +20,9 @@ fun main(args: Array) { class IssueCheckerCli : CliktCommand() { private val source by option( - "--src", "-s", "--source", + "--src", + "-s", + "--source", help = "Source file filter, i.e. `--source **.java` to find all java files" ).default("**") private val githubToken by option(help = "Github token to check private issues") diff --git a/plugins/build.gradle b/plugins/build.gradle index e638fe75..628cd5fd 100644 --- a/plugins/build.gradle +++ b/plugins/build.gradle @@ -12,10 +12,6 @@ repositories { gradlePluginPortal() } -tasks.named('lintKotlinMain') { - dependsOn 'formatKotlin' -} - dependencies { api('org.jmailen.gradle:kotlinter-gradle:3.0.0') { // https://github.com/pinterest/ktlint/issues/678 diff --git a/plugins/src/main/kotlin/com/project/starter/quality/tasks/GenerateCheckstyleBaselineTask.kt b/plugins/src/main/kotlin/com/project/starter/quality/tasks/GenerateCheckstyleBaselineTask.kt index 99438ecb..219214f0 100644 --- a/plugins/src/main/kotlin/com/project/starter/quality/tasks/GenerateCheckstyleBaselineTask.kt +++ b/plugins/src/main/kotlin/com/project/starter/quality/tasks/GenerateCheckstyleBaselineTask.kt @@ -29,6 +29,7 @@ internal open class GenerateCheckstyleBaselineTask : DefaultTask() { if (all.isEmpty()) { baseline.delete() } else { + val suppressions = all.joinToString(separator = "") { "\t$it\n" } baseline.writeText( """ | @@ -36,7 +37,7 @@ internal open class GenerateCheckstyleBaselineTask : DefaultTask() { | "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN" | "https://checkstyle.org/dtds/suppressions_1_2.dtd"> | - |${all.joinToString(separator = "") { "\t$it\n" }} + |$suppressions | | """.trimMargin() diff --git a/sample/build.gradle b/sample/build.gradle index 7398e598..7366df5f 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -22,7 +22,7 @@ buildscript { } plugins { - id 'com.starter.config' version "0.16.0" + id 'com.starter.config' version "0.17.0" } commonConfig { diff --git a/settings.gradle b/settings.gradle index 53982d66..8a09ef62 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,10 @@ rootProject.name = 'com.project.starter' include ":plugins", "issuechecker", "issuechecker:cli" + +def isCiServer = System.getenv().containsKey("CI") + +buildCache { + local { + enabled = !isCiServer + } +}