Allow overriding Gradle plugin version (#2304)

This commit is contained in:
Ilya Matveev
2018-11-09 10:55:47 +03:00
committed by GitHub
parent 504c76700f
commit d78c1a68a6
+25 -15
View File
@@ -36,7 +36,7 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.0' classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.0'
classpath "com.gradle.publish:plugin-publish-plugin:0.10.0" classpath "com.gradle.publish:plugin-publish-plugin:0.10.0"
} }
@@ -50,23 +50,33 @@ apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.johnrengelman.shadow' apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: "com.gradle.plugin-publish" apply plugin: "com.gradle.plugin-publish"
group = 'org.jetbrains.kotlin' String determineVersion() {
// With Gradle 4.10 we are no longer able to depend on
// a 'shared' build included into the root one and use the KonanVersion API provided
// by it. So we have to manually construct the version.
// TODO: Remove this code when 'shared' is built separately (from a separate repo).
def meta = findProperty('konanMetaVersion') ?: 'dev'
def overriddenVersion = findProperty('pluginVersionOverride') as String
// With Gradle 4.10 we are no longer able to depend on if (overriddenVersion != null && !overriddenVersion.empty) {
// a 'shared' build included into the root one and use the KonanVersion API provided return overriddenVersion
// by it. So we have to manually construct the version. }
// TODO: Remove this code when 'shared' is built separately (from a separate repo).
def meta = findProperty('konanMetaVersion') ?: 'dev' if (meta == 'release') {
if (meta == 'release') { return kotlinVersion
version = kotlinVersion } else {
} else { def buildNumber = findProperty("build.number")?.tokenize('-')?.get(2)
def buildNumber = findProperty("build.number")?.tokenize('-')?.get(2) def result = "$kotlinVersion-native-$konanVersion-$meta"
version = "$kotlinVersion-native-$konanVersion-$meta" if (buildNumber != null) {
if (buildNumber != null) { result += "-$buildNumber"
version += "-$buildNumber" }
return result
} }
} }
group = 'org.jetbrains.kotlin'
version = determineVersion()
repositories { repositories {
mavenCentral() mavenCentral()
maven { maven {
@@ -88,7 +98,7 @@ configurations {
} }
dependencies { dependencies {
shadow "org.jetbrains.kotlin:kotlin-stdlib:0.9.1-native" shadow "org.jetbrains.kotlin:kotlin-stdlib:1.3.0"
// Bundle the serialization plugin into the final jar because we shade classes of the kotlin plugin // Bundle the serialization plugin into the final jar because we shade classes of the kotlin plugin
// while the serialization one extends them. // while the serialization one extends them.