pubspec_version 0.6.1+1

  • Readme
  • Changelog
  • Example
  • Installing
  • 66

pubver #

CLI tool to set/bump the version key in pubspec.yaml. Semver-compliant (Almost. It uses pub_semver which is a bit different.)

Installing #

Install the package from the command line:

pub global activate pubspec_version

This will add the pubver binary to your ~/.pub-cache/bin.

Usage #

Bumping the version #

pubver bump <part>

where <part> can be either breaking, major, minor, patch or build.

Examples #

BeforeCommandAfter
1.2.3pubver bump breaking2.0.0
0.2.1pubver bump breaking0.3.0
0.2.1pubver bump major1.0.0
0.2.1pubver bump minor0.3.0
0.2.1pubver bump patch0.2.2
0.2.1pubver bump build0.2.1+1
0.2.1+42pubver bump build0.2.1+43
0.2.1+foopubver bump build0.2.1+foo.1
0.2.1+42.foopubver bump build0.2.1+43.foo
0.2.1+foo.bar.1.2pubver bump build0.2.1+foo.bar.2.0

The bump build command is a bit tricky. It either increments the first numeric part of the build (if there is a numeric part) setting other numeric parts to zeroes, or appends .1 to the build (otherwise).

Retaining the build number #

When bumping either major, minor, or patch versions, it is possible to retain the existing build number (if any). To do so, pass --retain-build (-b) flag.

BeforeCommandAfter
1.2.3+42pubver bump breaking2.0.0
0.2.1+42pubver bump breaking -b0.3.0+42
0.2.1+42pubver bump patch0.2.2
0.2.1+42pubver bump patch -b0.2.2+42

Setting the version #

pubver set <version>

where <version> can be any arbitrary version.

Getting the version #

pubver get

Output #

The tool prints the new version to stdout. This allows post processing, e.g. making a git commit.

git ci . -m "Release $(pubver bump breaking)"

Changelog #

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased #

0.6.1 - 2019-09-02

Added #

  • the documentation section about retaining the build number

Fixed #

  • function tests failing randomly due to missing await

0.6.0 - 2019-09-02

Added #

  • the --retain-build (-b) flag to retain the build number when bumping versions

0.5.0 - 2019-08-18

Changed #

  • the bump build command sets the subsequent numeric build parts to zeroes

0.4.0 - 2019-08-18

Added #

  • the bump build command

0.3.0 - 2019-05-29

Added #

  • the get command (PR)

0.2.2 - 2018-11-16

Changed #

  • Minor documentation changes.

0.2.1 - 2018-11-16

Changed #

  • Minor documentation changes.

0.2.0 - 2018-11-16

Breaking change #

  • This is now a standalone cli app.

0.1.0 - 2018-10-05

Changed #

  • Binary names

0.0.2 - 2018-10-04

Fixed #

  • Removed double await statement (#1)

0.0.1 - 2018-10-03 #

Added #

  • Initial version

example/readme.md

Examples #

BeforeCommandAfter
1.2.3pubver bump breaking2.0.0
0.2.1pubver bump breaking0.3.0
0.2.1pubver bump major1.0.0
0.2.1pubver bump minor0.3.0
0.2.1pubver bump patch0.2.1
0.2.1pubver set 5.4.3-dev5.4.3-dev

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate pubspec_version

2. Use it

The package has the following executables:


$ pubver

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  pubspec_version: ^0.6.1+1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:pubspec_version/pubspec_version.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
32
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
66
Learn more about scoring.

We analyzed this package on Jan 16, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
args ^1.5.0 1.5.2
pub_semver ^1.4.2 1.4.2
pubspec ^0.1.0 0.1.3
Transitive dependencies
charcode 1.1.2
collection 1.14.12
matcher 0.12.6
meta 1.1.8
path 1.6.4
quiver 2.1.2+1
source_span 1.6.0
stack_trace 1.9.3
string_scanner 1.0.5
term_glyph 1.1.0
uri 0.11.3+1
utf 0.9.0+5
yaml 2.2.0
Dev dependencies
mockito ^3.0.0
pedantic ^1.0.0
test ^1.0.0