Skip to content

Commit

Permalink
Add multi-compile support to test dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
TadeasKriz committed Aug 6, 2024
1 parent 07b4435 commit 81725fa
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
2 changes: 1 addition & 1 deletion SKIE/acceptance-tests
Original file line number Diff line number Diff line change
Expand Up @@ -169,24 +169,35 @@ data class MultiCompileTarget(
},
)

val allDarwin = listOf(
val allIos = listOf(
iosArm32,
iosArm64,
iosX64,
iosSimulatorArm64,
)

val allWatchos = listOf(
watchosArm32,
watchosArm64,
watchosX86,
watchosX64,
watchosSimulatorArm64,
watchosDeviceArm64,
)

val allTvos = listOf(
tvosArm64,
tvosX64,
tvosSimulatorArm64,
)

val allMacos = listOf(
macosX64,
macosArm64,
)

val allDarwin = allIos + allWatchos + allTvos + allMacos

val all = allDarwin + listOf(
jvm,
js,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package co.touchlab.skie.buildsetup.plugins

import co.touchlab.skie.buildsetup.plugins.MultiCompileTarget.Companion.kotlin_1_9_0
import co.touchlab.skie.buildsetup.tasks.BuildNestedGradle
import co.touchlab.skie.gradle.KotlinCompilerVersion
import co.touchlab.skie.gradle.KotlinToolingVersion
Expand Down Expand Up @@ -55,6 +56,7 @@ class SkieMultiCompileRuntime: Plugin<Project> {
val buildTask = registerBuildTask(
name = kotlinToolingVersion.primaryVersion.toString(),
supportedTargetsWithDeclarations = supportedTargetsWithDeclarations,
kotlinVersion = kotlinToolingVersion.primaryVersion,
copyTask = copyTask,
)

Expand Down Expand Up @@ -176,6 +178,7 @@ class SkieMultiCompileRuntime: Plugin<Project> {

private fun Project.registerBuildTask(
name: String,
kotlinVersion: KotlinToolingVersion,
supportedTargetsWithDeclarations: SupportedTargetsWithDeclarations,
copyTask: TaskProvider<Copy>,
): TaskProvider<BuildNestedGradle> {
Expand All @@ -188,14 +191,20 @@ class SkieMultiCompileRuntime: Plugin<Project> {

tasks.set(
supportedTargetsWithDeclarations.flatMap { (target, _) ->
listOf(
"generateMetadataFileFor${target.capitalizedName}Publication",
"generatePomFileFor${target.capitalizedName}Publication",
)
} + listOf(
"generateMetadataFileForKotlinMultiplatformPublication",
"generatePomFileForKotlinMultiplatformPublication",
)
when (target.platformType) {
KotlinPlatformType.common -> listOf("metadataMainClasses")
KotlinPlatformType.jvm, KotlinPlatformType.androidJvm -> listOf("${target.name}Jar")
KotlinPlatformType.js -> if (kotlinVersion >= kotlin_1_9_0) {
listOf("${target.name}Jar")
} else {
listOf(
"${target.name}IrJar",
"${target.name}LegacyJar",
)
}
KotlinPlatformType.native, KotlinPlatformType.wasm -> listOf("${target.name}MainKlibrary")
}
}
)
}
}
Expand Down

0 comments on commit 81725fa

Please sign in to comment.