<commit_before>= JGitflow Gradle Plugin
:author: <NAME>
:version: 0.3.2
:hardbreaks:

image:https://travis-ci.org/RobWin/jgitflow-gradle-plugin.svg["Build Status", link="https://travis-ci.org/RobWin/jgitflow-gradle-plugin"] image:https://coveralls.io/repos/RobWin/jgitflow-gradle-plugin/badge.svg["Coverage Status", link="https://coveralls.io/r/RobWin/jgitflow-gradle-plugin"] image:https://api.bintray.com/packages/robwin/maven/jgitflow-gradle-plugin/images/download.svg[link="https://bintray.com/robwin/maven/jgitflow-gradle-plugin/_latestVersion"] image:http://img.shields.io/badge/license-ASF2-blue.svg["Apache License 2", link="http://www.apache.org/licenses/LICENSE-2.0.txt"] image:https://img.shields.io/badge/Twitter-rbrtwnklr-blue.svg["Twitter", link="https://twitter.com/rbrtwnklr"] image:https://badges.gitter.im/Join%20Chat.svg[link="https://gitter.im/RobWin/jgitflow-gradle-plugin?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"]

== Overview

This is a Gradle Plugin which adds tasks to Gradle to support the https://de.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow/[Gitflow Workflow]. The Gitflow Workflow provides a robust framework for managing larger projects. The Plugin uses `org.eclipse.jgit` and `external.atlassian.jgitflow:jgit-flow-core` to implement the Gitflow Workflow. The project is inspired by the http://jgitflow.bitbucket.org/[JGitFlow Maven Plugin].
The Plugin adds the task group `jgitflow` which contains the following tasks:

* `initJGitflow`: Initializes the JGitflow context. Creates a develop branch and switches to develop branch.
* `releaseStart`: Creates a release branch `release/<releaseVersion>` from a develop branch and updates the `gradle.properties` file with a release version. Switches to release branch.
* `releaseFinish`: Merges a release branch back into the master branch and develop branch. Tags the release. Removes the release branch. Pushes everything to the remote origin. Switches back to develop branch.
* `releasePublish`: Publishes a release branch to the remote origin.
* `featureStart`: Creates a feature branch `feature/<featureName>` from a develop branch. Switches to feature branch.
* `featureFinish`: Merges a feature branch back into the develop branch. Removes the feature branch. Switches back to develop branch.
* `featurePublish`: Publishes a feature branch to the remote origin.
* `hotfixStart`: Creates a hotfix branch `hotfix/<hotfixName>` from a master branch. Switches to hotfix branch.
* `hotfixFinish`: Merges a hotfix branch back into the master branch and develop branch. Additionally the master merge is tagged with the hotfix version. Switches back to develop branch.
* `hotfixPublish`: Publishes a hotfix branch to the remote origin.

The project requires at least JDK 7.

== Usage Guide

Add the following snippet to your Gradle build file:

[source,groovy]
[subs="attributes"]
----
buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'io.github.robwin:jgitflow-gradle-plugin:{version}'
    }
}

apply plugin: 'io.github.robwin.jgitflow'
----

=== JGitflow context configuration

The default `jgitflow` context configuration looks as follows:

.Branch names
[options="header"]
|===
|Logical branch name | Real branch name
|master | "master"
|develop | "develop"
|feature | "feature/<featureName>"
|release | "release/<releaseVersion>"
|hotfix | "hotfix/<hotfixName>";
|===

By default a release tag has no version prefix.

=== Initializes the JGitflow context

Before you can use the tasks, you must initialize the JGitflow context.

`gradlew initJGitflow`

If you want to change the JGitflow context configuration, you can do the following.

[source,groovy]
----
initJGitflow{
    feature = "features/"
    release = "releases/"
    versiontag = 'v'
}
----

=== Git authentication

If you want to push changes to a remote origin, you must specify your username and password in a `~/.gradle/gradle.properties` file or as a command line parameter.
SSH is not supported yet.

==== Example

----
gitUsername=<username>
gitPassword=<password>
----

or 

`-PgitUsername=<username> -PgitPassword=<password>`

=== Release Start Task

