Add versioning plugin.

This will allow to easy automate auto publishing of the app.

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
This commit is contained in:
Yahor Berdnikau 2017-12-27 21:38:40 +01:00
parent 0a67f175fc
commit c84482729d
5 changed files with 29 additions and 8 deletions

View File

@ -13,6 +13,7 @@ buildscript {
classpath gradlePlugins.ktlintGradle classpath gradlePlugins.ktlintGradle
classpath gradlePlugins.detekt classpath gradlePlugins.detekt
classpath gradlePlugins.jacocoAndroid classpath gradlePlugins.jacocoAndroid
classpath gradlePlugins.buildVersioning
} }
} }

View File

@ -10,6 +10,7 @@ ext.versions = [
detekt : "1.0.0.RC6", detekt : "1.0.0.RC6",
jacoco : "0.7.9", jacoco : "0.7.9",
jacocoAndroid : "0.1.2", jacocoAndroid : "0.1.2",
buildVersioning : "1.6.0",
androidSupport : "23.4.0", androidSupport : "23.4.0",
@ -31,7 +32,8 @@ ext.gradlePlugins = [
kotlin : "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin", kotlin : "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin",
ktlintGradle : "gradle.plugin.org.jlleitschuh.gradle:ktlint-gradle:$versions.ktlintGradle", ktlintGradle : "gradle.plugin.org.jlleitschuh.gradle:ktlint-gradle:$versions.ktlintGradle",
detekt : "gradle.plugin.io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$versions.detekt", detekt : "gradle.plugin.io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$versions.detekt",
jacocoAndroid : "com.dicedmelon.gradle:jacoco-android:$versions.jacocoAndroid" jacocoAndroid : "com.dicedmelon.gradle:jacoco-android:$versions.jacocoAndroid",
buildVersioning : "org.moallemi.gradle.advanced-build-version:gradle-plugin:$versions.buildVersioning",
] ]
ext.androidSupport = [ ext.androidSupport = [

View File

@ -1,13 +1,31 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'jacoco-android' apply plugin: 'jacoco-android'
apply plugin: 'org.moallemi.advanced-build-version'
apply from: "../gradle_scripts/code_quality.gradle" apply from: "../gradle_scripts/code_quality.gradle"
advancedVersioning {
nameOptions {
versionMajor 2
versionMinor 0
versionPatch 0
}
codeOptions {
versionCodeType org.moallemi.gradle.internal.VersionCodeType.AUTO_INCREMENT_ONE_STEP
}
outputOptions {
renameOutput true
}
}
android { android {
compileSdkVersion versions.compileSdk compileSdkVersion versions.compileSdk
defaultConfig { defaultConfig {
applicationId "org.moire.ultrasonic" applicationId "org.moire.ultrasonic"
versionCode advancedVersioning.versionCode
versionName advancedVersioning.versionName
minSdkVersion versions.minSdk minSdkVersion versions.minSdk
targetSdkVersion versions.targetSdk targetSdkVersion versions.targetSdk

View File

@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:a="http://schemas.android.com/apk/res/android" <manifest xmlns:a="http://schemas.android.com/apk/res/android"
package="org.moire.ultrasonic" package="org.moire.ultrasonic"
a:installLocation="auto" a:installLocation="auto">
a:versionCode="59"
a:versionName="2.0.0">
<uses-permission a:name="android.permission.INTERNET"/> <uses-permission a:name="android.permission.INTERNET"/>
<uses-permission a:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission a:name="android.permission.ACCESS_NETWORK_STATE"/>

View File

@ -0,0 +1,2 @@
#Tue Dec 26 22:52:35 CET 2017
AI_VERSION_CODE=59