feat(ios): allow collections of NativeSource to be included via nativescript.config #5830
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.
PR Checklist
What is the current behavior?
Right now, developers are forced to include iOS native source code via plugins (Obj-C, Swift) or within single project location:
App_Resources/iOS/src
.There's also an option to create a local Swift Package to house shared native source code to be consumed by the project (via the current
SPMPackages
option of config: https://docs.nativescript.org/configuration/nativescript#ios-spmpackages). This can be a fine option in some cases however comes with some overhead in that Swift Packages have member access considerations (meaning generally would need to have proper public access modifiers including proper public initializers for accessing from the swift package).What is the new behavior?
This allows a long desired ability to include native source code from anywhere in the project including outside the project directory given workspace setups. For example, developers can now configure
nativescript.config
as follows:.swift
files anywhere within project/src directory:This will create a file reference folder named
ProjectPlatformSrc
within the generated Xcode project containing any .swift files found anywhere within the projectssrc
directory..swift
files anywhere within project/src directory, including any (Swift, Obj-c impl/headers, as well as any module.modulemap files) within workspace packages or libs dir:Doc added: NativeScript/docs#161