The task exposes a few properties as part of its configuration.

.Properties of releaseStart
[options="header"]
|===
|Mandatory |Property | Description | Type | Default
|Yes |releaseVersion | The version of the release |  String | empty
|No |allowSnapshotDependencies| Allow snapshot library dependencies | Boolean| false
|No |baseCommit| You can optionally supply a base commit sha-1 hash to start the release from. The commit must be on the develop branch. | String| empty
|===

==== Example

The tasks should be invoked via a command line.

`gradlew releaseStart -PreleaseVersion=1.0.0`

=== Release Finish Task

.Properties of releaseFinish
[options="header"]
|===
|Mandatory |Property | Description | Type | Default
|Yes |releaseVersion | The version of the release |  String | empty
|Yes |newVersion | The new version of the develop branch |  String | empty
|Yes |pushRelease | A flag indicating whether or not the finished release should be pushed to remote |  boolean | true
|===

==== Example

The tasks should be invoked via a command line.

`gradlew releaseFinish -PreleaseVersion=1.0.0 -PnewVersion=1.0.1-SNAPSHOT`
`gradlew releaseFinish -PreleaseVersion=1.0.0 -PnewVersion=1.0.1-SNAPSHOT` -PpushRelease=true
`gradlew releaseFinish -PreleaseVersion=1.0.0 -PnewVersion=1.0.1-SNAPSHOT` -PpushRelease=false

=== Feature Start Task

The task exposes a few properties as part of its configuration.

.Properties of featureStart
[options="header"]
|===
|Mandatory |Property | Description | Type | Default
|Yes |featureName | The name of the feature |  String | empty
|===

==== Example

The tasks should be invoked via a command line.

`gradlew featureStart -PfeatureName="NewFeature"`

=== Feature Finish Task

.Properties of featureFinish
[options="header"]
|===
|Mandatory |Property | Description | Type | Default
|Yes |featureName | The name of the feature |  String | empty<commit_msg>fixed minor typo in README<commit_after>= JGitflow Gradle Plugin
:author: <NAME>
:version: 0.3.2
:hardbreaks:

image:https://travis-ci.org/RobWin/jgitflow-gradle-plugin.svg["Build Status", link="https://travis-ci.org/RobWin/jgitflow-gradle-plugin"] image:https://coveralls.io/repos/RobWin/jgitflow-gradle-plugin/badge.svg["Coverage Status", link="https://coveralls.io/r/RobWin/jgitflow-gradle-plugin"] image:https://api.bintray.com/packages/robwin/maven/jgitflow-gradle-plugin/images/download.svg[link="https://bintray.com/robwin/maven/jgitflow-gradle-plugin/_latestVersion"] image:http://img.shields.io/badge/license-ASF2-blue.svg["Apache License 2", link="http://www.apache.org/licenses/LICENSE-2.0.txt"] image:https://img.shields.io/badge/Twitter-rbrtwnklr-blue.svg["Twitter", link="https://twitter.com/rbrtwnklr"] image:https://badges.gitter.im/Join%20Chat.svg[link="https://gitter.im/RobWin/jgitflow-gradle-plugin?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"]

== Overview

This is a Gradle Plugin which adds tasks to Gradle to support the https://de.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow/[Gitflow Workflow]. The Gitflow Workflow provides a robust framework for managing larger projects. The Plugin uses `org.eclipse.jgit` and `external.atlassian.jgitflow:jgit-flow-core` to implement the Gitflow Workflow. The project is inspired by the http://jgitflow.bitbucket.org/[JGitFlow Maven Plugin].
The Plugin adds the task group `jgitflow` which contains the following tasks:

