Buscar pacotes, repositórios e categorias de apps

Repositório GitHubkevmoo/build_version

build_version

Um construtor para extrair uma versão de pacote para código

Capa do projeto build_version
Estrelas
44
Forks
17
Último push (UTC)
12 de set. de 2026
Status do projeto
Ativo

README original

Texto original em inglês. Visite o GitHub para a versão atual.

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
Kevin Moore GitHub avatar
Autor no GitHub

Kevin Moore ↗

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

@dart-lang @flutter @googleSeattle, WA, USASite oficial ↗
LinguagensDart

Categorias

Pacotes publicados por este repositório

Dependências usadas

Lista de dependências 9 itens

Como escolher um repositório para seu projeto?

Filtre pelo caso de uso, compare a atividade e confira o projeto original antes de adotá-lo.

  1. Busque por nome, autor ou descrição e filtre por tema.
  2. Compare estrelas, forks e envios recentes. Estrelas indicam interesse, mas não garantem qualidade.
  3. Confira o README, a licença e as issues no GitHub antes de usar o projeto.

Fontes e manutenção

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