0.3.0 • Published 10 years ago
gulp-cordova-version v0.3.0
gulp-cordova-version
Sets the version in the config.xml of the cordova project.
Installation
npm install --save-dev gulp-cordova-versionUsage
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.jsonfile and call the plugin withversion(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
- Sam Verschueren <sam.verschueren@gmail.com>
License
MIT © Sam Verschueren