1.0.1 • Published 3 years ago

@kamikage/cordova-version-control v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

This will write the version and build number to your Cordova projects config.xml file Version numbers will follow the Semantic Versioning system (https://semver.org/) which would already be used in the project.json file The build number will use the semver system as a 6 digit version such as 42069 to designate the major.minor.patch version 4.20.69 you can set your own version and build numbers using the -v for version and -b for build

Features

  • Writes version and buildNumber to Cordova config.xml
  • Can read version from local package.json
  • Only update android or ios build number if you wish (from an app review rejection)
  • Can work on Cordova Plugin projects
  • Has CLI

Install

$ npm install cordova-version-control

Usage

const cdvVerCrtl = require('cordova-version-control');

cdvVerCrtl(); // reads version from package.json
cdvVerCrtl('4.20.69');
cdvVerCrtl('./plugin.xml', '4.20.69');
cdvVerCrtl('./path/to/config.alt.xml', 69);
cdvVerCrtl('./path/to/config.alt.xml', '4.20.69', 69)
    .catch(error => { ... });

API

cdvVerCrtl([configPath], [version], [buildNumber], [android], [ios]): Promise

  • configPath (string) - path to your config.xml or plugin.xml
  • version (string) - version to be written
  • buildNumber (number) - build number to be written
  • android (bool) - sets if you only want to write android build number, ignored for plugins
  • ios (bool) - sets if you only want to write android build number, ignored for plugins

#Important notes You can not have android and ios both as true. Only use one at a time or set both to false to write both android and ios build numbers.

CLI

cdvversioncrtl [-v|--version <version>] [-b|--build-number <build-number>] [-a|--android-only] [-i|--ios-only] [config.xml]

Options:

  • -v/--version - version to set
  • -b/--build-number - build number to set
  • -a/--androidOnly - only set android build number, ignored for plugins
  • -i/--iosOnly - only set ios build number, ignored for plugins
  • --help - display help

#Important notes You can not use -a and -i options at the same time. Only use one at a time or don't include them to write both android and ios build numbers.

Examples

$ cdvversioncrtl -v 2.4.9 plugin.xml
$ cdvversioncrtl -b 86
$ cdvverctrl -v 2.4.9 -b 86
$ cdvverctrl (gets version from project package.json)