* `initJGitflow`: Initializes the JGitflow context. Creates a develop branch and switches to develop branch.
* `releaseStart`: Creates a release branch `release/<releaseVersion>` from a develop branch and updates the `gradle.properties` file with a release version. Switches to release branch.
* `releaseFinish`: Merges a release branch back into the master branch and develop branch. Tags the release. Removes the release branch. Pushes everything to the remote origin. Switches back to develop branch.
* `releasePublish`: Publishes a release branch to the remote origin.
* `featureStart`: Creates a feature branch `feature/<featureName>` from a develop branch. Switches to feature branch.
* `featureFinish`: Merges a feature branch back into the develop branch. Removes the feature branch. Switches back to develop branch.
* `featurePublish`: Publishes a feature branch to the remote origin.
* `hotfixStart`: Creates a hotfix branch `hotfix/<hotfixName>` from a master branch. Switches to hotfix branch.
* `hotfixFinish`: Merges a hotfix branch back into the master branch and develop branch. Additionally the master merge is tagged with the hotfix version. Switches back to develop branch.
* `hotfixPublish`: Publishes a hotfix branch to the remote origin.

The project requires at least JDK 7.

== Usage Guide

Add the following snippet to your Gradle build file:

[source,groovy]
[subs="attributes"]
----
buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'io.github.robwin:jgitflow-gradle-plugin:{version}'
    }
}

apply plugin: 'io.github.robwin.jgitflow'
----

=== JGitflow context configuration

The default `jgitflow` context configuration looks as follows:

.Branch names
[options="header"]
|===
|Logical branch name | Real branch name
|master | "master"
|develop | "develop"
|feature | "feature/<featureName>"
|release | "release/<releaseVersion>"
|hotfix | "hotfix/<hotfixName>";
|===

By default a release tag has no version prefix.

=== Initializes the JGitflow context

Before you can use the tasks, you must initialize the JGitflow context.

`gradlew initJGitflow`

If you want to change the JGitflow context configuration, you can do the following.

[source,groovy]
----
initJGitflow{
    feature = "features/"
    release = "releases/"
    versiontag = 'v'
}
----

=== Git authentication

If you want to push changes to a remote origin, you must specify your username and password in a `~/.gradle/gradle.properties` file or as a command line parameter.
SSH is not supported yet.

==== Example

----
gitUsername=<username>
gitPassword=<password>
----

or 

`-PgitUsername=<username> -PgitPassword=<password>`

=== Release Start Task

The task exposes a few properties as part of its configuration.

.Properties of releaseStart
[options="header"]
|===
|Mandatory |Property | Description | Type | Default
|Yes |releaseVersion | The version of the release |  String | empty
|No |allowSnapshotDependencies| Allow snapshot library dependencies | Boolean| false
|No |baseCommit| You can optionally supply a base commit sha-1 hash to start the release from. The commit must be on the develop branch. | String| empty
|===

==== Example

The tasks should be invoked via a command line.

`gradlew releaseStart -PreleaseVersion=1.0.0`

=== Release Finish Task

.Properties of releaseFinish
[options="header"]
|===
|Mandatory |Property | Description | Type | Default
|Yes |releaseVersion | The version of the release |  String | empty
|Yes |newVersion | The new version of the develop branch |  String | empty
|Yes |pushRelease | A flag indicating whether or not the finished release should be pushed to remote |  boolean | true
|===

==== Example

The tasks should be invoked via a command line.

`gradlew releaseFinish -PreleaseVersion=1.0.0 -PnewVersion=1.0.1-SNAPSHOT`
`gradlew releaseFinish -PreleaseVersion=1.0.0 -PnewVersion=1.0.1-SNAPSHOT -PpushRelease=true`
`gradlew releaseFinish -PreleaseVersion=1.0.0 -PnewVersion=1.0.1-SNAPSHOT -PpushRelease=false`

=== Feature Start Task

The task exposes a few properties as part of its configuration.

.Properties of featureStart
[options="header"]
|===
|Mandatory |Property | Description | Type | Default
|Yes |featureName | The name of the feature |  String | empty
|===

==== Example

The tasks should be invoked via a command line.

`gradlew featureStart -PfeatureName="NewFeature"`

=== Feature Finish Task

.Properties of featureFinish
[options="header"]
|===
|Mandatory |Property | Description | Type | Default
|Yes |featureName | The name of the feature |  String | empty
{'fraction_non_alphanumeric': 0.10986492018010642, 'fraction_numerical': 0.0052394596807204255, 'mean_word_length': 4.842180774748924, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 22, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '165893', 'n_tokens_mistral': 3729, 'n_tokens_neox': 3566, 'n_words': 1241}