davidmiura / gradle-versioner

Gradle Version Plugin. Generates semantic versions with git meta data per branch.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status Coverage Status

Overview

With this plugin, you can create project versions like:

2.1.6.master.d9741b1 or 0.0.6.feature-fixing-something.c3751f4

The values in the version string are derived from the state of the git repository. This allows you to:

  1. Not worry about what the project version should be
  2. Project version is set based on your branch name so
    1. Alleviates issues of updating the version before you push.
    2. You know where a version of a library came from
  3. The commit hash is part of the version string so hot fixing is based off the correct commit hash, not from a branch you think is probably the right place to fork.

Adding to your project

Outlined here: https://plugins.gradle.org/plugin/com.sarhanm.versioner

Buildscript DSL

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "com.sarhanm:gradle-versioner:2.2.11"
  }
}

// The versioner
apply plugin: "com.sarhanm.versioner"

// Optional: the version resolver
apply plugin: "com.sarhanm.version-resolver"

Using the plugins mechanism

plugins {
  //Versioner
  id "com.sarhanm.versioner" version "2.2.11"
  
  //Version Resolver (optional)
  id "com.sarhanm.version-resolver" version "2.2.11"
}

Full Documentation

Full Documenation is on the wiki

About

Gradle Version Plugin. Generates semantic versions with git meta data per branch.


Languages

Language:Groovy 99.8%Language:Shell 0.2%