Skip to content

Commit

Permalink
add all targets for compose-runtime supported by kotlin-coroutines (#292
Browse files Browse the repository at this point in the history
)

* add watchOS and tvOS targets for compose-runtime

* add watchosArm32 to compose-runtime

* add mingwX64 and linuxX64 targets for compose runtime

Co-authored-by: Oleksandr Karpovich <oleksandr.karpovich@jetbrains.com>
  • Loading branch information
eymar and Oleksandr Karpovich committed Jan 13, 2023
1 parent ae5e63b commit c8a286f
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions compose/runtime/runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,20 @@ if(AndroidXComposePlugin.isMultiplatformEnabled(project)) {
}

kotlin {
// Not all modules can have these targets, so declare them here instead of androidXComposeMultiplatform.
// We can support the kotlin-native targets supported by kotlin coroutines:
// https://github.com/Kotlin/kotlinx.coroutines/blob/master/gradle/compile-native-multiplatform.gradle
watchosArm64()
watchosArm32()
watchosX86()
watchosX64()
watchosSimulatorArm64()
tvosArm64()
tvosX64()
tvosSimulatorArm64()
mingwX64()
linuxX64()

targets.js {
nodejs {
testTask {
Expand Down Expand Up @@ -134,6 +148,42 @@ if(AndroidXComposePlugin.isMultiplatformEnabled(project)) {
jsMain.dependsOn(jsNativeMain)
nativeMain.dependsOn(jsNativeMain)

linuxX64Main.dependsOn(nativeMain)
linuxX64Test.dependsOn(nativeTest)
mingwX64Main.dependsOn(nativeMain)
mingwX64Test.dependsOn(nativeTest)

def darwinMain = sourceSets.getByName("darwinMain")
def darwinTest = sourceSets.getByName("darwinTest")

def watchOsMain = sourceSets.create("watchOsMain")
def watchOsTest = sourceSets.create("watchOsTest")
watchOsMain.dependsOn(darwinMain)
watchOsTest.dependsOn(darwinTest)

watchosArm64Main.dependsOn(watchOsMain)
watchosArm64Test.dependsOn(watchOsTest)
watchosArm32Main.dependsOn(watchOsMain)
watchosArm32Test.dependsOn(watchOsTest)
watchosX86Main.dependsOn(watchOsMain)
watchosX86Test.dependsOn(watchOsTest)
watchosX64Main.dependsOn(watchOsMain)
watchosX64Test.dependsOn(watchOsTest)
watchosSimulatorArm64Main.dependsOn(watchOsMain)
watchosSimulatorArm64Test.dependsOn(watchOsTest)

def tvOsMain = sourceSets.create("tvOsMain")
def tvOsTest = sourceSets.create("tvOsTest")
tvOsMain.dependsOn(darwinMain)
tvOsTest.dependsOn(darwinTest)

tvosArm64Main.dependsOn(tvOsMain)
tvosArm64Test.dependsOn(tvOsTest)
tvosX64Main.dependsOn(tvOsMain)
tvosX64Test.dependsOn(tvOsTest)
tvosSimulatorArm64Main.dependsOn(tvOsMain)
tvosSimulatorArm64Test.dependsOn(tvOsTest)

jvmTest.dependencies {
implementation(libs.kotlinTestJunit)
implementation(libs.kotlinCoroutinesTest)
Expand Down

0 comments on commit c8a286f

Please sign in to comment.