|
|
@ -1,12 +1,8 @@ |
|
|
|
import org.gradle.api.NamedDomainObjectContainer |
|
|
|
|
|
|
|
import org.gradle.api.Project |
|
|
|
import org.gradle.api.Project |
|
|
|
import org.gradle.api.artifacts.ProjectDependency |
|
|
|
import org.gradle.api.artifacts.ProjectDependency |
|
|
|
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension |
|
|
|
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension |
|
|
|
import org.jetbrains.kotlin.gradle.kpm.external.ExternalVariantApi |
|
|
|
|
|
|
|
import org.jetbrains.kotlin.gradle.kpm.external.project |
|
|
|
|
|
|
|
import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler |
|
|
|
import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler |
|
|
|
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet |
|
|
|
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet |
|
|
|
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetContainer |
|
|
|
|
|
|
|
import org.jetbrains.kotlin.gradle.plugin.extraProperties |
|
|
|
import org.jetbrains.kotlin.gradle.plugin.extraProperties |
|
|
|
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl |
|
|
|
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl |
|
|
|
|
|
|
|
|
|
|
@ -24,9 +20,9 @@ val Project.isFailingJsCase: Boolean |
|
|
|
get() = this.name.contains("-failingJs-") |
|
|
|
get() = this.name.contains("-failingJs-") |
|
|
|
|
|
|
|
|
|
|
|
val Project.isMingwX64Enabled: Boolean |
|
|
|
val Project.isMingwX64Enabled: Boolean |
|
|
|
get() = this.isInIdea |
|
|
|
get() = false //this.isInIdea |
|
|
|
|
|
|
|
|
|
|
|
@OptIn(ExternalVariantApi::class, ExperimentalWasmDsl::class) |
|
|
|
@OptIn(ExperimentalWasmDsl::class) |
|
|
|
fun KotlinMultiplatformExtension.configureTargets() { |
|
|
|
fun KotlinMultiplatformExtension.configureTargets() { |
|
|
|
jvm("desktop") |
|
|
|
jvm("desktop") |
|
|
|
configureJsTargets() |
|
|
|
configureJsTargets() |
|
|
@ -37,7 +33,7 @@ fun KotlinMultiplatformExtension.configureTargets() { |
|
|
|
macosX64() |
|
|
|
macosX64() |
|
|
|
macosArm64() |
|
|
|
macosArm64() |
|
|
|
// We use linux agents on CI. So it doesn't run the tests, but it builds the klib anyway which is time consuming. |
|
|
|
// We use linux agents on CI. So it doesn't run the tests, but it builds the klib anyway which is time consuming. |
|
|
|
if (project.isMingwX64Enabled) mingwX64() |
|
|
|
// if (project.isMingwX64Enabled) mingwX64() |
|
|
|
linuxX64() |
|
|
|
linuxX64() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -48,13 +44,11 @@ fun KotlinMultiplatformExtension.configureJsTargets() { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@OptIn(ExternalVariantApi::class) |
|
|
|
|
|
|
|
fun KotlinDependencyHandler.getLibDependencyForMain(): ProjectDependency { |
|
|
|
fun KotlinDependencyHandler.getLibDependencyForMain(): ProjectDependency { |
|
|
|
if (!project.name.endsWith("-main")) error("Unexpected main module name: ${project.name}") |
|
|
|
if (!project.name.endsWith("-main")) error("Unexpected main module name: ${project.name}") |
|
|
|
return project(":" + project.name.replace("-main", "-lib")) |
|
|
|
return project(":" + project.name.replace("-main", "-lib")) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@OptIn(ExternalVariantApi::class) |
|
|
|
|
|
|
|
fun KotlinDependencyHandler.getCommonLib(): ProjectDependency { |
|
|
|
fun KotlinDependencyHandler.getCommonLib(): ProjectDependency { |
|
|
|
return project(":common") |
|
|
|
return project(":common") |
|
|
|
} |
|
|
|
} |
|
|
|