Piotr Prus
01/12/2024, 3:04 PMPablichjenkov
01/12/2024, 3:16 PM.binaryTarget("directory-where-shared-xcframework-is-located")
and I haven't found any major problems. The first time Xcode takes some time to import the shared
.xcframework into the local package but once it does it starts working ok.
What problems are you facing when using the above gradle task in the build phase script?Piotr Prus
01/12/2024, 3:20 PMPablichjenkov
01/12/2024, 3:20 PMPiotr Prus
01/12/2024, 3:21 PMPablichjenkov
01/12/2024, 3:21 PMPiotr Prus
01/12/2024, 3:24 PMbuild phase script
is run too latePablichjenkov
01/12/2024, 3:24 PMembedAndSign…
with assembleSharedDebug...
gradle tasks. See bellow:Pablichjenkov
01/12/2024, 3:26 PM.xcframework
works, is a condition impose by SPMPablichjenkov
01/12/2024, 3:29 PMthe way our project is structured is that all these spm modules (Core, Common, Vendor) are compiled before the app project. TheAhh I see, perhaps you can compile the kotlin code externally and just using the resulted xcframework binary. But the experince won’t be the same. Is the equivalent of development a library in java usingis run too latebuild phase script
mavenLocal
to test in a demo App. It would add some delay but perhaps not terrible.Piotr Prus
01/12/2024, 3:56 PMPiotr Prus
01/12/2024, 4:00 PMpackage.swift
Pablichjenkov
01/12/2024, 4:00 PMPiotr Prus
01/12/2024, 4:02 PMThomas Flad
02/05/2024, 2:23 PMPiotr Prus
02/12/2024, 6:54 PM./gradlew spmDevBuild -PspmBuildTargets=ios_simulator_arm64
2. I have both shared and iOS projects in the same root:
- MyProjects
-- iosProject
--- Packages/Core
-- shared-kmp
3. In the Package.swift
you have the dependencies array, something like:
var coreDependencies: [Package.Dependency] = [
.package(url: "<https://github.com/Alamofire/Alamofire>", exact: "5.8.1"),
.package(url: "<https://github.com/kasketis/netfox>", exact: "1.21.0"),
.package(url: "<https://github.com/evgenyneu/keychain-swift>", exact: "20.0.0"),
.package(url: "<https://github.com/marmelroy/PhoneNumberKit>", exact: "3.7.6")
]
and you can add new item to that array using append:
if remoteBuild {
coreDependencies.append(.package(url: "<https://github.com/myapp/shared-kmp>", exact: "0.1.4"))
} else {
// put shared-kmp repo in the same root as your iOS project
coreDependencies.append(.package(name: "MyShared", path: "../../../shared-kmp"))
}
4. so, at the end I am changing just one boolean remoteBuild
to work with remote build or local. The variable is default to TRUE, so I have no issues when running CI machine.
Hope it makes sense 🙂