Fix gradle plugin versioning and the plugin version used by samples

This commit is contained in:
Ilya Matveev
2018-04-25 12:29:23 +07:00
committed by ilmat192
parent 89cc1b3abb
commit bee7dcd704
10 changed files with 38 additions and 32 deletions
@@ -51,24 +51,32 @@ open class VersionGenerator: DefaultTask() {
| companion object {
| val CURRENT = KonanVersion($meta, $major, $minor, $maintenance, $build)
| }
| private val versionString by lazy {
| buildString {
| append(major)
| append('.')
| append(minor)
| if (maintenance != 0) {
| append('.')
| append(maintenance)
| }
| append('-')
| append(meta.metaString)
| if (build != -1) {
| append('-')
| append(build)
| }
| }
| private fun versionToString(showMeta: Boolean = true, showBuild: Boolean = true) = buildString {
| append(major)
| append('.')
| append(minor)
| if (maintenance != 0) {
| append('.')
| append(maintenance)
| }
| if (showMeta) {
| append('-')
| append(meta.metaString)
| }
| if (showBuild && build != -1) {
| append('-')
| append(build)
| }
| }
| private val versionString by lazy { versionToString(true, true) }
| override fun toString() = versionString
|
| val gradlePluginVersion by lazy {
| if (meta == MetaVersion.RELEASE)
| versionToString(false, false)
| else
| versionString
| }
|}
""".trimMargin()
}
@@ -28,5 +28,5 @@ enum class MetaVersion(val metaString:String) {
BETA("beta"),
RC1("rc1"),
RC2("rc2"),
REL("release")
RELEASE("release")
}