Cordova plugin alternates with <source-file> tag to copy the entire contents of the directory
Is there a way to tell plugin.xml to copy each file to the pluginβs source folder in the directory of the target platform using either the single dir copy statement or automatically copy each file to the src directory.
Using copy as part of a large plugin is a nightmare, as we see the manual changes needed during mass refactoring.
I still can not vote :( But Rafita is right. To expand this answer, I am doing the same because I have a large set of files that include Android activity, which includes many java source files, assets, layouts , and resources that should all be installed on the platforms (and combined with any existing ones created by the main Android plugin).
- For Android, I copied all of my activity sources into the Android plugins directory, and then ordered them to be copied as follows:
<source-file src="src/android/java/com/acme" target-dir="src/com" /> will copy your complete package tree to the platforms/android/src/com/acme .
And for resources and assets you can do this:
<resource-file src="src/android/res" target="res" /> <resource-file src="src/android/assets" target="assets" />
- For iOS
<source-file src="src/ios" target-dir="src"/> Copy all source files from the plugin/src/ios directory to the platforms/ios/Project-Name/Plugins/plugin-name directory