Skip to content

Commit

Permalink
fix: Use the same Kotlin version across runtime JAR files (#105)
Browse files Browse the repository at this point in the history
* docs: Update Changelog.md

* fix: Use the same Kotlin version across runtime JAR files

* chore(CI): Disable local build cache on the CI

* chore(workflow): Disable code format task
  • Loading branch information
mateuszkwiecinski authored Aug 25, 2020
1 parent 5917d95 commit 3da31fd
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 15 deletions.
6 changes: 5 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
31 changes: 29 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
6 changes: 1 addition & 5 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ fun main(args: Array<String>) {

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")
Expand Down
4 changes: 0 additions & 4 deletions plugins/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ internal open class GenerateCheckstyleBaselineTask : DefaultTask() {
if (all.isEmpty()) {
baseline.delete()
} else {
val suppressions = all.joinToString(separator = "") { "\t$it\n" }
baseline.writeText(
"""
|<?xml version="1.0"?>
|<!DOCTYPE suppressions PUBLIC
| "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
| "https://checkstyle.org/dtds/suppressions_1_2.dtd">
|<suppressions>
|${all.joinToString(separator = "") { "\t$it\n" }}
|$suppressions
|</suppressions>
|
""".trimMargin()
Expand Down
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ buildscript {
}

plugins {
id 'com.starter.config' version "0.16.0"
id 'com.starter.config' version "0.17.0"
}

commonConfig {
Expand Down
8 changes: 8 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
rootProject.name = 'com.project.starter'
include ":plugins", "issuechecker", "issuechecker:cli"

def isCiServer = System.getenv().containsKey("CI")

buildCache {
local {
enabled = !isCiServer
}
}

0 comments on commit 3da31fd

Please sign in to comment.