gradle-git-version-plugin

Gradle Git Version Plugin

License

License

Categories

Categories

Gradle Build Tools Git Development Tools Version Controls
GroupId

GroupId

se.lovef
ArtifactId

ArtifactId

gradle-git-version-plugin
Last Version

Last Version

0.3.3
Release Date

Release Date

Type

Type

jar
Description

Description

gradle-git-version-plugin
Gradle Git Version Plugin
Project URL

Project URL

https://github.com/lovef/gradle-git-version-plugin
Source Code Management

Source Code Management

https://github.com/lovef/gradle-git-version-plugin

Download gradle-git-version-plugin

How to add to project

<!-- https://jarcasting.com/artifacts/se.lovef/gradle-git-version-plugin/ -->
<dependency>
    <groupId>se.lovef</groupId>
    <artifactId>gradle-git-version-plugin</artifactId>
    <version>0.3.3</version>
</dependency>
// https://jarcasting.com/artifacts/se.lovef/gradle-git-version-plugin/
implementation 'se.lovef:gradle-git-version-plugin:0.3.3'
// https://jarcasting.com/artifacts/se.lovef/gradle-git-version-plugin/
implementation ("se.lovef:gradle-git-version-plugin:0.3.3")
'se.lovef:gradle-git-version-plugin:jar:0.3.3'
<dependency org="se.lovef" name="gradle-git-version-plugin" rev="0.3.3">
  <artifact name="gradle-git-version-plugin" type="jar" />
</dependency>
@Grapes(
@Grab(group='se.lovef', module='gradle-git-version-plugin', version='0.3.3')
)
libraryDependencies += "se.lovef" % "gradle-git-version-plugin" % "0.3.3"
[se.lovef/gradle-git-version-plugin "0.3.3"]

Dependencies

compile (1)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib jar 1.2.41

Project Modules

There are no modules declared in this project.

Build Status Download

Gradle Git Version Plugin

Set version based on git tags and create new git version tags.

Example:

// build.gradle

plugins {
    id 'se.lovef.git-version' version '0.3.2'
}

version gitVersion('1.0')

println "gitVersion: $gitVersion"

task printGitVersion {
    doLast {
        println "gitVersion: $gitVersion"
    }
}

printGitVersion.mustRunAfter tag
// build.gradle.kts

plugins {
    id("se.lovef.git-version") version "0.3.2"
}

version = gitVersion("1.0")

println("gitVersion: $gitVersion")

tasks.register("printGitVersion") {
    doLast {
        println("gitVersion: $gitVersion")
    }
    mustRunAfter(tasks["tag"])
}

Output:

$ ./gradlew tag printGitVersion

> Configure project :
gitVersion: { version: "1.0-SNAPSHOT", tag: null }

> Task :tag
Created tag v1.0.0

Commands:

    git tag --delete v1.0.0    # delete
    git push origin  v1.0.0    # push to origin

New version: 1.0.0

> Task :printGitVersion
gitVersion: { version: "1.0.0", tag: "v1.0.0" }

BUILD SUCCESSFUL in 1s
2 actionable tasks: 2 executed

An attribution

This project is in part inspired by Git-Version Gradle Plugin

Versions

Version
0.3.3
0.3.2
0.3.1
0.2.3
0.2.0
0.1.1
0.1.0
0.0.2