Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova Plugin alternate to <source-file> tag to copy entire directory contents

Is there any way to specify in plugin.xml to copy every file in plugin source folder to the target platform directory either with one dir copy statement or automatically copy every file in src directory.

Using to be copied as part of big plugin is the nightmare, as we are seeing manual changes needed during the massive refactoring.

like image 625
Raja Nagendra Kumar Avatar asked Jan 20 '15 09:01

Raja Nagendra Kumar


1 Answers

I can't vote yet :( but Rafita is correct. To expand on that answer, I do the same thing because I have a large set of files that comprise an Android Activity that include many java source files, assets, layouts, and resources that all need to be installed into the platforms (and merged with any existing ones generated by the core android plugin).

  • For Android, I copied my whole activity's sources into the android plugin directory and then arrange for copying them all like this:

<source-file src="src/android/java/com/acme" target-dir="src/com" /> will copy your entire package tree into the platforms/android/src/com/acme directory.

And for the 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"/> Will copy all source files from your plugin/src/ios directory to platforms/ios/Project-Name/Plugins/plugin-name directory

like image 152
Buddhisthead Avatar answered Oct 22 '22 19:10

Buddhisthead