I am in the process of configuring a headless Ubuntu server to automate the task of building APKs using Phonegap CLI. I have figured out how to automate most tasks - including creating the keystore for the release build, building the actual APK etc. What I am still missing is this
I want to run a script that gets the relevant HTML, CSS and JS files and then
- Creates the folder in which the relevant project folders - plugins, www etc - will reside.
- Populate the www folder with the supplied HTML and then its child js/css folders accordingly
- The "Problem" bit - populate the plugins folder using the list of plugins that I supply to the script.
Now this could be done by running phonegap plugin add source-plugin-name
. But it is wasteful since chances are that my script would spent a great deal of time, and bandwidth, fetching plugins it has already used before in another context.
Easy, I thought - I will just grab the plugins once and for all and then copy them across to the current projet's plugins
folder. However, things are clearly not quite that easy. When done "normally" - i.e. via phonegap plugin add
that folder ends up with two additional files android.json
and fetch.json
.
The function served by the android.json
file is explained outstandingly well in this SO thread.
Now to my questions
- If I do as I have indicated - copy the plugins across to
myproject/plugins
from a local copy what is to stop me from also buildingandroid.json
myself at the same time following the guidelines in that thread - What purpose does the
fetch.json
file serve and do I need it
Finally, are there any gotchas (other than having dated local copies) that I need to be aware of if I go down the copy local plugin copies
route as I am planning to do.