Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package com.louiscad.complete_kotlin

import com.louiscad.complete_kotlin.internal.KotlinNativeCompilerInfo
import com.louiscad.complete_kotlin.internal.completePlatformKlibsIfNeeded
import org.gradle.api.Plugin
import org.gradle.api.Project
Expand Down Expand Up @@ -54,6 +55,9 @@ class CompleteKotlinPlugin : Plugin<Any> {
}

private fun setupIfNeeded(project: Project) {
if (project.rootProject.hasProperty("kotlin.native.distribution.baseDownloadUrl")) {
KotlinNativeCompilerInfo.buildUrl = project.rootProject.property("kotlin.native.distribution.baseDownloadUrl")?.toString() ?: ""
}
project.plugins.withId("org.jetbrains.kotlin.multiplatform") {
project.completePlatformKlibsIfNeeded()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ internal class KotlinNativeCompilerInfo(

companion object {
val konanDir = File(System.getProperty("user.home")).resolve(".konan")
val buildRawUrl = "https://complete-kotlin-prebuilt.louiscad.com/kotlin/native/builds"
var buildUrl = buildRawUrl
}

private val kindaSimpleOsName: String = when {
Expand All @@ -33,7 +35,7 @@ internal class KotlinNativeCompilerInfo(
val archiveExtension: String = if (useZip) "zip" else "tar.gz"

val repoUrl: String
get() = "https://complete-kotlin-prebuilt.louiscad.com/kotlin/native/builds".let { baseDownloadUrl ->
get() = buildUrl.ifEmpty { buildRawUrl }.let { baseDownloadUrl ->
val releasePath = when (compilerVersion.meta) {
MetaVersion.DEV -> "dev"
else -> "releases"
Expand Down