Skip to content
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

adding support for Swift Package Manager #5828

Closed
wants to merge 3 commits into from
Closed

adding support for Swift Package Manager #5828

wants to merge 3 commits into from

Conversation

heyzooi
Copy link

@heyzooi heyzooi commented Jun 24, 2018

Environment:

ProductName:	Mac OS X
ProductVersion:	10.13.5
BuildVersion:	17F77

/Applications/Xcode.app/Contents/Developer
Xcode 9.4.1
Build version 9F2000

/usr/local/bin/pod
1.5.3
(not in use here)

/bin/bash
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17)

/usr/local/bin/carthage
0.29.0
(not in use here)

/usr/bin/git
git version 2.15.2 (Apple Git-101.1)

Build Parameters:

swift build -Xcxx -IRealm/ObjectStore/src -Xcxx -Isync-3.5.6/include -Xcxx -DREALM_ENABLE_SYNC=1

@heyzooi
Copy link
Author

heyzooi commented Jun 24, 2018

Realm.h was duplicated because it needs to add the header RLMVersion.h

@tgoyne
Copy link
Member

tgoyne commented Jun 25, 2018

This doesn't work when building from a clean source directory as it relies on files downloaded and generated by some of the build steps in the Xcode project, and the changes to the source files would break some of our other pre-existing packages.

@heyzooi
Copy link
Author

heyzooi commented Jun 25, 2018

hi @tgoyne,

which files are downloaded? as far I know the downloaded files are from the ObjectStore submodule, so you need to clone the repo and clone the submodules as well. git clone --recurse-submodules should work

which files are generated? as far I know the generated files are RLMPlatform.h and RLMVersion.h right? Those could be generated by the Swift Package Manager as well, but we would need to set --disable-sandbox during the swift build call, so the files can be generated, just as a Xcode build step. We can either generate those files as I said or submit the generated files to repo and make the scripts change them as we need for each platform or version update.

which changes are breaking existing packages? are you talking about the replace from #import <Realm/HeaderFile.h> to #import "HeaderFile.h"? if so, how could we make this work for all packages?

I believe add support for Swift Package Manager could be an important step for Realm as you can see by this open issue #4555
Let's make this work!

@bmunkholm
Copy link
Contributor

We would really like to support it, but it's still not on the top of our priority list, unfortunately. This PR still have a way to go and if others are able to finish it that would, of course, be very welcomed.

@heyzooi
Copy link
Author

heyzooi commented Jul 11, 2018

hi @bmunkholm, thanks for your response. Could you please be more specific in what is missing when you said the PR still have a way to go?

@bmunkholm
Copy link
Contributor

@heyzooi - as @tgoyne mentions there are issues with the current approach that need to be resolved. Unfortunately, @tgoyne doesn't have the time to address those questions just now. Just wanted to let you know that.

@AF-cgi
Copy link

AF-cgi commented Oct 2, 2018

How does it look like with this PR?

@Luccifer
Copy link

so?

@heyzooi heyzooi closed this Sep 20, 2019
@ukushu
Copy link

ukushu commented Jan 1, 2020

.package(url: "https://github.com/realm/realm-cocoa.git", from: "4.3.0" )

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants