Git Product home page Git Product logo

gulp-cordova-bump's Introduction

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 --prerelease
$ 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 String
  • bowerJson: Array of strings, or a String
  • configXml: Array of strings, or a String
  • singleVersion: 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 locally
  • setAndroidXmlCode: 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 > prerelease

Using spread operator and some other ES6 features that are now supported by Node.js: http://node.green/#spread-------operator

License

MIT License

Donate

  • btc: 16UDfCDGDz6gKk63j23nQUp7WBU64XCn8b
  • eth: 0x4436eec0301378A3f35a7102e765e54dD8eE7782

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.