@holisticon/nativescript-buildhelper
Advanced tools
Comparing version 0.1.0-develop-5 to 0.1.0-develop-6
@@ -10,17 +10,32 @@ #!/usr/bin/env node | ||
var ARGS = process.argv.slice(2); | ||
var xmlParser = new xml2js.Parser(), builder = new xml2js.Builder(), manifestPath = path.resolve('.', 'app/App_Resources/Android/AndroidManifest.xml'), buildNo = ARGS[0] || process.env['BUILD_NUMBER'] || 1, packageJSON = require(path.resolve('.', 'package.json')), manifestXML = fs.readFileSync(manifestPath); | ||
var xmlParser = new xml2js.Parser(), builder = new xml2js.Builder(), manifestPath = 'app/App_Resources/Android/AndroidManifest.xml', plistPath = 'app/App_Resources/iOS/Info.plist', buildNo = ARGS[0] || process.env['BUILD_NUMBER'] || 1, packageJSON = require(path.resolve('.', 'package.json')); | ||
console.log('Updating with build number: ' + buildNo); | ||
xmlParser.parseString(manifestXML, function (err, manifestData) { | ||
var appId = packageJSON.nativescript.id, version = packageJSON.version; | ||
manifestData.manifest.$['android:versionCode'] = buildNo; | ||
manifestData.manifest.$['android:versionName'] = version; | ||
fs.writeFile(manifestPath, builder.buildObject(manifestData), function (err) { | ||
if (err) | ||
throw err; | ||
}); | ||
fs.stat(manifestPath, function (error) { | ||
if (!error) { | ||
var manifestXML = fs.readFileSync(manifestPath); | ||
xmlParser.parseString(path.resolve('.', manifestPath), function (err, manifestData) { | ||
var appId = packageJSON.nativescript.id, version = packageJSON.version; | ||
manifestData.manifest.$['android:versionCode'] = buildNo; | ||
manifestData.manifest.$['android:versionName'] = version; | ||
fs.writeFile(manifestPath, builder.buildObject(manifestData), function (err) { | ||
if (err) | ||
throw err; | ||
}); | ||
}); | ||
} | ||
else { | ||
console.log('Skipping platform Android'); | ||
} | ||
}); | ||
child_process_1.exec('/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ' + buildNo + '" ' + __dirname + '"/../app/App_Resources/iOS/Info.plist"', function (err) { | ||
if (err) { | ||
throw err; | ||
fs.stat(plistPath, function (error) { | ||
if (!error) { | ||
child_process_1.exec('/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ' + buildNo + '" ' + path.resolve('.', plistPath), function (err) { | ||
if (err) { | ||
throw err; | ||
} | ||
}); | ||
} | ||
else { | ||
console.log('Skipping platform iOS'); | ||
} | ||
}); |
{ | ||
"name": "@holisticon/nativescript-buildhelper", | ||
"version": "0.1.0-develop-5", | ||
"version": "0.1.0-develop-6", | ||
"description": "Basic NPM package for helping on automate releasing of NativeScript Apps", | ||
@@ -17,2 +17,3 @@ "bin": { | ||
"postclean": "", | ||
"e2e": "jasmine-node test/e2e/*.spec.js --junitreport --output target/e2e-reports/ --verbose --color", | ||
"jsdoc": "jsdoc -c ./jsdoc.json -t ./node_modules/ink-docstrap/template -R README.md ./etc", | ||
@@ -31,2 +32,4 @@ "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0", | ||
"devDependencies": { | ||
"@types/core-js": "0.9.37", | ||
"@types/jasmine": "2.5.46", | ||
"@types/node": "8.0.7", | ||
@@ -33,0 +36,0 @@ "conventional-changelog-cli": "1.2.0", |
@@ -6,2 +6,2 @@ #!/usr/bin/env node | ||
require('./lib/buildnumbering')(); | ||
require('./lib/buildnumbering'); |
@@ -16,2 +16,3 @@ { | ||
"types": [ | ||
"jasmine", | ||
"node" | ||
@@ -18,0 +19,0 @@ ] |
10172
13
121
16