Revert simpleOsName in HostManager

Support old naming in simpleOsName.
Introduce new platformName method for the new archive naming.
This commit is contained in:
Pavel Punegov
2021-06-02 14:14:10 +03:00
parent 1f837134bb
commit 789799ac17
5 changed files with 13 additions and 7 deletions

View File

@@ -480,7 +480,7 @@ task bundle {
}
task bundleRegular(type: (isWindows()) ? Zip : Tar) {
def simpleOsName = HostManager.simpleOsName()
def simpleOsName = HostManager.platformName()
archiveBaseName.set("kotlin-native-$simpleOsName-$konanVersionFull")
from(UtilsKt.getKotlinNativeDist(project)) {
include '**'
@@ -501,7 +501,7 @@ task bundleRegular(type: (isWindows()) ? Zip : Tar) {
task bundlePrebuilt(type: (isWindows()) ? Zip : Tar) {
dependsOn("crossDistPlatformLibs")
def simpleOsName = HostManager.simpleOsName()
def simpleOsName = HostManager.platformName()
archiveBaseName.set("kotlin-native-prebuilt-$simpleOsName-$konanVersionFull")
from(UtilsKt.getKotlinNativeDist(project)) {
include '**'
@@ -539,7 +539,7 @@ configure([bundleRegular, bundlePrebuilt]) {
task 'tc-dist'(type: (isWindows()) ? Zip : Tar) {
dependsOn('dist')
dependsOn('distSources')
def simpleOsName = HostManager.simpleOsName()
def simpleOsName = HostManager.platformName()
archiveBaseName.set("kotlin-native-dist-$simpleOsName-$konanVersionFull")
from(UtilsKt.getKotlinNativeDist(project)) {
include '**'
@@ -613,7 +613,7 @@ task uploadBundle {
server: project.findProperty("cdnUrl") ?: System.getenv("CDN_URL"),
userid: project.findProperty("cdnUser") ?: System.getenv("CDN_USER"),
password: project.findProperty("cdnPass") ?: System.getenv("CDN_PASS"),
remoteDir: "/builds/$kind/$konanVersion/${HostManager.simpleOsName()}"
remoteDir: "/builds/$kind/$konanVersion/${HostManager.platformName()}"
]
ant {
taskdef(name: 'ftp',

View File

@@ -43,7 +43,7 @@ internal val Project.host
get() = HostManager.host.visibleName
internal val Project.simpleOsName
get() = HostManager.simpleOsName()
get() = HostManager.platformName()
/** A task with a KonanTarget specified. */
abstract class KonanTargetableTask: DefaultTask() {

View File

@@ -52,7 +52,7 @@ class NativePlatformLibsIT : BaseGradleIT() {
private fun deleteInstalledCompilers() {
// Clean existing installation directories.
val osName = HostManager.simpleOsName()
val osName = HostManager.platformName()
val oldCompilerDir = DependencyDirectories.localKonanDir.resolve("kotlin-native-$osName-$oldCompilerVersion")
val currentCompilerDir = DependencyDirectories.localKonanDir.resolve("kotlin-native-$osName-$currentCompilerVersion")

View File

@@ -45,7 +45,7 @@ class NativeCompilerDownloader(
get() = NativeDistributionTypeProvider(project).getDistributionType(compilerVersion)
private val simpleOsName: String
get() = HostManager.simpleOsName()
get() = HostManager.platformName()
private val dependencyName: String
get() {

View File

@@ -168,6 +168,12 @@ open class HostManager(
@JvmStatic
fun simpleOsName(): String {
val hostOs = hostOs()
return if (hostOs == "osx") "macos" else hostOs
}
@JvmStatic
fun platformName(): String {
val hostOs = hostOs()
val arch = hostArch()
return when (hostOs) {