-
Notifications
You must be signed in to change notification settings - Fork 987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Swift Package Manager Support for iOS Plugins #1089
Comments
Cocoapods needs to be a thing of the past, downloading of the cocopaods repo step is pure lunacy and anything that improves on that is massive step forward. |
@msmtamburro - I'm stuck with a project where I need to use an SDK distributed only with SPM. What would be the "complicated way" to install this SDK until proper support is added to Cordova? |
@j3k0 one approach would be to look at the Package.swift file, which is human readable, and then write yourself a similar plugin.xml. |
Thanks, for later reference, the SDK being open source I included all source files and assets and packaged them with the |
I think we're definitely interested in Cordova-iOS and Cordova plugins supporting a way to add dependencies using Swift Package Manager. Probably, we'd want dependencies declared in plugin.xml similar to how Android declares Gradle package dependencies: <framework src="com.google.firebase:firebase-core:$FCM_VERSION" /> Swift packages are handled as git URLs with references to branches or tags, so we'd either need to take a complete package spec URL or a package URL and a version spec. There are a few pre-requisites to this work:
|
Hi team! Is this going to happen? |
A simpler alternative to point 2 could be to create a local SPM package as local dependency to the default iOS template and add it by default so no Xcode project modification is needed. Then make the Cordova CLI modify that local package's Package.swift file to add the plugins dependencies there. |
Feature Request
With recent versions of Xcode, including frameworks became problematic due to the introduction of the M1 Mac and the inclusion of certain simulator architectures within frameworks. To address this, framework consumers use Lipo to strip architectures, or (better) framework providers moved to XCFramework. Other framework providers jumped directly to offering their projects as Swift Packages to overcome this challenge. It would be nice to add a way for plugins to specify Swift Package Manager dependencies, just like they currently can specify frameworks.
Motivation Behind Feature
There are complicated or manually intensive ways to add Swift Packages to a Cordova project, so it would make sense to add real support, as this does appear the direction things are going.
https://swift.org/package-manager/
https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app
Feature Description
Plugins would be able to add a line something like this:
<package src="https://github.com/ReactiveX/RxSwift.git" branch="optional" version="6.0.0" revision="3920840923809482309482039"/>
Alternatives or Workarounds
You could write a hook that calls something on the command line to add this, or (worse) manually add the package each time through Xcode.
The text was updated successfully, but these errors were encountered: