Revert "[kotlin-gradle-plugin] workaround for old k/n artifacts"

This reverts commit 5c80dbfd
This commit is contained in:
Pavel Punegov
2021-05-05 17:49:29 +03:00
parent a0d35e56a9
commit f82c28bd79
@@ -57,46 +57,8 @@ class NativeCompilerDownloader(
}
}
/**
* Once we've decide to make K/N version like K one (with droppable maintenance 0), but this breaks old publications,
* when did merging kotlin with kotlin/native after 1.5.0 release.
* older 1.5.20?
*/
private fun CompilerVersion.toStringPre1_5_20(showMeta: Boolean, showBuild: Boolean) = buildString {
if (major > 1
|| minor > 5
|| maintenance > 20
)
return toString(showMeta, showBuild)
append(major)
append('.')
append(minor)
if (maintenance != 0) {
append('.')
append(maintenance)
}
if (milestone != -1) {
append("-M")
append(milestone)
}
if (showMeta) {
append('-')
append(meta.metaString)
}
if (showBuild && build != -1) {
append('-')
append(build)
}
}
val versionStringRepresentation = compilerVersion.toStringPre1_5_20(
compilerVersion.meta != MetaVersion.RELEASE,
compilerVersion.meta != MetaVersion.RELEASE
)
private val dependencyNameWithVersion: String
get() = "$dependencyName-$versionStringRepresentation"
get() = "$dependencyName-$compilerVersion"
private val dependencyFileName: String
get() = "$dependencyNameWithVersion.$archiveExtension"
@@ -138,7 +100,7 @@ class NativeCompilerDownloader(
val repoUrl = buildString {
append("$BASE_DOWNLOAD_URL/")
append(if (compilerVersion.meta == MetaVersion.DEV) "dev/" else "releases/")
append("$versionStringRepresentation/")
append("$compilerVersion/")
append(simpleOsName)
}
val dependencyUrl = "$repoUrl/$dependencyFileName"
@@ -148,7 +110,7 @@ class NativeCompilerDownloader(
val compilerDependency = project.dependencies.create(
mapOf(
"name" to dependencyName,
"version" to versionStringRepresentation,
"version" to compilerVersion.toString(),
"ext" to archiveExtension
)
)