Skip to content

feat: Standalone CLI mode (bin/build_version.dart) and in-memory test helper without build_runner bloat #80

Description

@kevmoo

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:

  1. 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.
  2. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions