Migration xcframework from cocoapods to SPM - xcode

I have an xcframework that is now published as cocoa pods dependency.
How can I migrate it to SPM? So that the developers can install it via SPM.
I'm facing this issue. In fact, my framework depends on AmazonPublisherServicesSDK.
This is the podspec:
spec.subspec 'AmazonPublisherServicesSDK' do |amazon|
amazon.vendored_frameworks = 'BluestackAmazonPublisherServicesAdapter.xcframework'
amazon.dependency 'BlueStack-SDK/Core'
amazon.dependency 'AmazonPublisherServicesSDK', '4.5.5'
end
How can I do it using Swift Package Manager?
Thank you
I still need a solution for that. I tried, but I did not find how to migrate it.

Related

How can I use Swift Package Manager (SPM) and cocoapods together in one project?

I have an existing project which uses Cocoapods, but I would like to switch to SPM; unfortunately I still have dependencies which aren't available in SPM.
Now I would like to move as many dependencies as possible over to SPM and keep the others in Cocoapods as long as necessary - is this possible? Having both, Cocoapods and SPM?
I just tried CocoaPods with SPM on my iOS project and it works fine.
I'm adding Firebase and other Google libs using CocoaPods and the rest using Swift Package Manager.
When adding SPM dependency, put checkmark on your project(s) and not on the Pods project.
Xcode 11.5,
CocoaPods 1.9.3.
After trying it out I found you can actually have a SPM + Cocoapods to play nice. You install your SPM library on the .xcodeproj while you develop on the .xcworkspace. It all works (at least so far for me lol).
If you are using CI, or you launch manually from xcodebuild command some tweaks with the -clonedSourcePackagesDirPath flag
I have had used swift package manager at the beginning and added 4 packages in my project. When I had to integrate admob sdk. I added cocoapod to my project.
but after open the .xcworkspace file. the packages status are display as Missing. I have to add them from SPM one by one. after all 4 packages were added again. the project can be built and executed again.
Considering all the pros and cons, I found it suitable to use CocoaPods as SPM is still at a very nascent stage and not all libraries support it.
Please go through the blog written by Darshan Patel by https://blog.kiprosh.com/preferable-dependency-manager-swift-package-manager-spm-or-cocoapods/ for more details.

Optimizing Xcode Build time when using Firebase library

Since I'm building using FireStore and few other Firebase library, the build time has doubled down. I'm wondering if there is a way to avoid compiling it every time I clean & build my project.
Don't clean & build, just build. ;)
Disclaimer: Before doing releases, a clean build is preferred, of course.
UPDATE with better answer: Use cocoapods-binary plugin.
https://guides.cocoapods.org/plugins/pre-compiling-dependencies.html
One solution for this is to not give Xcode the chance to re-compile code. CocoaPods Binary will pre-compile your Pods during pod install, and then add the binary assets (e.g. .framework files) into the generated Xcode projects instead of the source code.
Like this.
plugin 'cocoapods-binary'
use_frameworks!
target "MyApp" do
pod "NeededPod", :binary => true
end
For anyone stumbling on this post, we finally found a way to optimize Firestore build time while still using cocoapods.
We are using THIS REPO
It's a precompiled Firestore iOS SDK xcframework files extracted from the Firebase iOS SDK repository release downloads, tagged by Firebase iOS SDK version and presented as a consumable podspec.
Why
Currently the Firestore iOS SDK depends on some 500k lines of mostly C++, which when compiling as part of your Xcode build takes a long time - even more so in CI environments.

xcode library file's header not found inside react native plugin

I'm developing a ios app with use of react native npm plugin and pod files
I have installed pod package using "pod 'IBMMobileFirstPlatformFoundationJSONStore'" and also installed plugin and manually configure the project to the application
My problem is installed ios application of the plugin requires IBMMobileFirstPlatformFoundationJSONStore as the header
I have looked into several suggestions related to the topic but could resolve it yet
Please help
Thanks in advance
I could find a solution
I have added "use_frameworks!" on top of the plugin's pod file and it worked fine

Has the Cocoapod of J2ObjC been depricated?

The J2Objc Cocoapods page lists the latest version as 0.9.6.1 and this is what pod update fetches. However, the J2Objc git page indicates that the latest version is 2.0.2.
Has the Cocoapod for J2ObjC been deprecated?
The J2ObjC Cocoapod was created and maintained by external developers who use j2objc in their projects, but who are not members of the J2ObjC team. I suggest directly contacting the people on the pod's "Maintained by" links on the podspec page as to its status.
Since it's open-source you can also make the change yourself and send it to them to update the pod. I'm not a Cocoapods user, but it looks like all that's needed is to change the version and source tag in the J2ObjC.podspec.json file, though updating the minimum platforms to iOS 10 and macOS 10.11 would be good to do, too.

podspec dependencies, best practices

I am building a cocoapod and wanted to add a dependency for Alamofire because my pod will be making some requests.
After trying to integrate my cocoapod (with the Alamofire dependency) into our main app, I got a version conflict because we are also using Alamofire in our app, but a different version.
Seeing this error, it made us wonder.. why havn't we seen a version conflict message like this one before? We have a handful of third-party cocoapods installed. After inspecting a few of our third-party pod spec files, we found that none of them have dependencies defined.
Is this common practice when releasing cocoapods, to have no dependencies?
(..asked by a Node.js developer)
Remember Alamofire now is on version 4.0(there is even a branch for swift 3), so, if you updated your pods, it automatically installed the new version, if this what you want take a look to the migration guide.
Other case, you have to specify the version you wanna wortk with in your pod file

Resources