Skip to content

Commit

Permalink
feat(multiplatform): add iOS targets to build configurations
Browse files Browse the repository at this point in the history
Extended build configurations to include iosArm64 and iosSimulatorArm64 targets across multiple modules, enhancing iOS platform support for the Kotlin Multiplatform Mobile (KMM) projects.
  • Loading branch information
hanrw committed Jan 9, 2025
1 parent a9d5c4b commit 7d063e6
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 33 deletions.
3 changes: 2 additions & 1 deletion anthropic-client/anthropic-client-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ plugins {
kotlin {
jvm()
macosArm64()
macosX64()
iosArm64()
iosSimulatorArm64()

sourceSets {
commonMain.dependencies {
Expand Down
23 changes: 13 additions & 10 deletions anthropic-client/anthropic-client-darwin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ plugins {
kotlin {
listOf(
macosArm64(),
macosX64()
iosArm64(),
iosSimulatorArm64()
).forEach { macosTarget ->
macosTarget.binaries.framework {
baseName = "anthropic-client-darwin"
Expand Down Expand Up @@ -36,14 +37,16 @@ kmmbridge {
* In kmmbridge, notice mavenPublishArtifacts() tells the plugin to push KMMBridge artifacts to a Maven repo. You then need to define a repo. Rather than do everything manually, you can just call addGithubPackagesRepository(), which will add the correct repo given parameters that are passed in from GitHub Actions.
*/
mavenPublishArtifacts() // <- Publish using a Maven repo
// spm {
// swiftToolsVersion = "5.9"
// platforms {
// iOS("14")
// macOS("13")
// watchOS("7")
// tvOS("14")
// }
// }
/**
* https://github.com/touchlab/KMMBridge/issues/258
*/
spm(
swiftToolVersion = "5.9",
useCustomPackageFile = true,
perModuleVariablesBlock = true
) {
iOS { v("18") }
macOS { v("15") }
}
}

3 changes: 2 additions & 1 deletion common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ plugins {
kotlin {
jvm()
macosArm64()
macosX64()
iosArm64()
iosSimulatorArm64()

sourceSets {
commonMain.dependencies {
Expand Down
3 changes: 2 additions & 1 deletion gemini-client/gemini-client-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ plugins {

kotlin {
jvm()
iosArm64()
iosSimulatorArm64()
macosArm64()
macosX64()

sourceSets {
commonMain {
Expand Down
29 changes: 16 additions & 13 deletions gemini-client/gemini-client-darwin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ plugins {
kotlin {
listOf(
macosArm64(),
macosX64()
iosArm64(),
iosSimulatorArm64()
).forEach { macosTarget ->
macosTarget.binaries.framework {
baseName = "gemini-client-darwin"
export(projects.geminiClient.geminiClientCore)
baseName = "geminiClientDarwin"
isStatic = true
}
}
Expand All @@ -30,20 +31,22 @@ kotlin {

addGithubPackagesRepository() // <- Add the GitHub Packages repo


kmmbridge {
/**
* reference: https://kmmbridge.touchlab.co/docs/artifacts/MAVEN_REPO_ARTIFACTS#github-packages
* In kmmbridge, notice mavenPublishArtifacts() tells the plugin to push KMMBridge artifacts to a Maven repo. You then need to define a repo. Rather than do everything manually, you can just call addGithubPackagesRepository(), which will add the correct repo given parameters that are passed in from GitHub Actions.
*/
mavenPublishArtifacts() // <- Publish using a Maven repo
// spm(swiftToolVersion = "5.9")
// spm {
// swiftToolsVersion = "5.9"
// platforms {
// iOS("14")
// macOS("13")
// watchOS("7")
// tvOS("14")
// }
// }
}
/**
* https://github.com/touchlab/KMMBridge/issues/258
*/
spm(
swiftToolVersion = "5.9",
// useCustomPackageFile = true,
// perModuleVariablesBlock = true
) {
iOS { v("15") }
// macOS { v("15") }
}
}
3 changes: 2 additions & 1 deletion ollama-client/ollama-client-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ plugins {
kotlin {
jvm()
macosArm64()
macosX64()
iosArm64()
iosSimulatorArm64()

sourceSets {
commonMain.dependencies {
Expand Down
3 changes: 2 additions & 1 deletion ollama-client/ollama-client-darwin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ plugins {
kotlin {
listOf(
macosArm64(),
macosX64()
iosArm64(),
iosSimulatorArm64()
).forEach { macosTarget ->
macosTarget.binaries.framework {
baseName = "ollama-client-darwin"
Expand Down
4 changes: 2 additions & 2 deletions openai-client/openai-client-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ plugins {
kotlin {
jvm()
macosArm64()
macosX64()

iosArm64()
iosSimulatorArm64()
sourceSets {
commonMain.dependencies {
// put your Multiplatform dependencies here
Expand Down
3 changes: 2 additions & 1 deletion openai-client/openai-client-darwin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ plugins {
kotlin {
listOf(
macosArm64(),
macosX64()
iosArm64(),
iosSimulatorArm64()
).forEach { macosTarget ->
macosTarget.binaries.framework {
baseName = "openai-client-darwin"
Expand Down
3 changes: 2 additions & 1 deletion openai-gateway/openai-gateway-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ plugins {
kotlin {
jvm()
macosArm64()
macosX64()
iosArm64()
iosSimulatorArm64()

sourceSets {
commonMain.dependencies {
Expand Down
3 changes: 2 additions & 1 deletion openai-gateway/openai-gateway-darwin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ plugins {
kotlin {
listOf(
macosArm64(),
macosX64()
iosArm64(),
iosSimulatorArm64()
).forEach { macosTarget ->
macosTarget.binaries.framework {
baseName = "openai-gateway-darwin"
Expand Down

0 comments on commit 7d063e6

Please sign in to comment.