A builder for extracting a package version into code

Overview

Pub

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 pub 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](build config) 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
Comments
  • Rebase & refine PR #7

    Rebase & refine PR #7

    A continuation from #7, since the original PR cannot be updated. Includes all nits mentioned there. Also updated readme and added a new test.

    PTAL @kevmoo

    opened by lexaknyazev 2
  • Split build name and build number

    Split build name and build number

    Description

    The version often includes a version name and a version number, i.e. 4.2.3+45.

    It would be useful to generate two different constants:

    const buildName = '4.2.3';
    
    const buildNumber = '45';
    
    const packageVersion = '$buildName+$buildNumber';
    
    opened by mrverdant13 1
  • Migrate a bunch of dart-lang packages to this

    Migrate a bunch of dart-lang packages to this

    • [ ] https://github.com/dart-lang/dart_style/blob/6f3efd209ff1828835936397b64be79265cc0c19/bin/format.dart#L18
    • [x] dartdoc - https://github.com/dart-lang/dartdoc/pull/1751
    • [x] pana - https://github.com/dart-lang/pana/pull/401
    • [x] stagehand - https://github.com/dart-lang/stagehand/pull/579
    opened by kevmoo 1
  • Bump actions/checkout from 3.1.0 to 3.2.0

    Bump actions/checkout from 3.1.0 to 3.2.0

    Bumps actions/checkout from 3.1.0 to 3.2.0.

    Release notes

    Sourced from actions/checkout's releases.

    v3.2.0

    What's Changed

    New Contributors

    Full Changelog: https://github.com/actions/checkout/compare/v3...v3.2.0

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Use correct generated file location in build.yaml

    Use correct generated file location in build.yaml

    Hey! Just found your package, looked into the build.yaml to find out where the generated file is placed, and was confused that the import couldn't be resolved. Best regards!

    opened by pschiffmann 0
  • Git

    Git

    I need to add some informations about the current git status to my app. What would be the best solution ?

    version.dart looks like the best candidate but git is not part of the project goals ...

    Thanks

    opened by Solido 0
Owner
Kevin Moore
A Product Manager at @google working on @dart-lang and @flutter web technologies and our package ecosystem.
Kevin Moore
Form builder image picker - Form builder image picker for flutter

form_builder_image_picker Field for picking image(s) from Gallery or Camera for

Ferri Sutanto 0 Jan 28, 2022
Extract pubspec details (such as package version, author and description) into Dart code.

build_pubspec This package helps you convert fields from your pubspec.yaml file into Dart code. Based on the fields in your pubspec, this package will

dartside.dev 9 Jul 15, 2021
A simple dart library for extracting the Open Graph protocol on a web pages

ogp_data_extract A simple dart library for extracting the Open Graph protocol on

KINTO 0 Jan 12, 2022
Link-extractor - A Simple utility for extracting media urls from different websites

Link Extractor A Simple utility for extracting media urls from differennt social

Zain Ul Hassan 1 Feb 5, 2022
Shader manages the compilation of your GLSL shaders into SPIR-V byte code and Dart code

shader Shader manages the compilation of your GLSL shaders into SPIR-V byte code and Dart code. Quickstart # Install cli dart pub global activate shad

Felix Blaschke 25 Dec 1, 2022
A flutter plugin about qr code or bar code scan , it can scan from file、url、memory and camera qr code or bar code .Welcome to feedback your issue.

r_scan A flutter plugin about qr code or bar code scan , it can scan from file、url、memory and camera qr code or bar code .Welcome to feedback your iss

PengHui Li 112 Nov 11, 2022
Jannis 0 Jan 29, 2022
It's OK to love Flutter and hate hand-coding design elements. Parabeac-Core converts design files into Flutter code.

Parabeac-Core Parabeac-Core converts design files into Flutter code driven by open-source & community. Contribute · Discord Community · Designer Proto

Parabeac 536 Jan 4, 2023
Call Kit is a prebuilt feature-rich call component, which enables you to build one-on-one and group voice/video calls into your app with only a few lines of code.

Call Kit (ZegoUIKitPrebuiltCall) Call Kit is a prebuilt feature-rich call component, which enables you to build one-on-one and group voice/video calls

ZEGOCLOUD 9 Dec 26, 2022
Immutable Dart collections via the builder pattern.

Built Collections for Dart Introduction Built Collections are immutable collections using the builder pattern. Each of the core SDK collections is spl

Google 250 Dec 20, 2022
An rx stream builder widget that is able to pre-populate a flutter StreamBuilder with data from an rx stream if the stream is either a value or a replay observable.

An rx stream builder widget that is able to pre-populate a flutter StreamBuilder with data from an rx stream if the stream is either a value or a replay observable. For example the RX stream is a BehaviorSubject or a ReplaySubject.

Jon Samwell 8 Jan 22, 2022
Debounce builder, debounce timer

Debounce builder, debounce timer Features debounce builder - Widget provides debounce function from DebounceTimer instance debounce timer

Pokhodyun Alexander 2 Dec 22, 2022
Mempelajari Listview.builder

tugas_flutter_2 Sebuah tugas flutter yang dimana mempelajari banyak hal yaitu Listview.builder online API TabView Personal Deskripsi Project ini hasil

Jarganaya 3 Sep 9, 2022
An interpolated progress builder for video_player controllers

Have you been here before: you created a video player using video_player, but the progress bar updates way to infrequently and makes your UX look chop

Tim 8 Aug 2, 2022
Lite version of smart_select package, zero dependencies, an easy way to provide a single or multiple choice chips.

Lite version of smart_select package, zero dependencies, an easy way to provide a single or multiple choice chips. What's New in Version 2.x.x Added p

Irfan Vigma Taufik 97 Dec 15, 2022
Flutter package for prompting users to upgrade when there is a newer version of the app in the store.

Upgrader Flutter package for prompting users to upgrade when there is a newer version of the app in the store. When a newer app version is availabe in

Larry Aasen 362 Jan 1, 2023
[Flutter package] An easy and quick way to check if the local app is updated with the same version in their respective stores (Play Store / Apple Store ).

Retrieve version and url for local app update against store app Android and iOS Features Using as reference packages like in_app_update , version_chec

Kauê Murakami 11 Nov 9, 2022
A cross-platform flutter package to convert your links into rich beautiful previews.

Link Preview Generator A cross-platform flutter package to convert your links into rich beautiful previews. This package is inspired from Any Link Pre

Pranav Bedre 12 Oct 21, 2022