Skip to content

Commit

Permalink
Add KMP target for iosSimulatorArm64
Browse files Browse the repository at this point in the history
  • Loading branch information
bnvinay92 committed Aug 4, 2022
1 parent d37a82a commit 76e7da5
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 43 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.squareup.workflow1.buildsrc

import org.gradle.kotlin.dsl.getValue
import org.gradle.kotlin.dsl.getting
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension

fun KotlinMultiplatformExtension.iosWithSimulatorArm64() {
ios()
iosSimulatorArm64()

val iosMain by sourceSets.getting
val iosSimulatorArm64Main by sourceSets.getting
iosSimulatorArm64Main.dependsOn(iosMain)

val iosTest by sourceSets.getting
val iosSimulatorArm64Test by sourceSets.getting
iosSimulatorArm64Test.dependsOn(iosTest)
}
10 changes: 10 additions & 0 deletions buildSrc/src/main/java/kotlin-multiplatform.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,14 @@ extensions.getByType(JavaPluginExtension::class).apply {
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlin {
sourceSets {
all {
languageSettings.apply {
optIn("kotlin.RequiresOptIn")
}
}
}
}

project.kotlinCommonSettings(bomConfigurationName = "commonMainImplementation")
36 changes: 13 additions & 23 deletions workflow-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
import com.squareup.workflow1.buildsrc.iosWithSimulatorArm64

plugins {
`kotlin-multiplatform`
published
}

kotlin {
iosWithSimulatorArm64()
jvm { withJava() }
ios()
}

dependencies {
commonMainApi(libs.kotlin.jdk6)
commonMainApi(libs.kotlinx.coroutines.core)
// For Snapshot.
commonMainApi(libs.squareup.okio)

sourceSets {
all {
languageSettings.apply {
optIn("kotlin.RequiresOptIn")
}
}
val commonMain by getting {
dependencies {
api(libs.kotlin.jdk6)
api(libs.kotlinx.coroutines.core)
// For Snapshot.
api(libs.squareup.okio)
}
}
val commonTest by getting {
dependencies {
implementation(libs.kotlin.test.jdk)
implementation(libs.kotlinx.atomicfu)
implementation(libs.kotlinx.coroutines.test.common)
}
}
}
commonTestImplementation(libs.kotlinx.atomicfu)
commonTestImplementation(libs.kotlinx.coroutines.test.common)
commonTestImplementation(libs.kotlin.test.jdk)
}
28 changes: 8 additions & 20 deletions workflow-runtime/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import com.squareup.workflow1.buildsrc.iosWithSimulatorArm64
import kotlinx.benchmark.gradle.JvmBenchmarkTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

Expand All @@ -8,6 +9,7 @@ plugins {
}

kotlin {
iosWithSimulatorArm64()
jvm {
compilations {
val main by getting
Expand All @@ -26,28 +28,14 @@ kotlin {
}
}
}
ios()
}

sourceSets {
all {
languageSettings.apply {
optIn("kotlin.RequiresOptIn")
}
}
val commonMain by getting {
dependencies {
api(libs.kotlinx.coroutines.core)
dependencies {
commonMainApi(project(":workflow-core"))
commonMainApi(libs.kotlinx.coroutines.core)

api(project(":workflow-core"))
}
}
val commonTest by getting {
dependencies {
implementation(libs.kotlin.test.jdk)
implementation(libs.kotlinx.coroutines.test.common)
}
}
}
commonTestImplementation(libs.kotlinx.coroutines.test.common)
commonTestImplementation(libs.kotlin.test.jdk)
}

benchmark {
Expand Down

0 comments on commit 76e7da5

Please sign in to comment.