-
-
Notifications
You must be signed in to change notification settings - Fork 197
feat: Add Objective-C source code to .pbxproject #3524
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
Conversation
97cb2dd
to
fdfef9d
Compare
Search for plugin's platforms/ios/src folder and add it and it's content (.h and .m files) to the native iOS project.
fdfef9d
to
de78502
Compare
lib/services/ios-project-service.ts
Outdated
if (this.$fs.exists(rootPath) && !this.$fs.isEmptyDir(rootPath)) { | ||
this.$fs.readDirectory(rootPath).forEach(fileName => { | ||
const filePath = path.join(rootGroup.path, fileName); | ||
const file: INativeSourceCodeDescription = { name: fileName, path: filePath}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name
property doesn't seem to be used and might be removed.
Try making the paths inside the groups relative, because this might cause problems in the future. |
359b337
to
69321d0
Compare
run ci |
1 similar comment
run ci |
69321d0
to
939afd5
Compare
* Implement support for adding resources * Write unit tests for `Resources` and `src` * TODO: fix node-xcode reference in package.json after merging Teo's PR
939afd5
to
9a33b41
Compare
run ci |
3 similar comments
run ci |
run ci |
run ci |
b8899a6
to
5fd9448
Compare
# Conflicts: # npm-shrinkwrap.json
7de8908
to
6fdc25c
Compare
run ci |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work
@tdermendjiev where is the modulemap supposed to be? i cant get it to work right now inside a plugin. I want to add a NSDate category
|
That should be the right place. Can you try the troubleshooting ideas listed here and see if anything will come up? |
@mbektchiev nice article! Did not find the reason of my issue there. But found it it a component i had already doing that. Just didn't remember it :s The reason was the extra "framework" word in the modulemap. |
Seems legit -- a Weren't there any hints about this in the stderr logs of metadata generator? |
@mbektchiev not that i saw. The file was 3Mo though so not easy to read. But searching for my module name |
In fact, we have such an example. But maybe it should be more visible. https://github.com/NativeScript/plugin-ios-modulemap-sample It's linked here: https://docs.nativescript.org/plugins/Use-Native-iOS-Libraries#static-frameworks but obviously not the place that one would look for it ... |
Yes would be best for it to be more visible. |
PR Checklist
What is the current behavior?
Currently, support for native Objective-C source code is not implemented.
What is the new behavior?
Following changes allow plugin authors to include raw Objective-C source code (.m and .h files) to their plugins. CLI looks for folder named platforms/ios/src folder and creates a pbxGroup in the .pbxProject named after the plugin. Files and folders are added to project recursively (NativeScript/node-xcode#6) and same structure is kept. Root folder (platforms/ios/src) is added to HEADER_SEARCH_PATHS as the plugin author still has to provide a modulemap for the source code.
Implements NativeScript/ios-jsc#885.