Add Support for Swift Package Manager#85
Open
mattprowse wants to merge 3 commits intopotionfactory:masterfrom
Open
Add Support for Swift Package Manager#85mattprowse wants to merge 3 commits intopotionfactory:masterfrom
mattprowse wants to merge 3 commits intopotionfactory:masterfrom
Conversation
mattprowse
commented
Jun 7, 2022
| s.public_header_files = 'PFMoveApplication.h' | ||
|
|
||
| s.resources = '*.lproj' | ||
| s.resources = 'Resources/*.lproj' |
Contributor
Author
There was a problem hiding this comment.
Update the Podfile to account for the relocated resources and to bump the version number.
mattprowse
commented
Jun 7, 2022
|
|
||
| #import <Cocoa/Cocoa.h> | ||
| #import <LetsMove/PFMoveApplication.h> | ||
| #import "PFMoveApplication.h" |
Contributor
Author
There was a problem hiding this comment.
I had to make this a local #import to keep SPM happy.
mattprowse
commented
Jun 7, 2022
Comment on lines
+21
to
+23
| #ifdef SWIFT_PACKAGE | ||
| return SWIFTPM_MODULE_BUNDLE; | ||
| #else |
Contributor
Author
There was a problem hiding this comment.
Ensure the resources can be located when building with SPM.
mattprowse
commented
Jun 7, 2022
| name: "LetMove", | ||
| defaultLocalization: "en", | ||
| platforms: [ | ||
| .macOS(.v10_10), |
Contributor
Author
There was a problem hiding this comment.
This is the lowest macOS version that can be specified in Package.swift.
mattprowse
commented
Jun 7, 2022
| .process("Resources") | ||
| ], | ||
| publicHeadersPath: "include", | ||
| cSettings: [.unsafeFlags(["-fno-objc-arc"])] |
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.
See inline comments for explanations of some of the less obvious changes.
I tried getting this to work without having to move the resources into their own folder, but the Package.swift
excludelist doesn't seem to apply to resources and and I got SPM errors that I couldn't work out how to resolve any other way.SPM is also very particular about how the public headers are provided. I used an approach I've seen used in other Mac libraries which was to create a dedicated
includesfolder for SPM which contains symlinks to the relevant headers in their original locations.I also added instructions to the README (and while I was there I added instructions for CocoaPods and Carthage too.