Gradle plugin to use git tags as project version names

Overview

Version Name Gradle Plugin

This plugin adds a kotlin extension function that provides a version name based on the latest git tag.

How to use it 👣

Apply the plugin in build.gradle.kts:

plugins {
    id("com.doist.gradle.version-name")
}

Then, you can use:

versionName = project.versionName()

It adds also project.versionCode() extension method that's useful in Android projects. This can be used like:

android {
    defaultConfig {
        versionCode = project.versionCode()
        versionName = project.versionName()
        ...
    }
}

Version name is calculated based on the latest git tag. To be specific it uses following command to get it:

git describe --tags --abbrev=0 --match $prefix*

It requires git.

Version code is a version name without a prefix, v by default.

Configuration ⚙️

versionName {
    namePrefix.set("v")
}

Contributing 🤝

Feel free to open an issue or submit a pull request for any bugs/improvements.

Acknowledgements 🙏

This plugin is based on kotlin-gradle-plugin-template 🐘

You might also like...
 Gradle plugin which downloads and manages your Android SDK.
Gradle plugin which downloads and manages your Android SDK.

DEPRECATED This plugin is deprecated and is no longer being developed. Tools and dependencies are automatically downloaded using version 2.2.0 of the

A Gradle plugin to support the Groovy language for building Android apps

Groovy language support for Android Deprecated: This plugin has been deprecated in favor of Kotlin which has the full support of JetBrains and Google.

Add a different ribbon to each of your Android app variants using this gradle plugin. Of course, configure it as you will

Easylauncher gradle plugin for Android Modify the launcher icon of each of your app-variants using simple gradle rules. Add ribbons of any color, over

A Gradle Plugin that removes unused resources in Android projects.
A Gradle Plugin that removes unused resources in Android projects.

#Lint Cleaner Plugin Removes unused resources reported by Android lint including strings, colors and dimensions. Depracated As of Android Studio 2.0+

Gradle plugin for Google Protocol Buffers

Gradle Protobuf Plugin Author: Andrew Kroh Download: See maven central License: Apache License, Version 2.0 Requirements: Java 1.5+ Google Protocol Bu

Gradle plugin which validates the licenses of your dependency graph match what you expect

Licensee 📜 👀 A Gradle plugin which validates the licenses of your dependency graph match what you expect, or it fails your build! Jump to: Introduct

IntelliJ plugin that provides some useful utilities to support the daily work with Gradle.
IntelliJ plugin that provides some useful utilities to support the daily work with Gradle.

IntelliJ Gradle Utilities Plugin This IntelliJ plugin provides some useful utilities to support the daily work with Gradle. It's available on the offi

Gradle plugin which helps you analyze the size of your Android apps.
Gradle plugin which helps you analyze the size of your Android apps.

Ruler Ruler is a Gradle plugin which helps you analyze the size of your Android apps. Motivation App size is an important metric which directly correl

