I'm writing a cordova ios plugin
, I managed to set the plugin.xml
file correctly in order to work and import my plugin inside the project with
cordova plugin add myplugin --searchpath=path/to/my/plugin --save
command. What I'd like to do now is 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'd like to group them under MyPlugin folder, inside 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, cordova's CLI plugin manager seems to throw any plugin file inside the Plugins folder, despite the plugin they belong to.
Is there anything equivalent to Android's target-dir
attribute for iOS? Any hint?
Thanks in advance
There are two valid locations to store persistent files on an iOS device: the Documents directory and the Library directory. Previous versions of the plugin only ever stored persistent files in the Documents directory.
Removing plugins 'cordova plugin remove cordova-plugin-console' => Removes the console plugin from the project and deletes its entry from config. xml and package. json.
First , based on the official document : ios also support <source-file src="src/ios/MyPlugin.m" target-dir="xxxxx"/>
, however cordova just copy the file to "xxxxx" folder in the file system , which could not be reflected to Xcode project structure.
Actually what you want is to specify "Group" for ios source file , while unfortunately , currently it seems cordova doesn't support it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With