IOS cordova project - group plugin files in the folder under the plugins /

I am writing a cordova ios plugin , I was able to correctly install the plugin.xml file to work and import my plugin inside the project using

 cordova plugin add myplugin --searchpath=path/to/my/plugin --save 

teams. Now I want to group all the plugin files inside a folder.

For example, having these 2 files (snippet from plugin.xml )

 ... <source-file src="src/ios/MyPlugin.m" /> <source-file src="src/ios/MyPlugin.h" /> ... 

I would like to group them in the MyPlugin folder in the iOS Project Plugins folder:

 MY_PROJECT |-- www/ |-- Staging/ |-- Classes/ |-- Plugins/ | |-- MyPlugin/ <!-- HERE --> | | |-- MyPlugin.m | | |-- MyPlugin.h | |-- SomeOtherPlugin.m | |-- Foo.h |-- Other Sources/ |-- Resources/ |-- Framework/ |-- Products/ 

Right now, the Cordon CLI plugin manager seems to be throwing any plugin file inside the plugins folder, despite the plugin to which they belong.

Is there something equivalent to the Android target-dir attribute for iOS? Any hint?

Thank you in advance

+5
source share
1 answer

First, based on an official document : ios also supports <source-file src="src/ios/MyPlugin.m" target-dir="xxxxx"/> , however the cordova simply copies the file to the folder "xxxxx" in the file system, which cannot be reflected in the structure of the Xcode project.

Actually, you want to specify a β€œGroup” for the ios source file, while unfortunately, it currently seems like the cordova doesn't support it

+1
source

All Articles