Add Swift Package Manager support - #188
Open
harumidiv wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
Package.swiftso DeepLinkKit can be consumed with Swift Package Manager,alongside the existing CocoaPods and Carthage support.
SwiftPM requires all public headers of a C-family target to live under a single
include directory, and DeepLinkKit's sources import headers by file name only
(
#import "DPLDeepLink.h"). To satisfy that, the ten public headers move toDeepLinkKit/include/DeepLinkKit/. Private headers stay next to theirimplementation files.
Nothing changes for existing users:
#import <DeepLinkKit/DeepLinkKit.h>and#import <DeepLinkKit/AppLinks.h>keep working, and no header contents were edited.Changes
Package.swift— a single Objective-C target, iOS 12 / tvOS 12DeepLinkKit/include/DeepLinkKit/(moves only, no contentchanges). The
Errorsdirectory is removed sinceDPLErrors.hwas its only file.DeepLinkKit/include/module.modulemap— see belowDeepLinkKit.xcodeproj— file references updated to the new header locationsREADME.md— Swift Package Manager installation instructions.gitignore—.build/and.swiftpm/Why the explicit module map
SwiftPM generates an umbrella-header module map when
include/<Module>/<Module>.hexists.
AppLinks.h,DPLDeepLink+AppLinks.handDPLMutableDeepLink+AppLinks.hare intentionally not imported by
DeepLinkKit.h, so clang emitsumbrella header for module 'DeepLinkKit' does not include header ...warnings inevery consumer build, and the AppLinks category is unreachable from Swift.
Listing those three headers explicitly resolves both, without changing what
DeepLinkKit.hitself pulls in.Compatibility
DeepLinkKit.podspecis unchanged. Itssource_filesandprivate_header_filespatterns resolve to exactly the same files as before(10 public headers, 11 private headers, 14 implementation files).
Headersbuild phase entries keep their public visibility.Verification
xcodebuild -scheme DeepLinkKit -destination 'generic/platform=iOS'— succeedsDeepLinkKit-tvOStarget built with-sdk appletvos— succeedswarnings, from both Swift (
import DeepLinkKit) and Objective-C(
#import <DeepLinkKit/DeepLinkKit.h>,#import <DeepLinkKit/AppLinks.h>),including the AppLinks category
Not verified locally: tvOS through SwiftPM (tvOS platform support is not installed on
my machine), and the CocoaPods-based test target (its dependencies could not be
installed in my environment). This is a packaging change with no source behaviour
changes, so no tests are added — happy to add whatever you'd like to see.
Note
Consumers can point at a branch or revision today, but a tagged release will be
needed for version-based dependencies, since the existing
1.5.1tag predatesPackage.swift.