build(cordova): simplify build, use cordova in a more standard way
This commit is contained in:
parent
4ccf10d1b3
commit
d5e6b8fab8
14 changed files with 175 additions and 133 deletions
|
|
@ -0,0 +1,18 @@
|
|||
module.exports = function(ctx) {
|
||||
var fs = ctx.requireCordovaModule('fs'),
|
||||
path = ctx.requireCordovaModule('path'),
|
||||
xml = ctx.requireCordovaModule('cordova-common').xmlHelpers;
|
||||
|
||||
var manifestPath = path.join(ctx.opts.projectRoot, '/platforms/android/AndroidManifest.xml');
|
||||
var doc = xml.parseElementtreeSync(manifestPath);
|
||||
if (doc.getroot().tag !== 'manifest') {
|
||||
throw new Error(manifestPath + ' has incorrect root node name (expected "manifest")');
|
||||
}
|
||||
|
||||
doc.getroot().find('./application').attrib['android:allowBackup'] = "false";
|
||||
|
||||
//write the manifest file
|
||||
fs.writeFileSync(manifestPath, doc.write({
|
||||
indent: 4
|
||||
}), 'utf-8');
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue