All Projects → moallemi → Gradle Advanced Build Version

moallemi / Gradle Advanced Build Version

Licence: apache-2.0
A plugin to generate the Android version code and version name automatically based on git commits number, date and ...

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Gradle Advanced Build Version

Grabver
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.
Stars: ✭ 39 (-92.84%)
Mutual labels:  gradle, versioning, android-studio
Phoenix For Vk
Yet another VK client for Android
Stars: ✭ 131 (-75.96%)
Mutual labels:  gradle, android-studio
Reckon
Infer a project's version from your Git repository.
Stars: ✭ 124 (-77.25%)
Mutual labels:  gradle, versioning
Maven Git Versioning Extension
This extension will virtually set project versions, based on current git branch or tag.
Stars: ✭ 178 (-67.34%)
Mutual labels:  gradle, versioning
Fastdex
🚀 加快 apk 的编译速度 🚀
Stars: ✭ 1,457 (+167.34%)
Mutual labels:  gradle, android-studio
Anychart Android
AnyChart Android Chart is an amazing data visualization library for easily creating interactive charts in Android apps. It runs on API 19+ (Android 4.4) and features dozens of built-in chart types.
Stars: ✭ 1,762 (+223.3%)
Mutual labels:  gradle, android-studio
Versioning
Gradle plug-in to generate version information from the SCM branch (Git or Svn)
Stars: ✭ 157 (-71.19%)
Mutual labels:  gradle, versioning
Android Basic Samples
Google Play game services - Android samples
Stars: ✭ 934 (+71.38%)
Mutual labels:  gradle, android-studio
AndroidDevTools
收集整理Android开发所需的Android SDK、开发中用到的工具、Android开发教程、Android设计规范,免费的设计素材等。
Stars: ✭ 7,284 (+1236.51%)
Mutual labels:  gradle, android-studio
Arcgis Runtime Samples Android
ArcGIS Runtime SDK for Android Samples
Stars: ✭ 518 (-4.95%)
Mutual labels:  gradle, android-studio
Android Studio Poet
Generate large Android Studio projects
Stars: ✭ 489 (-10.28%)
Mutual labels:  gradle, android-studio
Axion Release Plugin
Gradle release & version management plugin.
Stars: ✭ 372 (-31.74%)
Mutual labels:  gradle, versioning
Quiz
An android application which uses Open Trivia Api.
Stars: ✭ 34 (-93.76%)
Mutual labels:  gradle, android-studio
Android Tips Tricks
☑️ [Cheatsheet] Tips and tricks for Android Development
Stars: ✭ 4,496 (+724.95%)
Mutual labels:  gradle, android-studio
Refreshversions
Life is too short to google for dependencies and versions
Stars: ✭ 841 (+54.31%)
Mutual labels:  gradle, versioning
Android Development Aircraft Carrier
打造安卓开发航空母舰,Android Studio 使用集锦
Stars: ✭ 138 (-74.68%)
Mutual labels:  gradle, android-studio
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 (+41.65%)
Mutual labels:  gradle, android-studio
Globallydynamic
Dynamic Delivery everywhere through a common API
Stars: ✭ 248 (-54.5%)
Mutual labels:  gradle, android-studio
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 (-45.69%)
Mutual labels:  gradle, android-studio
Android Tech Docs
Android官方技术文档翻译
Stars: ✭ 460 (-15.6%)
Mutual labels:  gradle, android-studio

Gradle Advanced Build Version Plugin

A plugin to generate the Android version code and version name automatically based on git commits number, date and Semantic Versioning.

GitHub Workflow Status Maven Central Coverage

Contents

  1. Installation
  2. How to use
  3. Version Name Configuration
  4. Version Code Configuration
  5. File output options

Installation

Add the advanced-build-version plugin to your build script and use the property advancedVersioning.versionName and advancedVersioning.versionCode where you need:

buildscript {
  repositories {
    jcenter()
  }

  dependencies {
    classpath 'me.moallemi.gradle:advanced-build-version:1.7.3'
  }
}

apply plugin: 'me.moallemi.advanced-build-version'

How to use

advancedVersioning {
  nameOptions { }
  codeOptions { }
  outputOptions { }
}

