version_assist 1.1.0
version_assist: ^1.1.0 copied to clipboard
A CLI tool to bump Flutter project versions
version_assist #
A CLI tool for managing version numbers in Flutter/Dart projects.
Installation ๐ #
If the CLI application is available on pub, activate globally via:
dart pub global activate version_assist
Local Development ๐ ๏ธ #
- Clone the repository:
git clone git@github.com:kuyazee/Version-Assist.git
cd version_assist
- Install dependencies:
dart pub get
- Run locally during development:
# Run directly with Dart
dart run bin/version_assist.dart bump
# Or use the make command if available
dart run bin/version_assist.dart bump --path=/path/to/pubspec.yaml
- Activate locally for testing:
# From the version_assist directory
dart pub global activate --source path .
# Now you can run it like a global command
version_assist bump
Usage #
Bump Version #
The tool supports several versioning options:
-
Semantic Versioning (major.minor.patch):
- Major version (x.0.0): Breaking changes
- Minor version (0.x.0): New features, backwards compatible
- Patch version (0.0.x): Bug fixes, backwards compatible
-
Version Formats:
- With build number:
1.0.0+1
- Without build number:
1.0.0
- With build number:
-
Build Number Options:
- Simple increment: Increases the build number by 1
- Date-based format: Uses format
yymmddbn
where:yy
: Year (e.g., 24 for 2024)mm
: Month (01-12)dd
: Day (01-31)bn
: Build number for the day (00-99)
-
Git Operations:
- By default, version bumps do NOT create git commits or tags
- Use
--auto-commit
to enable automatic git operations
For detailed information about version management, including examples and best practices, see our Version Management Guide.
Basic usage examples:
# Semantic Version Bumping (with build number)
$ version_assist bump --major # 1.0.0+1 -> 2.0.0+2
$ version_assist bump --minor # 1.0.0+1 -> 1.1.0+2
$ version_assist bump --patch # 1.0.0+1 -> 1.0.1+2
# Semantic Version Bumping (without build number)
$ version_assist bump --major --no-build-number-update # 1.0.0 -> 2.0.0
$ version_assist bump --minor --no-build-number-update # 1.0.0 -> 1.1.0
$ version_assist bump --patch --no-build-number-update # 1.0.0 -> 1.0.1
# Build Number Options
$ version_assist bump # Simple increment
$ version_assist bump --date-based-build-number # Date-based format
$ version_assist bump --no-build-number-update # Keep current build number
# Git Operations
$ version_assist bump --auto-commit # Bump version and create git commit/tag
$ version_assist bump --major --auto-commit # Major version bump with git operations
# Preview changes without making them
$ version_assist bump --dry-run
Git Operations Behavior #
By default, version bumps do NOT create git commits or tags:
# No git operations (default)
$ version_assist bump --major # Only updates pubspec.yaml
With --auto-commit
, the tool will:
- Update the version in pubspec.yaml
- Create a git commit with the message:
build(version): Bump version to {new_version}
- Create a git tag with the new version
# Automatic git operations
$ version_assist bump --major --auto-commit
Update CLI #
Update the CLI tool to the latest version.
$ version_assist update
General Commands #
# Show CLI version
$ version_assist --version
# Show usage help
$ version_assist --help
Running Tests with coverage ๐งช #
To run all unit tests use the following command:
$ dart pub global activate coverage 1.2.0
$ dart test --coverage=coverage
$ dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info
To view the generated coverage report you can use lcov.
# Generate Coverage Report
$ genhtml coverage/lcov.info -o coverage/
# Open Coverage Report
$ open coverage/index.html
For detailed information about our testing requirements (minimum 80% coverage), best practices, and guidelines, see our Testing Documentation.