Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/glovo/gradle-versioning-plugin
A Gradle plugin implementing https://semver.org/
https://github.com/glovo/gradle-versioning-plugin
android gradle java kotlin p-none semantic-versioning t-none versioning
Last synced: 23 days ago
JSON representation
A Gradle plugin implementing https://semver.org/
- Host: GitHub
- URL: https://github.com/glovo/gradle-versioning-plugin
- Owner: Glovo
- License: other
- Archived: true
- Created: 2019-06-13T08:20:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-06T15:27:10.000Z (11 months ago)
- Last Synced: 2024-11-16T03:39:32.999Z (3 months ago)
- Topics: android, gradle, java, kotlin, p-none, semantic-versioning, t-none, versioning
- Language: Kotlin
- Homepage:
- Size: 398 KB
- Stars: 2
- Watchers: 218
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> [!CAUTION]
> This project is officially unmaintained and known incompatible with `Gradle 9` and its `Configuration Cache`.[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](./LICENSE)
[![Maven Central](https://img.shields.io/maven-central/v/com.glovoapp.gradle/versioning)](https://search.maven.org/artifact/com.glovoapp.gradle/versioning)
[![Gradle Plugin Portal](https://img.shields.io/gradle-plugin-portal/v/com.glovoapp.semantic-versioning)](https://plugins.gradle.org/plugin/com.glovoapp.semantic-versioning)
![Build Status](https://github.com/Glovo/gradle-versioning-plugin/actions/workflows/build.yaml/badge.svg)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Glovo_gradle-versioning-plugin&metric=coverage&token=6b5b2b8c32bc6be61f60223590e3d1be371ac0fb)](https://sonarcloud.io/dashboard?id=Glovo_gradle-versioning-plugin)
# gradle-versioning-pluginA Gradle plugin to unify the versioning workflow of Gradle builds.
## Features
- Automatic sync Gradle builds's `version` property.
- Automatic update of `versionName` and `versionCode` of an Android project## Usage
For automatic `version` handling on any Gradle build add:
```kotlin
plugins {
id("com.glovoapp.semantic-versioning") version < latest >
}
```Once applied, the `Project.version` will be set with the given version
which can it also be accessed from `semanticVersion.version` property:
```kotlintask("printVersion") {
doLast {
pritnln("The project current version is ${project.semanticVersion.version.get()}")
}
}
```The plugin requires a `version.properties` file at root project containing the current version entry:
```properties
version=1.2.3
```A `incrementSemanticVersion` task will be added to the build. When triggered (from CI for instance) it will increase the
version and update the file.```shell
./gradlew incrementSemanticVersion
```Will result on
```properties
version=1.2.4
```You may specify also which version to increase: `--major`, `--minor` or `--path`
```shell
./gradlew incrementSemanticVersion --major
```Will result on
```properties
version=2.0.0
```### Android Version Name plugin
An Android extension is also available by applying:
```kotlin
plugins {
id("com.glovoapp.android-versioning") version < latest >
}
```Once applied, version can access from the `android.versioning.version` property:
```kotlintask("printVersion") {
doLast {
val androidVersion = project.android.versioning.version.get()
pritnln("The project current versionCode is ${androidVersion.code} and name is ${androidVersion.name}")
}
}
```The plugin requires a `version.properties` file at root project containing the at least one of the following entries:
```properties
versionCode=10
versionName=1.2.3
```If `versionCode` is set, and `incrementVersionCode` task will be added to the project.
The behavior is the same, when run, the task will increment the `versionCode` by 1 (or by `--amount=XXX`)If `versionName` is set, and `incrementVersionName` task will be added to the project.
The behavior is exactly the same as the `incrementSemanticVersion` task for non-Android projects.