Skip to content

Commit

Permalink
insert ci check to separate arch on ci
Browse files Browse the repository at this point in the history
  • Loading branch information
RyuNen344 committed Sep 7, 2022
1 parent 9f04efe commit 83d18c4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
5 changes: 3 additions & 2 deletions app-ios-combined/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ kotlin {
)
val xcFrameworkName = "appioscombined"
val xcf = XCFramework(xcFrameworkName)
val sourceSets = listOf(iosX64(), iosArm64(), iosSimulatorArm64())
val isCI = System.getenv()["CI"]?.toBoolean() ?: false
val sourceSets = if (isCI) listOf(iosX64()) else listOf(iosX64(), iosArm64(), iosSimulatorArm64())
sourceSets.forEach {
it.binaries.framework {
baseName = xcFrameworkName
Expand All @@ -36,4 +37,4 @@ kotlin {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,32 @@ package io.github.droidkaigi.confsched2022.primitive

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework

@Suppress("unused")
class KmpIosPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
kotlin {
iosX64()
iosArm64()
iosSimulatorArm64()
val isCI = System.getenv()["CI"]?.toBoolean() ?: false
val iosMain = sourceSets.create("iosMain") {
dependsOn(sourceSets.getByName("commonMain"))
}
iosX64()
sourceSets.getByName("iosX64Main") {
dependsOn(iosMain)
}
sourceSets.getByName("iosArm64Main") {
dependsOn(iosMain)
}
sourceSets.getByName("iosSimulatorArm64Main") {
dependsOn(iosMain)
// make build speed faster on CI
if (!isCI) {
iosArm64()
iosSimulatorArm64()
sourceSets.getByName("iosArm64Main") {
dependsOn(iosMain)
}
sourceSets.getByName("iosSimulatorArm64Main") {
dependsOn(iosMain)
}
}
targets.withType<KotlinNativeTarget>().configureEach {
binaries.all {
Expand Down

0 comments on commit 83d18c4

Please sign in to comment.