Need private packages and team management tools?Check out npm Teams »

gulp-cordova-version

0.3.0 • Public • Published

gulp-cordova-version

Build Status Coverage Status

Sets the version in the config.xml of the cordova project.

Installation

npm install --save-dev gulp-cordova-version

Usage

var gulp = require('gulp'),
    create = require('gulp-cordova-create'),
    version = require('gulp-cordova-version');
 
gulp.task('build', function() {
    return gulp.src('dist')
        .pipe(create())
        .pipe(version('2.3.1'));
});

This will set the version attribute in the config.xml file.

Tip: You can use the version of your package.json file and call the plugin with version(require('./package.json').version).

It is also possible to pass in a second object to set the android-versionCode and ios-CFBundleVersion in your config.xml file.

gulp.task('build', function() {
    return gulp.src('dist')
        .pipe(create())
        .pipe(version('2.3.1', {androidVersionCode: 231, iosBundleVersion: '2.3.1'}));
});

API

version(version, [versionCodes])

version

Required Type: string

The version of the application in the format x.y.z.

versionCodes

Type: object

Object with two optional properties to set specific platform version codes. To set the version code for android, use the androidVersionCode property. To set the CFBundleVersion in iOS, use the iosBundleVersion property.

Related

See gulp-cordova for the full list of available packages.

Contributors

License

MIT © Sam Verschueren

Install

npm i gulp-cordova-version

DownloadsWeekly Downloads

219

Version

0.3.0

License

MIT

Last publish

Collaborators

  • avatar