-
Notifications
You must be signed in to change notification settings - Fork 16
Swift PM support #19
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
base: master
Are you sure you want to change the base?
Swift PM support #19
Conversation
Signed-off-by: Joseph Mattello <mail@joemattiello.com>
Signed-off-by: Joseph Mattello <mail@joemattiello.com>
needed for swift pm to work, no implicit imports Signed-off-by: Joseph Mattello <mail@joemattiello.com>
Signed-off-by: Joseph Mattello <mail@joemattiello.com>
Signed-off-by: Joseph Mattello <mail@joemattiello.com>
Signed-off-by: Joseph Mattello <mail@joemattiello.com>
Signed-off-by: Joseph Mattello <mail@joemattiello.com>
Fixes issues with main app building Signed-off-by: Joseph Mattello <mail@joemattiello.com>
Signed-off-by: Joseph Mattello <mail@joemattiello.com>
|
Just pushed an update that fixes XDelta by moving some files around and making a symlink to the header in a way swift pm prefers. I updated the paths in the xcodeproj too. Tested that both targets build and run. |
Signed-off-by: Joseph Mattello <mail@joemattiello.com>
Signed-off-by: Joseph Mattello <mail@joemattiello.com>
Signed-off-by: Joseph Mattello <mail@joemattiello.com>
Signed-off-by: Joseph Mattello <mail@joemattiello.com>
Signed-off-by: Joseph Mattello <mail@joemattiello.com>
Signed-off-by: Joseph Mattello <mail@joemattiello.com>
Cocoa isn’t used in these files, Foundation is and works cross platform Signed-off-by: Joseph Mattello <mail@joemattiello.com>
|
A few more updates so Package.swift works in XCode. I'm able to build the cmd line app for iOS target. Kind of useless, but it works. The main app could work with iOS UI files. It gets all the way to the app target before failing on AppKit classes. I saw someone mention linux support. I threw in some conditionals for Linux, doubt it would work as-is but it's a starting point if anyone wants to get it to build. |
|
I'm not understanding the reason for some of the file renames. |
|
Never mind, I saw number 1 in the list and I didn't pay close enough attention to the review and see you really only renamed two files. |
|
I will probably approve this tomorrow or over the weekend. @JoeMatt Since the new xdelta.m is just an exact copy of the .c version, I don't see a reason to maintain two copies of the same file. While it may make sense just to rename it instead of having two, I also think it's beneficial to keep the original name in the event I ever have to pull in a newer version of the original code since I did end up upgrading XDelta last year for additional file support. Do you want to make it symlink instead, or should I do it myself after accepting the PR? (Git does track them properly in my experience, as long as someone doesn't use Windows to pull the repo down) Still wondering if it was even necessary to make the two renames, but I haven't used Swift Package Manager before nor did I realize that it supported languages other than Swift. |
|
I can test renaming back, but in my experience, the issue comes to how swift pm imports foundation, and Cocoa classes in C/C++. I have my own project for wrapping xdelta in its own package, maybe I can get that to work. In the meantime, I'm making a swiftui branch because I want to Port to mobile and it's probably easier just to have one user interface with swiftui, but leaving the old AppKit code for Legacy purposes |
|
I think you may have a build issue with I need a header path that's a subpath without other root folders. If this is a blocker, lmk, I'll get back to it next week. |
|
I tried running "swift build" for the first time and I see the include directory problem you mentioned. I'm going to look into it further this week myself; I guess if the package doesn't build out of the box it would be nice for it to work. I could pull the PR into a branch for now but I'm just playing with it locally until there's a satisfactory solution or I've given up and decide not to care and just throw a script in to do the prep work. I also messed with it for an hour trying to get it to not want that include folder, or create it, but it looks like access to FileManager |
|
No worries, There's probably a more "proper" way of putting everything into Sources/Target name and doing things "the apple / swift way" as well. I have to do some travelling but I want to return to this asap on my own as well, so don't sweat too much on this unless you just want to try it out for fun. I too am trying to get better with Swift PM now that it's becoming usable. |

Initial support for Swift PM/Package.swift
Changes:
Not working:
1. xdelta is failing, added a #if HAVE_XDELTA marco to temp remove xdelta2. Main macOS app not building, swiftpm dies for some reasonWhat does work:
Test:
Why?
I plan on adding automatic patching into my app Provenance https://github.com/Provenance-EMU/Provenance
and now I can include as a Swift Package