Skip to content
Merged
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
@@ -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() }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a quick comment here to look at the kotlin-multiplatform include for the other KMP targets?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imported the function from buildSrc instead.

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