Comments
  • Configure Renovate

    Configure Renovate

    WhiteSource Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • .github/workflows/gradle-wrapper-validation.yml (github-actions)
    • .github/workflows/pre-merge.yml (github-actions)
    • .github/workflows/publish-plugin.yml (github-actions)
    • gradle/wrapper/gradle-wrapper.properties (gradle-wrapper)

    Configuration Summary

    Based on the default config's presets, Renovate will:

    • Start dependency updates only once this onboarding PR is merged
    • Enable Renovate Dependency Dashboard creation
    • If semantic commits detected, use semantic commit type fix for dependencies and chore for all others
    • Ignore node_modules, bower_components, vendor and various test/tests directories
    • Autodetect whether to pin dependencies or maintain ranges
    • Rate limit PR creation to a maximum of two per hour
    • Limit to maximum 10 open PRs at any time
    • Group known monorepo packages together
    • Use curated list of recommended non-monorepo package groupings
    • Fix some problems with very old Maven commons versions
    • Ignore spring cloud 1.x releases
    • Ignore http4s digest-based 1.x milestones
    • Use node versioning for @types/node
    • Limit concurrent requests to reduce load on Repology servers until we can fix this properly, see issue 10133

    🔡 Would you like to change the way Renovate is upgrading your dependencies? Simply edit the renovate.json in this branch with your custom config and the list of Pull Requests in the "What to Expect" section below will be updated the next time Renovate runs.


    What to Expect

    With your current configuration, Renovate will create 3 Pull Requests:

    chore(deps): update dependency gradle to v6.9.2
    • Schedule: ["at any time"]
    • Branch name: renovate/gradle-6.x
    • Merge into: main
    • Upgrade gradle to 6.9.2
    chore(deps): update actions/cache action to v2
    • Schedule: ["at any time"]
    • Branch name: renovate/actions-cache-2.x
    • Merge into: main
    • Upgrade actions/cache to v2
    chore(deps): update dependency gradle to v7
    • Schedule: ["at any time"]
    • Branch name: renovate/gradle-7.x
    • Merge into: main
    • Upgrade gradle to 7.3.3

    🚸 Branch creation will be limited to maximum 2 per hour, so it doesn't swamp any CI resources or spam the project. See docs for prhourlylimit for details.


    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 1
Owner
Doist
On a mission to create the Workplace of the Future
Doist
gradle-android-scala-plugin adds scala language support to official gradle android plugin

gradle-android-scala-plugin gradle-android-scala-plugin adds scala language support to official gradle android plugin. See also sample projects at htt

saturday06 345 Dec 10, 2022
Ownership-gradle-plugin - Gradle code ownership verification plugin

Gradle code ownership verification plugin A gradle plugin that will verify owner

null 4 Dec 15, 2022
Git Flow Integration plugin for IntelliJ

Git Flow Integration for Intellij An intelliJ plugin providing a UI layer for git-flow, which in itself is a collection of Git extensions to provide h

Opher Vishnia 505 Dec 1, 2022
Helper to upload Gradle Android Artifacts, Gradle Java Artifacts and Gradle Kotlin Artifacts to Maven repositories (JCenter, Maven Central, Corporate staging/snapshot servers and local Maven repositories).

GradleMavenPush Helper to upload Gradle Android Artifacts, Gradle Java Artifacts and Gradle Kotlin Artifacts to Maven repositories (JCenter, Maven Cen

 Vorlonsoft LLC 21 Oct 3, 2022
Gradle plugin to help use create project

Infra-Gradle-Plugin 该插件旨在简化 Gradle 项目配置,几行代码就可以迅速开始一个项目, 仅支持 Kotlin DSL, Groovy 未测试! 引入插件 plugins { id("com.labijie.infra") version "your version"

Red Sparrow 0 Dec 23, 2021
Provides a shortcut to copy permalink in their online Git repositories from inside IDE.

Copy Git Link Provides a shortcut to copy permalink in their online Git repositories from inside IDE. Works with: GitHub GitLab Bitbucket My.Movie.4.3

ryo 13 Jan 3, 2023
Android gradle version and plugins

android-gradle-plugin Android gradle version and plugins Version catalogs Shared catalogs 를 사용한 android version catalogs 입니다. Usage settings.gradle.kt

null 2 Aug 26, 2022
A Gradle plugin for providing your secrets to your Android project.

Secrets Gradle Plugin for Android A Gradle plugin for providing your secrets securely to your Android project. This Gradle plugin reads secrets from a

Google 560 Jan 8, 2023
GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.

Gradle Play Publisher Gradle Play Publisher is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and

null 3.9k Dec 30, 2022
A Gradle plugin to report the number of method references in your APK on every build.

Dexcount Gradle Plugin A Gradle plugin to report the number of method references in your APK, AAR, or java module. This helps you keep tabs on the gro

Keepsafe 3k Dec 29, 2022