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.
Swift Package Manager has Opinions about how projects must be structured and does not like it when projects deviate from that, so this ends up being a bit complicated.
Using a custom modulemap (which we do for the Realm.Private and Realm.Dynamic subpackages) requires that the modulemap and headers be outside of the source root for whatever reason. To avoid breaking everything else, this is done by putting a directory full of symlinks to the actual source files in the
include
directory.The package currently doesn't support sync, as that can't be (publicly) built from source and swiftpm doesn't support binary packages. We previously didn't support building with sync disabled, so some changes to the source files were needed to support that.
SwiftPM supports Swift targets and objc/c++ targets, but you can't have both swift and objc/c++ in a single target. This required restructing our tests: the obj-c tests had tests for using the obj-c API from Swift, and the Swift tests had some obj-c helpers. There's now a shared support library with the obj-c helpers, and three separate test targets, for obj-c, swift tests of obj-c, and swift tests of swift. This required renaming many of the types used in the tests, as both the obj-c and swift test suites had types using the same names. It also exposed some bugs where loading RealmSwift would make Swift subclasses of RLMObject behave strangely.
Depends on realm/realm-core#3308.