[gradle-plugin] Fix version according to the new versioning system

This commit is contained in:
Ilya Matveev
2018-04-24 17:13:34 +07:00
committed by ilmat192
parent 89d0886043
commit 36fe07e159
3 changed files with 24 additions and 6 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ buildscript {
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:+"
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:${project.property('konan.plugin.version')}"
}
}
konan.targets = ['macbook', 'linux']
@@ -17,7 +17,9 @@ open class VersionGenerator: DefaultTask() {
@Input get() = project.properties["konanVersion"].toString()
val buildNumber: String?
@Optional @Input get() = System.getenv("BUILD_NUMBER")
// TeamCity passes all configuration parameters into a build script as project properties.
// Thus we can use them here instead of environment variables.
@Optional @Input get() = project.findProperty("build.number")?.toString()
val meta: String
@Input get() = project.properties["konanMetaVersion"]?.let {
+20 -4
View File
@@ -42,7 +42,23 @@ apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.johnrengelman.shadow'
group = 'org.jetbrains.kotlin'
version = konanVersion
// Gradle doesn't allow using the KonanVersion class defined in `shared` from this build.
// TODO: Investigate if we can workaround this issue in better way.
def metaVersion = project.findProperty("konanMetaVersion")?.toString()?.toLowerCase() ?: "dev"
switch (metaVersion) {
case "dev":
// Use a full build number (e.g. 0.7-dev-123) for dev builds to distinguish them.
version = project.findProperty("build.number")?.toString() ?: konanVersion
break
case "rel":
// Use the version specified for the project (e.g. 0.7) in case of release builds.
version = konanVersion
break
default:
// Just append the meta-version in other cases, e.g. 0.7-rc1, 0.7-beta
version = "$konanVersion-$metaVersion"
}
repositories {
mavenCentral()
@@ -161,11 +177,11 @@ bintray {
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/JetBrains/kotlin-native'
version {
name = konanVersion
name = project.version
desc = "Kotlin Native Gradle plugin $konanVersion"
}
publish = true // project.hasProperty("publish")
override = project.hasProperty("override")
publish = project.hasProperty("bintrayPublish")
override = project.hasProperty("bintrayOverride")
}
publications = ['gradlePlugin']
}