All Projects → davideas → Grabver

davideas / Grabver

Licence: apache-2.0
Gradle Automatic Build Versioning Plugin - An easy Gradle plugin that follows semver.org rules to automatically generate the Patch version, Build number and Code version, while Major, Minor and Pre-Release suffix remain under our control.

Programming Languages

groovy
2714 projects

Projects that are alternatives of or similar to Grabver

Reckon
Infer a project's version from your Git repository.
Stars: ✭ 124 (+217.95%)
Mutual labels:  gradle, versioning, version, semver
zerover
0️⃣ Minimalist versioning scheme for devs who can't be bothered.
Stars: ✭ 141 (+261.54%)
Mutual labels:  semver, versioning, version
Semver.c
Semantic version library written in ANSI C
Stars: ✭ 147 (+276.92%)
Mutual labels:  versioning, version, semver
Gradle Advanced Build Version
A plugin to generate the Android version code and version name automatically based on git commits number, date and ...
Stars: ✭ 545 (+1297.44%)
Mutual labels:  gradle, versioning, android-studio
Version
Represent and compare versions via semantic versioning (SemVer) in Swift
Stars: ✭ 160 (+310.26%)
Mutual labels:  versioning, version, semver
perfekt
Release, changelog and version your packages with perfe(k)t 👌 ease!
Stars: ✭ 15 (-61.54%)
Mutual labels:  semver, versioning, version
Python Semver
Python package to work with Semantic Versioning (http://semver.org/)
Stars: ✭ 264 (+576.92%)
Mutual labels:  versioning, version, semver
Axion Release Plugin
Gradle release & version management plugin.
Stars: ✭ 372 (+853.85%)
Mutual labels:  gradle, versioning
React Native Version
🔢 Version your React Native or Expo app in a `npm version` fashion.
Stars: ✭ 408 (+946.15%)
Mutual labels:  versioning, semver
Android Tips Tricks
☑️ [Cheatsheet] Tips and tricks for Android Development
Stars: ✭ 4,496 (+11428.21%)
Mutual labels:  gradle, android-studio
Android Studio Poet
Generate large Android Studio projects
Stars: ✭ 489 (+1153.85%)
Mutual labels:  gradle, android-studio
Arcgis Runtime Samples Android
ArcGIS Runtime SDK for Android Samples
Stars: ✭ 518 (+1228.21%)
Mutual labels:  gradle, android-studio
Standard Version
🏆 Automate versioning and CHANGELOG generation, with semver.org and conventionalcommits.org
Stars: ✭ 5,806 (+14787.18%)
Mutual labels:  versioning, version
Jsemver
Java implementation of the SemVer Specification
Stars: ✭ 360 (+823.08%)
Mutual labels:  versioning, semver
The Pit Of The Android Studio
👍 👍 👏 🌟 ⭐️ ⭐️ Everything about the Android Studio and Intellij IDEAfor example:Install,common problems and solutions,each libraries for android and androidx library,code and peoject templates,etc.全面总结Android Studio以及Intellij IDEA的填坑指南,详解AS版本号、Gradle版本、BuildTools三者的对照关系,AS模板配置,gradle插件,Android自带注解库详解,support详解等干货。
Stars: ✭ 296 (+658.97%)
Mutual labels:  gradle, android-studio
Android Tech Docs
Android官方技术文档翻译
Stars: ✭ 460 (+1079.49%)
Mutual labels:  gradle, android-studio
Cli
🆑📍 Setup automated semver compliant package publishing
Stars: ✭ 272 (+597.44%)
Mutual labels:  version, semver
Calver
📅 The web's go-to resource for Calendar Versioning info.
Stars: ✭ 271 (+594.87%)
Mutual labels:  versioning, version
Light Novel Library wenku8 android
[CASUALLY MAINTAINED] 轻小说文库 (Wenku8.com) 安卓版第三方公益App,始于2014年的Material Design风格、无广告、不盈利、Google Play上安装包最小的轻小说阅读器(light novel reader)。目前除了网站的API以外,还添加了我自己架的Cloudflare Worker 中继节点用来突破网站API的限制 wenku8-relay.mewx.org.
Stars: ✭ 772 (+1879.49%)
Mutual labels:  gradle, android-studio
Gogradle
A Gradle Plugin Providing Full Support for Go
Stars: ✭ 712 (+1725.64%)
Mutual labels:  gradle, build

Gradle Gradle Gradle Licence

Logo

An easy Gradle plugin that follows semver.org rules to automatically generate the Patch version, Build number and Code version, while Major, Minor and Pre-Release suffix remain under our control.

I saw plenty of plugins that require a long configuration and continuous adjustment just to update those numbers, if so, better without any plugin then! With this plugin we are required to manage only 2 variables.

Inspired from Android Studio Automatic Incremental Gradle Versioning. Customized into library with PreRelease, Auto-Reset and Sub-Modules features.

💬 Easy to apply, it works with any project type with sub modules too.

Rules

User values

major: Required, user defined value for breaking changes.
minor: Required, user defined value for new features, but backwards compatible. If you increase Major version, this value must be coherent(=0).
patch: Optional, user defined value (or auto-generated value) for backwards compatible bug fixes only.
preRelease: Optional, user defined value for pre-releases suffix.
incrementOn: Optional, custom task name to trigger the increase of the version (default: assembleRelease, bundleRelease, grabverRelease).
saveOn: Optional, custom task name for which you want to save the versioning file (default: build, assembleDebug, assembleRelease, bundleDebug, bundleRelease, grabverRelease, jar, war, explodedWar).

Calculation

patch - If not specified by user, increases at each release, but it auto resets back to 0 when Minor or Major version changes or if preRelease is set.
build - Increases at each build.
code - Increases at each release.

Installation

Configure script dependencies in the project build.gradle file:

buildscript {
    repositories {
        // Using Bintray repository:
        maven { url "http://dl.bintray.com/davideas/maven" }
        // or Gradle plugins repository:
        maven { url "https://plugins.gradle.org/m2/" }
    }
    dependencies {
        // Using Bintray or Gradle Plugins repository
        classpath "eu.davidea:grabver:2.0.2"
    }
}

Usage

1. Version configuration

Apply the plugin in the module you desire, it will create a version.properties file under that module!

plugins {
    ...
    id 'eu.davidea.grabver'
}

versioning {
    // Required (number)
    major 1
    minor 0
    // Optional, force custom patch (number)
    patch 7
    // Optional (any string)
    preRelease "RC1"
    // Optional, custom task name to trigger the increase of the version
    incrementOn "<task-name>"
    // Optional, custom task name for which you want to save the versioning file
    saveOn "<task-name>"
}

💬 Note: The file version.properties is auto-generated, but once it's created, you can modify its content as of your convenience. Just remember to add it to your Version Control System (from time to time).

2. Grab your new version

versioning.major
versioning.minor
versioning.patch
versioning.build
versioning.preRelease
versioning.code        // needed for all Android projects
versioning.name        // output: "major.minor.patch[-preRelease]"
versioning.fullName    // output: "major.minor.patch[-preRelease] #buildNr built on yyyy.MM.dd"
versioning.builtOn     // output: " built on yyyy.MM.dd"
versioning.date        // or versioning.getDate([format]) - default "yyyy.MM.dd"

// Example: grab the version name
version = versioning.name

⚠️ Note: To trigger the evaluation, user must grab one of the above attribute!

3. Run it

  • Via command line:
/**
 * To increment build number only:
 * - Code and Patch remain unchanged
 */
gradle [build | jar | war | explodedWar | assembleDebug | bundleDebug]

/**
 * To increment build, patch and code:
 * Code and Patch are incremented because of releases:
 * - Code is incremented if exists a release task.
 *   Example: "bundleRelease", "grabverRelease", ":module:assembleRelease"
 * - But Patch may be resetted if Major or Minor is changed or if preRelease is set
 */
gradle [assembleRelease | bundleRelease | grabverRelease]
  • In Android Studio:
    • via menu build > Build Bundle / APK (bundleDebug | assembleDebug)
    • via menu build > Generate Signed Bundle / APK (bundleRelease | assembleRelease).
    • by running the App (assembleDebug | assembleRelease, depending by the build variant).

From version 2, the plugin evaluates the run tasks in silent mode to automatically skip the new version evaluation and to not print unnecessary logs if no save task was detected. A single warning line is however produced.
Single tasks performed such as clean, test, flyway and all third parties invented plugin tasks out there will not trigger the versioning evaluation. Example:

Command Outcome
gradle clean test Evaluation skipped
gradle javadoc Evaluation skipped
gradle flywayClean Evaluation skipped
gradle clean build Evaluation triggered and new values saved
gradle clean war grabverRelease Evaluation triggered, versioning increased and new values saved

Contributions

Everybody is welcome to improve existing solution.

💬 Note: Unit tests work fine if you open the project with IntelliJ Idea, while with Android Studio they don't. Alternatively, you can simulate a real build script by running gradle install and gradle -b build-test.gradle [grabverRelease] OR testing with modules gradle build [grabverRelease].

License

Copyright 2017-2019 Davidea Solutions Sprl

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].