Revert "[kotlin-gradle-plugin] workaround for old k/n artifacts"
This reverts commit 5c80dbfd
This commit is contained in:
+3
-41
@@ -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
|
private val dependencyNameWithVersion: String
|
||||||
get() = "$dependencyName-$versionStringRepresentation"
|
get() = "$dependencyName-$compilerVersion"
|
||||||
|
|
||||||
private val dependencyFileName: String
|
private val dependencyFileName: String
|
||||||
get() = "$dependencyNameWithVersion.$archiveExtension"
|
get() = "$dependencyNameWithVersion.$archiveExtension"
|
||||||
@@ -138,7 +100,7 @@ class NativeCompilerDownloader(
|
|||||||
val repoUrl = buildString {
|
val repoUrl = buildString {
|
||||||
append("$BASE_DOWNLOAD_URL/")
|
append("$BASE_DOWNLOAD_URL/")
|
||||||
append(if (compilerVersion.meta == MetaVersion.DEV) "dev/" else "releases/")
|
append(if (compilerVersion.meta == MetaVersion.DEV) "dev/" else "releases/")
|
||||||
append("$versionStringRepresentation/")
|
append("$compilerVersion/")
|
||||||
append(simpleOsName)
|
append(simpleOsName)
|
||||||
}
|
}
|
||||||
val dependencyUrl = "$repoUrl/$dependencyFileName"
|
val dependencyUrl = "$repoUrl/$dependencyFileName"
|
||||||
@@ -148,7 +110,7 @@ class NativeCompilerDownloader(
|
|||||||
val compilerDependency = project.dependencies.create(
|
val compilerDependency = project.dependencies.create(
|
||||||
mapOf(
|
mapOf(
|
||||||
"name" to dependencyName,
|
"name" to dependencyName,
|
||||||
"version" to versionStringRepresentation,
|
"version" to compilerVersion.toString(),
|
||||||
"ext" to archiveExtension
|
"ext" to archiveExtension
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user