gulp-cordova-version
v0.3.0
Published
Sets the version in the config.xml of the cordova project.
Downloads
285
Maintainers
Readme
gulp-cordova-version
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 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 [[email protected]]
License
MIT © Sam Verschueren