def appVersionName = advancedVersioning.versionName
def appVersionCode = advancedVersioning.versionCode

Version Name Configuration

You can customize version name in your build.gradle file as follows:

advancedVersioning {
  nameOptions {
    versionMajor 1
    versionMinor 3
    versionPatch 6
    versionBuild 8
  }
}

the above configuration will output 1.3.6.8

there is no need to specify all params because they will be handled automatically. for example:

advancedVersioning {
  nameOptions {
    versionMajor 1
    versionBuild 8
  }
}

will output 1.0.0.8 and

advancedVersioning {
  nameOptions {
    versionMajor 1
    versionMinor 3
  }
}

will output 1.3

Version Code Configuration

To customize version code in your build.gradle file write:

Groovy:

advancedVersioning {
  codeOptions {
    versionCodeType 'GIT_COMMIT_COUNT'
  }
}

Kotlin:

import me.moallemi.gradle.advancedbuildversion.gradleextensions.VersionCodeType.*

advancedVersioning {
  codeOptions {
    versionCodeType(GIT_COMMIT_COUNT)
  }
}

versionCodeType can be one of following params:

  • GIT_COMMIT_COUNT will output total commits number in current branch
  • DATE formatted number e.g.: 1501101614
  • AUTO_INCREMENT_DATE will output 101101614
  • AUTO_INCREMENT_ONE_STEP will output e.g: 24
  • AUTO_INCREMENT_STEP will output e.g: 26

AUTO_INCREMENT_ONE_STEP and AUTO_INCREMENT_STEP store AI_VERSION_CODE in version.properties file in build.gradle directory, you may also change dependsOnTasks property to specify that on witch tasks should increase version code (default is every task that contains 'release' in its name)

advancedVersioning {
  codeOptions {
    versionCodeType 'AUTO_INCREMENT_ONE_STEP'
    dependsOnTasks 'release' // defaultValue
  }
}

Setting multiple tasks for dependsOnTasks property:

advancedVersioning {
  codeOptions {
    versionCodeType 'AUTO_INCREMENT_ONE_STEP'
    dependsOnTasks 'debug', 'release', 'assemble'
  }
}

AUTO_INCREMENT_STEP allows you to set a step different from 1:

advancedVersioning {
  codeOptions {
    versionCodeType 'AUTO_INCREMENT_STEP'
    versionCodeStep 2
  }
}

File output options

You can also rename the output generated apk file with this plugin. it can be done just by enabling the renameOutput option:

advancedVersioning {
  outputOptions {
    renameOutput true
  }
}

If your app name is MyApp with 2.7 version name, and you are in debug mode, the output apk file name will be: MyApp-2.7-debug.apk

NOTE: Android Gradle Plugin 4.1.0 drops support for renaming apk. We are using a workaround to keep renaming option for gradle-advanced-build-version library. So if you are using AGP 4.1.0+, you have to add advancedVersioning.renameOutputApk() after android configuration. The order is important:

advancedVersioning {
  outputOptions {
    renameOutput true
  }
}
android {
  ...
}
advancedVersioning.renameOutputApk()

You can customize the output name by using this params:

  • ${appName}: name of main module
  • ${projectName}: name of root project
  • ${flavorName}: flavor name
  • ${buildType}: build type
  • ${versionName}: version name
  • ${versionCode}: version code

Groovy:

advancedVersioning {
  outputOptions {
    renameOutput true
    nameFormat '${appName}-${buildType}-${versionName}'
  }
}

Kotlin:

advancedVersioning {
  outputOptions {
    renameOutput(true)
    nameFormat("\${appName}-\${buildType}-\${versionName}-\${versionCode}")
  }
}

And you can also use custom string in nameFormat like:

Groovy:

advancedVersioning {
  outputOptions {
    renameOutput true
    nameFormat '${appName}-google-play-${versionName}'
  }
}

Kotlin:

advancedVersioning {
  outputOptions {
    renameOutput(true)
    nameFormat("\${appName}-google-play-\${versionName}")
  }
}

If your app name is MyApp with 4.6.1 version name the output apk file name will be: MyApp-google-play-4.6.1.apk

License

Copyright 2020 Reza Moallemi.

Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for
additional information regarding copyright ownership. The ASF licenses this
file to you 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].