Currently, package:build_version is designed exclusively as a build_runner builder. To generate lib/src/version.dart from pubspec.yaml, a package must add build_runner and build_version to dev_dependencies and run code generation passes.
For lightweight CLI tools and scripts that don't use any other code generators, pulling in build_runner adds dozens of transitive dependencies and significant setup overhead.
Feature Request:
- Add a standalone executable entrypoint (
bin/build_version.dart mapped under executables: build_version: null) that supports:
dart run build_version --write: Reads pubspec.yaml and writes lib/src/version.dart directly.
dart run build_version --verify: Verifies that lib/src/version.dart matches pubspec.yaml and exits non-zero if out of sync.
- Add an in-memory test helper (
expectVersionInSync()) in package:build_version or package:build_verify so test/version_test.dart can verify version synchronization directly in dart test in milliseconds without running a full build.
Currently,
package:build_versionis designed exclusively as abuild_runnerbuilder. To generatelib/src/version.dartfrompubspec.yaml, a package must addbuild_runnerandbuild_versiontodev_dependenciesand run code generation passes.For lightweight CLI tools and scripts that don't use any other code generators, pulling in
build_runneradds dozens of transitive dependencies and significant setup overhead.Feature Request:
bin/build_version.dartmapped underexecutables: build_version: null) that supports:dart run build_version --write: Readspubspec.yamland writeslib/src/version.dartdirectly.dart run build_version --verify: Verifies thatlib/src/version.dartmatchespubspec.yamland exits non-zero if out of sync.expectVersionInSync()) inpackage:build_versionorpackage:build_verifysotest/version_test.dartcan verify version synchronization directly indart testin milliseconds without running a full build.