feat: ios support
This commit is contained in:
parent
d3edabce36
commit
b187b63195
8 changed files with 73 additions and 4 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
import java.net.URI
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.kotlinMultiplatform)
|
||||
|
|
@ -8,6 +9,7 @@ plugins {
|
|||
alias(libs.plugins.composeMultiplatform)
|
||||
alias(libs.plugins.composeCompiler)
|
||||
alias(libs.plugins.secretsGradle)
|
||||
alias(libs.plugins.spm)
|
||||
}
|
||||
|
||||
kotlin {
|
||||
|
|
@ -27,10 +29,17 @@ kotlin {
|
|||
iosArm64(),
|
||||
iosSimulatorArm64()
|
||||
).forEach { iosTarget ->
|
||||
iosTarget.compilations {
|
||||
getByName("main") {
|
||||
cinterops.create("spmMaplibre")
|
||||
}
|
||||
}
|
||||
iosTarget.binaries.framework {
|
||||
baseName = "ComposeApp"
|
||||
isStatic = true
|
||||
}
|
||||
// iosTarget.swiftPackageConfig(cinteropName = "banksia") {
|
||||
// }
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
|
@ -109,3 +118,15 @@ compose.resources {
|
|||
publicResClass = true
|
||||
packageOfResClass = "moe.lava.banksia.resources"
|
||||
}
|
||||
|
||||
swiftPackageConfig {
|
||||
create("spmMaplibre") {
|
||||
dependency {
|
||||
remotePackageVersion(
|
||||
url = URI("https://github.com/maplibre/maplibre-gl-native-distribution.git"),
|
||||
products = { add("MapLibre") },
|
||||
version = "6.17.1",
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
15
composeApp/src/swift/spmMaplibre/StartYourBridgeHere.swift
Normal file
15
composeApp/src/swift/spmMaplibre/StartYourBridgeHere.swift
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import Foundation
|
||||
/**
|
||||
This is a starting class to set up your bridge.
|
||||
Ensure that your class is public and has the @objcMembers / @objc annotation.
|
||||
This file has been created because the folder is empty.
|
||||
Ignore this file if you don't need it or set "spmforkmp.disableStartupFile=true" inside your gradle file
|
||||
**/
|
||||
|
||||
/**
|
||||
@objcMembers public class StartHere: NSObject {
|
||||
public override init() {
|
||||
super.init()
|
||||
}
|
||||
}
|
||||
**/
|
||||
Loading…
Add table
Add a link
Reference in a new issue