[gradle-plugin] Fix version according to the new versioning system
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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']
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user