A command-line tool for easily incrementing pubspec.yaml version numbers.
Within your pubspec.yaml file, you can increment the version number
version: 0.0.0+000
- iOS: CFBundleShortVersionString (Version number)
- Android: versionName
- Can be reused (with different Build Numbers)
- Must always be bigger than the previous version
- iOS: CFBundleVersion (Build number)
- Android: versionCode
- Cannot be reused (with the same version number)
- Must always be bigger than the previous build number (within the same version number)
- Can be reset to 0 if the version number increments
More details about the version number can be found here: android | apple
pub_version_plus
can be used globally or as a dev dependency to your pubspec.yaml
file.
$ pub global activate pub_version_plus
#! or
$ flutter pub global activate pub_version_plus
#! dart
$ dart pub add --dev pub_version_plus
#! flutter
$ flutter pub add --dev pub_version_plus
Or add it to your pubspec.yaml
file:
dev_dependencies:
pub_version_plus:
pub_version_plus
supports four commands:
major
minor
patch
build
Depending on how you pub_version_plus
installed, you have a couple of different ways to use it:
#! installed globally
$ pubversion <version-type>
#! installed as a dev dependency
#! Flutter
$ flutter pub run pub_version_plus:main <version-type>
#! Dart
$ dart pub run pub_version_plus:main <version-type>
Installing pub_version_plus
as a dev dependency will make it available to any CI/CD tool. (GitHub Actions, CodeMagic, etc.)
Increments the major version number - X.0.0
test_package upgraded from 1.2.1 to 2.0.0
#! with build number
test_package upgraded from 1.2.1+2 to 2.0.0+0
Increments the minor version number - 0.X.0
test_package upgraded from 1.0.1 to 1.1.0
#! with build number
test_package upgraded from 1.0.1+3 to 1.1.0+0
Increments the patch version number - 0.0.X
test_package upgraded from 1.0.0 to 1.0.1
#! with build number
test_package upgraded from 1.0.0+4 to 1.0.1+0
Increments the build version number - 0.0.0+X
test_package upgraded from 1.0.0+4 to 1.0.0+5