Skip to content

Commit

Permalink
Allow to switch between kotlin and kotlin-dev versions.
Browse files Browse the repository at this point in the history
Signed-off-by: Yahor Berdnikau <[email protected]>
  • Loading branch information
Tapchicoma committed Jul 21, 2020
1 parent f697547 commit 050f9e5
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
17 changes: 13 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.70' apply false
id 'com.vanniktech.maven.publish' version '0.8.0' apply false
id 'com.github.breadmoirai.github-release' version '2.2.12'
id 'org.jetbrains.kotlin.jvm' apply false
id 'com.github.breadmoirai.github-release'
}

ext.versions = [
'kotlin': '1.3.70',
'kotlin': gradle.ext.isKotlinDev ? '1.4-M2' : '1.3.70',
'gradle': '6.5'
]

Expand All @@ -23,6 +22,10 @@ ext.deps = [
'jimfs' : 'com.google.jimfs:jimfs:1.1'
]

if (gradle.ext.isKotlinDev) {
project.properties.put("VERSION_NAME", "0.38.0-kotlin-dev-SNAPSHOT")
}

configurations {
ktlint
}
Expand All @@ -41,6 +44,12 @@ task ktlint(type: JavaExec, group: LifecycleBasePlugin.VERIFICATION_GROUP) {
allprojects {
repositories {
mavenCentral()
gradlePluginPortal()

if (gradle.ext.isKotlinDev) {
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
maven { url 'https://kotlin.bintray.com/kotlinx' }
}
}

tasks.withType(JavaCompile) {
Expand Down
4 changes: 2 additions & 2 deletions ktlint/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import org.gradle.crypto.checksum.Checksum
plugins {
id 'org.jetbrains.kotlin.jvm'
id 'com.vanniktech.maven.publish'
id 'com.github.johnrengelman.shadow' version '5.0.0'
id 'org.gradle.crypto.checksum' version '1.1.0'
id 'com.github.johnrengelman.shadow'
id 'org.gradle.crypto.checksum'
}

jar {
Expand Down
18 changes: 18 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,25 @@ pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
if (settings.hasProperty('kotlinDev')) {
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
}
}

plugins {
def kotlinVersion = settings.hasProperty("kotlinDev") ? "1.4-M2" : "1.3.70"
id 'org.jetbrains.kotlin.jvm' version kotlinVersion
id 'com.vanniktech.maven.publish' version '0.8.0'
id 'com.github.breadmoirai.github-release' version '2.2.12'
id 'com.github.johnrengelman.shadow' version '5.0.0'
id 'org.gradle.crypto.checksum' version '1.1.0'
}
}

// Pass '-PkotlinDev' to command line to enable kotlin-in-development version
gradle.ext.isKotlinDev = settings.hasProperty("kotlinDev")
if (gradle.ext.isKotlinDev) {
logger.warn("Enabling kotlin dev version")
}

rootProject.name = 'ktlint'
Expand Down

0 comments on commit 050f9e5

Please sign in to comment.