gulp-cordova-bump
v1.3.2
Published
Bump cordova package version
Downloads
23
Readme
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
Install
$ npm install --save-dev gulp-cordova-bump
Add the following to your gulpfile
gulp.task('bump', function () {
require('gulp-cordova-bump').run({autofiles: true});
});
Usage
$ 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"
Advanced usage
var bump = require('gulp-cordova-bump');
gulp.task('minorBump', function () {
bump.run({packageJson: 'subdir/package1.json', minor: true});
});
Tests
More sophisticated examples are in test/gulpfile.js
gulp restore
will restore the tests to original state
Parameters
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.
Notes
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