Support Swift files in the .xcodeproj#1128
Merged
tdermendjiev merged 6 commits intomasterfrom Apr 19, 2019
Merged
Conversation
mbektchiev
reviewed
Apr 17, 2019
*Redirect LD to nsld.sh so we can hook between compiling and linking and generate metadata there (we need <appname>-Swift.h to be created (and a modulemap for it) so the metadata-generator finds it) *Set Swift language version *Set Strip swift symbols to NO *Add ObjC bridging header so the Swift classes are added to the generated <appname>-Swift.h
bdb9394 to
15fff45
Compare
mbektchiev
reviewed
Apr 18, 2019
31e1fdb to
8a95d02
Compare
mbektchiev
approved these changes
Apr 18, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
*Redirect LD to nsld.sh so we can hook between compiling and linking and generate metadata there (we need appname-Swift.h to be created (and a modulemap for it) so the metadata-generator finds it)
*Set Swift language version
*Set Strip swift symbols to NO
*Add ObjC bridging header so the Swift classes are added to the generated appname-Swift.h
PR Checklist
What is the current behavior?
Swift files cannot be added to an .xcodeproj and accessed by the NativeScript runtime for several reasons:
What is the new behavior?
After all source files are compiled nsld.sh creates a modulemap pointing to the appname-Swift.h where the generated interface for the Swift classes is. As the modulemap's directory is added in the HEADER_SEARCH_PATHS the metadata-generator (called from nsld.sh) will find the header and generate metadata for it. Finally the linking is executed.
This way all Swift symbols accessible from the ObjC runtime are now accessible from NativeScript.
Implements: #1131