# build_version

> Put your Dart package's version into your source code

Source: https://talira.ai/catalog/build-version-qkjxfdf5
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library, Command-line tool
- Categories: [developer tools / code generation](https://talira.ai/categories/developer-tools/code-generation), [languages / dart](https://talira.ai/categories/languages/dart)
- Licence: BSD-3-Clause[^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Kevin Moore](https://talira.ai/orgs/kevin-moore.md)

build_version writes the version from a Dart package's pubspec.yaml into a generated source file (lib/src/version.dart by default), so code can read its own version. It runs either as a standalone CLI with dart run build_version@, which needs no build_runner and can --check the file in CI, or as a [build_runner](https://talira.ai/catalog/build-runner-snjaeg1d.md) builder for packages that already run other builders, checked in tests with [build_verify](https://talira.ai/catalog/build-verify-e9f16tvq.md).

## Links

- GitHub: https://github.com/kevmoo/build_version

## Problems it solves

- show my Dart package's version from inside its code
- keep a version constant in sync with pubspec.yaml
- fail CI when the generated version file is out of date

## Features

- generates a Dart file holding the package's pubspec version
- standalone CLI with no dev_dependencies needed
- --check mode to verify the generated file in CI
- a build_runner builder with a configurable output path

## Limitations

- The standalone CLI needs Dart 3.12 or newer.[^1]

## Trust

Overall: 0.38 out of 1.
Signals: maintenance 0.66, adoption 0.33, momentum 0.05, community 0.31, backing 0.30, extensibility 0.00.

- last commit 28 days ago
- 9 commits in the last 90 days
- latest release v2.2.1 43 days ago
- 44 GitHub stars
- 5 contributors
- backed by Kevin Moore

## Related

- Works with [build_runner](https://talira.ai/catalog/build-runner-snjaeg1d.md)

## Alternatives

- [source_gen](https://talira.ai/catalog/source-gen-mphgdz39.md): A framework for writing Dart code generators

## Sources

[^1]: https://github.com/kevmoo/build_version/blob/main/README.md (checked 28 Nov 2026)
[^2]: https://github.com/kevmoo/build_version/blob/main/LICENSE (checked 28 Nov 2026)
