Bump your Cordova package version
Run this before you run cordova build
This bumps and syncs config.xml, package.json and bower.json semantic versions
$ npm install --save-dev gulp-cordova-bump
gulp.task('bump', function () {
require('gulp-cordova-bump').run({autofiles: true});
});
$ gulp bump --patch
$ gulp bump --minor
$ gulp bump --major
$ gulp bump --setversion=2.1.0
You can also specify the location of package.json
, bower.json
and config.xml
by using the following args:
$ gulp bump --patch --packagejson=<package_json_file_path>
$ gulp bump --minor --bowerjson=<bower_json_file_path>
$ gulp bump --major --configxml=<config_xml_file_path>
e.g.
$ gulp bump --setversion=2.1.0 --packagejson="./package.json" --bowerjson="./bower.json" --configxml="./config.xml"
var bump = require('gulp-cordova-bump');
gulp.task('minorBump', function () {
bump.run({packageJson: 'subdir/package1.json', minor: true});
});
More sophisticated examples are in test/gulpfile.js
gulp restore
will restore the tests to original state
Now this package supports multiple files in different directories.
packageJson
: Array of strings, or a StringbowerJson
: Array of strings, or a StringconfigXml
: Array of strings, or a StringsingleVersion
: Boolean, the first file in the list defines version which will be used for all others.autofiles
: Boolean, tries to find package.json, bower.json and config.xml locallysetAndroidXmlCode
: Function that converts semver string to Number, for config.xml attribute android-versionCode. It is needed if you want to define own version numbers in Android app.
This tool accept both command line parameters and config parameters in gulp, can be mixed If patch types are mixed, the priority of bumping:
setversion > major > minor > patch
Using spread operator and some other ES6 features that are now supported by Node.js: http://node.green/#spread-------operator
- btc: 16UDfCDGDz6gKk63j23nQUp7WBU64XCn8b
- eth: 0x4436eec0301378A3f35a7102e765e54dD8eE7782