Masonry icon indicating copy to clipboard operation
Masonry copied to clipboard

Add support for Swift Package Manager

Open fredericgermain opened this issue 3 years ago • 6 comments

[email protected]:fredericgermain/Masonry.git can be added to a project using branch pr/swiftpm

It would be nice to have swiftpm added in a new version

Inspired by https://stackoverflow.com/a/67376388/1532175, I'm not a Package.swift pro

fredericgermain avatar Nov 14 '22 20:11 fredericgermain

Could you only add folder include and Package.swift?

Thanks

wei18 avatar Dec 20 '22 10:12 wei18

Do you mean removing the commit that removed the Pods file? Why would you want to keep them?

For me, they shouldn't be in the source base as you can get them with a simple pod install. They are even more useless if you use swiftpm, they would pollute the project view in XCode I think.

fredericgermain avatar Dec 20 '22 14:12 fredericgermain

I'm doing the same for needed-maintenance to Pod -> Package too.

Why would you want to keep them?

I think you need support both Cocoapods and SwiftPackage until the author decide to nonsupport Cocoapods.

Thing like this, https://github.com/AssistoLab/KVNProgress/pull/126 https://github.com/m1entus/INSPullToRefresh/pull/93

wei18 avatar Dec 21 '22 02:12 wei18

Oh. I don't remove CocoaPods support with my commits: Masonry.spec, Podfile, Podfile.lock are still there.

I remove all files that are added by the pod install command itself. These files are completely unnecessary when you use Masonry as a CocaoPods dependency, and they pollute swiftpm projects.

They should never have been in the git repository in the first place. In the projects you've just linked, there are ...spec, Podfile and Podfile.lock, but without the Pods/ directory.

So for me, everything is fine, unless someone actually has a use case for not removing these files.

fredericgermain avatar Dec 21 '22 20:12 fredericgermain

Thanks for explanation.

For someone wanna quick use this solution. (I have tried successful at least).

  • As swift package: https://github.com/fredericgermain/Masonry/tree/pr/swiftpm
  • Fix lots warning: https://github.com/warpling/Masonry/commit/3133d6c26069e2c626afb0a62e9e93e0a65b123e

And added following if needed. // Apple Clang - Preprocessing (1) // [Note] MAS_SHORTHAND: define this constant if you want to use Masonry without the 'mas_' prefix // [Note] MAS_SHORTHAND_GLOBALS: define this constant if you want to enable auto-boxing for default syntax GCC_PREPROCESSOR_DEFINITIONS = MAS_SHORTHAND MAS_SHORTHAND_GLOBALS $(inherited)

wei18 avatar Dec 22 '22 02:12 wei18