git_version 0.3.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 52

GitVersion #

Builder to replace %version%-String in index.tmpl.html and version.tmpl.json. Generates git.version.dart

Important #

If your version schema should have three digits (e.g. v.1.0.0),
tag it only with two digits e.g. git tag v1.0 and let GitVersion do the the rest.

GitVersion counts the commits for a specific version tag and adds the number of commits as the last digit.

git_version uses git describe --tags --match <tag> for this.

Precondition #

# Init your GIT repo
git init

# Add your repo
git remote add origin <your repo>
     
# Make your first commit
git commit -am "Initial release"

# Tag your version
git tag v0.1

Optional - if you want to use showGitVersion on the cmdline

# Install showGitVersion cmdline tool
pub global activate git_version

Usage #

Builder #

Try the mini_web_sample

Run the following command:

pub run build_runner clean && pub run build_runner build

Serve your site:

webdev serve

What the builder does:

  • If it finds index.tmpl.html in your web-folder it replaces %version% with the current version from git and converts the file to index.html

  • If it finds version.tmpl.json in your web-folder it replaces %version% with the current version from git and converts the file to version.json

  • It generates git.version.dart in your web-folder

The file conversion to index.html and version.json happens in your "build-output".
This is usually something like: .dart_tool/build/generated/<your package>

Commandline #

# Go to your local repo
showGitVersion

# Print help
showGitVersion --help
 

Features and bugs #

Please file feature requests and bugs at the issue tracker.

Licence #

Copyright 2018 Michael Mitterer (office@mikemitterer.at),
IT-Consulting and Development Limited

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of the <organization> nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Change Log for git_version #

Replaces the '%version%' placeholder with your current git version

Unreleased #

Feature #

  • Dart 2.x ready, uses builder instead of transformer c12b050

Bugs #

  • Application crashed if folder or parent-folder is not a git-repo 239391f

Docs #

  • Renamed sample-folder to example f0fe031

v0.2 - 2018-06-04

Feature #

  • git_version generates git.version.dart, index.html form index.tmpl.html and version.json from version.tmpl.json 9a82aef
  • Transformer supports now .html, .dart and (new) .json 0318568

Fixes #

  • Fixes rendering problem in pub c61dbc2

Docs #

  • Clarified what version means in this context e1dbc46
  • How to tag for specific version schema 79887b0
  • How to tag for specific version schema 845a8af

Refactor #

  • Changed barback dependency 9a48a38
  • Per default wird als patch-delimiter ein Punkt verwendet ac4bab6
  • Updated log-handler dependencies 7d54047

This CHANGELOG.md was generated with Changelog for Dart

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate git_version

2. Use it

The package has the following executables:


$ showGitVersion

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  git_version: ^0.3.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:git_version/git_version.dart';
  
Version Uploaded Documentation Archive
0.3.0 Aug 14, 2018 Go to the documentation of git_version 0.3.0 Download git_version 0.3.0 archive
0.2.14 Jul 6, 2018 Go to the documentation of git_version 0.2.14 Download git_version 0.2.14 archive
0.2.12 Jun 28, 2018 Go to the documentation of git_version 0.2.12 Download git_version 0.2.12 archive
0.2.11 Jun 28, 2018 Go to the documentation of git_version 0.2.11 Download git_version 0.2.11 archive
0.2.8 Jun 28, 2018 Go to the documentation of git_version 0.2.8 Download git_version 0.2.8 archive
0.2.5 Jun 6, 2018 Go to the documentation of git_version 0.2.5 Download git_version 0.2.5 archive
0.1.28 Apr 10, 2018 Go to the documentation of git_version 0.1.28 Download git_version 0.1.28 archive
0.1.21 Dec 14, 2017 Go to the documentation of git_version 0.1.21 Download git_version 0.1.21 archive
0.1.17 Dec 13, 2017 Go to the documentation of git_version 0.1.17 Download git_version 0.1.17 archive
0.1.15 Dec 13, 2017 Go to the documentation of git_version 0.1.15 Download git_version 0.1.15 archive

All 12 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
6
Health:
Code health derived from static analysis. [more]
98
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
52
Learn more about scoring.

We analyzed this package on Feb 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.13

Platforms

Detected platforms: Flutter, other

Primary library: package:git_version/git_version.dart with components: io.

Health suggestions

Fix bin/showGitVersion.dart. (-1 points)

Analysis of bin/showGitVersion.dart reported 2 hints:

line 20 col 13: Use isNotEmpty instead of length

line 27 col 17: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

Fix lib/builder.dart. (-1 points)

Analysis of lib/builder.dart reported 2 hints:

line 37 col 9: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

line 88 col 9: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

Fix lib/git_version.dart. (-0.50 points)

Analysis of lib/git_version.dart reported 1 hint:

line 42 col 24: Use = to separate a named parameter from its default value.

Maintenance suggestions

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and git_version.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
build ^0.12.0 0.12.8 1.1.1
console_log_handler ^1.0.0 1.1.6
logging >=0.11.3 <1.0.0 0.11.3+2
where ^4.0.0 4.4.0 6.1.0+1
Transitive dependencies
analyzer 0.32.6 0.35.1
ansicolor 1.0.2
args 1.5.1
async 2.0.8
build_cli_annotations 1.0.1
charcode 1.1.2
collection 1.14.11
convert 2.1.1
crypto 2.0.6
csslib 0.14.6
front_end 0.1.4+2 0.1.11
glob 1.1.7
html 0.13.3+3
intl 0.15.7
kernel 0.3.4+2 0.3.11
meta 1.1.7
package_config 1.0.5
path 1.6.2
plugin 0.2.0+3
source_span 1.5.4
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
utf 0.9.0+5
watcher 0.9.7+10
yaml 2.1.15
Dev dependencies
build_runner any
build_test any
build_web_compilers any
test any