Add Package.swift and remove no longer needed project files#120
Add Package.swift and remove no longer needed project files#120crazytonyli merged 3 commits intotrunkfrom
Conversation
mokagio
left a comment
There was a problem hiding this comment.
Nice.
I think this is possibly out of scope because we have no plan to work on these libraries via SPM alone, bug just wanted to share the result of running swift test
➜ swift test
warning: 'wordpressui-ios': found 1 file(s) which are unhandled; explicitly declare them as resources or exclude from the target
/Users/gio/Developer/a8c/WordPressUI-iOS/WordPressUI/Extensions/Gravatar/NSString+Gravatar.m
warning: 'wordpressui-ios': found 1 file(s) which are unhandled; explicitly declare them as resources or exclude from the target
/Users/gio/Developer/a8c/WordPressUI-iOS/WordPressUI/Info.plist
Building for debugging...
In file included from /Users/gio/Developer/a8c/WordPressUI-iOS/WordPressUI/Categories/UIImage+Resize.m:6:
/Users/gio/Developer/a8c/WordPressUI-iOS/WordPressUI/Categories/UIImage+Resize.h:6:9: fatal error: 'UIKit/UIKit.h' file not found
#import <UIKit/UIKit.h>
^~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/gio/Developer/a8c/WordPressUI-iOS/WordPressUI/Categories/UILabel+SuggestSize.m:1:
/Users/gio/Developer/a8c/WordPressUI-iOS/WordPressUI/Categories/UILabel+SuggestSize.h:1:9: fatal error: 'UIKit/UIKit.h' file not found
#import <UIKit/UIKit.h>
^~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/gio/Developer/a8c/WordPressUI-iOS/WordPressUI/Categories/UIImage+Util.m:1:
/Users/gio/Developer/a8c/WordPressUI-iOS/WordPressUI/Categories/UIImage+Util.h:1:9: fatal error: 'UIKit/UIKit.h' file not found
#import <UIKit/UIKit.h>
^~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/gio/Developer/a8c/WordPressUI-iOS/WordPressUI/Categories/UIColor+Helpers.m:1:
/Users/gio/Developer/a8c/WordPressUI-iOS/WordPressUI/Categories/UIColor+Helpers.h:1:9: fatal error: 'UIKit/UIKit.h' file not found
#import <UIKit/UIKit.h>
^~~~~~~~~~~~~~~
1 error generated.
[2/10] Compiling WordPressUIGravatarObjC NSString+Gravatar.m
error: fatalError
As far as I understand, the errors with UIKit are part of dealing with SPM and its agnostic nature. I'm sure there are workarounds for that, but given we plan to use these within our UIKit apps to work with, I don't think it's worth looking into them at this time.
The two warnings at the top, however, might be good to address?
| common_params: | ||
| plugins: &common_plugins | ||
| - &bash_cache automattic/bash-cache#2.9.0 | ||
| - &bash_cache automattic/bash-cache#2.10.0 |
There was a problem hiding this comment.
New version with the SPM command. Nice!
| ), | ||
| .target( | ||
| name: "WordPressUIGravatarObjC", | ||
| path: "WordPressUI/Extensions/Gravatar", |
There was a problem hiding this comment.
@mokagio The warning about NSString+Gravatar.m not included in any target is a bit strange, as it should be included in this target. But I have a follow up PR to reorganize the folder structure, that warning will go away since the targets will also change.
|
@mokagio I think the "swift build/test" CLI is useful for macOS packages, not that much for this iOS package. We should use |
|
Actually, I don't think I have the permission to merge this PR, with this pending ghost CI check. Can anyone help to merge this PR? 🙇 @wordpress-mobile/apps-infrastructure |
I'm pretty sure this happened because that step was required in the branch protection settings while this PR removed it in favor of I updated the branch protection to expect the new one and removed
That's odd. I have the permission to merge bypassing branch protections. 🤔 When I looked at the repo settings, I saw that the Can you confirm you have access now? |
For sure, although I'd say for "platform agnostic" packages, not necessarily macOS (I'm being nitpicky)? I find it useful to run it just in case it shows something surprising or easily actionable. 👍 |
|
@mokagio Thanks for looking into the GitHub permission and stuff! |



Similar changes as Automattic/Gridicons-iOS#71. And I'll create a follow up PR to reorganise the folders in this repo.
CHANGELOG.mdif necessary.