FLUTTER ECOSYSTEM

kevmoo/build_version

用于将包版本提取到代码中的构建器

build_version 项目封面
Stars
44
Forks
17
最近推送(UTC)
2026年9月12日
项目状态
未归档
Kevin Moore GitHub avatar
GITHUB User

Kevin Moore ↗

A Product Manager at @google working on @dart-lang and @flutter web technologies

@dart-lang @flutter @googleSeattle, WA, USA官方网站 ↗
语言Dart

技术话题

此仓库发布的插件

使用的依赖

依赖清单 9 项

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

CI Pub Package package publisher

Include the version of your package in our source code.

  1. Add build_version to pubspec.yaml. Also make sure there is a version field.

    name: my_pkg
    version: 1.2.3
    dev_dependencies:
      build_runner: ^1.0.0
      build_version: ^2.0.0
    
  2. Run a build.

    > dart run build_runner build
    

    lib/src/version.dart will be generated with content:

    // Generated code. Do not modify.
    const packageVersion = '1.2.3';
    

To change the path of the generated file, create a build.yaml in the root of your package. By changing the output option of this builder, the path can be customized:

targets:
  $default:
    builders:
      build_version:
        options:
          output: lib/src/custom/path/to/version.dart