From a4869e9b047a2d038e412ec467e4256e1053776a Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Fri, 29 Jun 2018 23:55:47 -0700 Subject: [PATCH] Second draft. --- README.md | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cb913e9..4e74f31 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ [![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](http://opensource.org/licenses/BSD-3-Clause) [![CircleCI](https://circleci.com/gh/ethauvin/semver-gradle/tree/master.svg?style=shield)](https://circleci.com/gh/ethauvin/semver-gradle/tree/master) -A [Semantic Version](https://semver.org) Plugin for [Gradle](https://gradle.org) that manages a project version via a properties file, and provide tasks to automatically increase major, minor and patch build numbers. +# Semantic Version Plugin for Gradle + +A [Semantic Version](https://semver.org) Plugin for [Gradle](https://gradle.org) that manages a project version via a properties file, and provide tasks to __automatically increment__ major, minor and patch build numbers. ## Using the plugin @@ -60,6 +62,26 @@ Property | Description | Default `version.buildMeta ` | The build metatdata version | `version.preReleasePrefix` | The pre-release prefix | `-` `version.buildMetaPrefix ` | The build metadata prefix | `+` +`version.separator` | The version separator. | `.` + +The version number is built as follows: + + +`version.major` `version.separtor` `version.minor` `version.separator` `version.preReleasePrefix` `version.preRelease` `version.buildMetaPrefix` `version.buildMeta` + +for example: + +```ini +#version.properties +version.major=1 +version.minor=0 +version.patch=0 +version.preRelease=beta +version.buildMeta=exp.sha.5114f85 +``` + +`projet.version` will be `1.0.0-beta+exp.sha.5114f85` in Gradle. + ### Semver Task @@ -107,4 +129,8 @@ Properties | Description | Default `preReleasePrefixKey` | The build pre-release prefix key. | `version.preReleasePrefix` `buildMetaKey` | The build metadata property key. | `version.buildMeta` `buildMetaPrefixKey` | The build metadata prefix property key. | `version.buildMetaPrefix` -`separatorKey` | The separator property key. | `version.separator` \ No newline at end of file +`separatorKey` | The separator property key. | `version.separator` + +## Source Code Generation + +If you'd like to incorporate the version number data into your source code, please have a look at my [Semantic Version Annotation Processor](https://github.com/ethauvin/semver). \ No newline at end of file