From c84482729d216d2b2f1c104f7b89de68806e17e5 Mon Sep 17 00:00:00 2001 From: Yahor Berdnikau Date: Wed, 27 Dec 2017 21:38:40 +0100 Subject: [PATCH] Add versioning plugin. This will allow to easy automate auto publishing of the app. Signed-off-by: Yahor Berdnikau --- build.gradle | 1 + dependencies.gradle | 12 +++++++----- ultrasonic/build.gradle | 18 ++++++++++++++++++ ultrasonic/src/main/AndroidManifest.xml | 4 +--- ultrasonic/version.properties | 2 ++ 5 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 ultrasonic/version.properties diff --git a/build.gradle b/build.gradle index 25ea3d17..97610b36 100644 --- a/build.gradle +++ b/build.gradle @@ -13,6 +13,7 @@ buildscript { classpath gradlePlugins.ktlintGradle classpath gradlePlugins.detekt classpath gradlePlugins.jacocoAndroid + classpath gradlePlugins.buildVersioning } } diff --git a/dependencies.gradle b/dependencies.gradle index 3692f2d1..ff608274 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -10,6 +10,7 @@ ext.versions = [ detekt : "1.0.0.RC6", jacoco : "0.7.9", jacocoAndroid : "0.1.2", + buildVersioning : "1.6.0", androidSupport : "23.4.0", @@ -27,11 +28,12 @@ ext.versions = [ ] ext.gradlePlugins = [ - androidTools : "com.android.tools.build:gradle:$versions.androidTools", - kotlin : "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin", - ktlintGradle : "gradle.plugin.org.jlleitschuh.gradle:ktlint-gradle:$versions.ktlintGradle", - detekt : "gradle.plugin.io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$versions.detekt", - jacocoAndroid : "com.dicedmelon.gradle:jacoco-android:$versions.jacocoAndroid" + androidTools : "com.android.tools.build:gradle:$versions.androidTools", + kotlin : "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin", + ktlintGradle : "gradle.plugin.org.jlleitschuh.gradle:ktlint-gradle:$versions.ktlintGradle", + detekt : "gradle.plugin.io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$versions.detekt", + jacocoAndroid : "com.dicedmelon.gradle:jacoco-android:$versions.jacocoAndroid", + buildVersioning : "org.moallemi.gradle.advanced-build-version:gradle-plugin:$versions.buildVersioning", ] ext.androidSupport = [ diff --git a/ultrasonic/build.gradle b/ultrasonic/build.gradle index 822c2243..b2d2e8cd 100644 --- a/ultrasonic/build.gradle +++ b/ultrasonic/build.gradle @@ -1,13 +1,31 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'jacoco-android' +apply plugin: 'org.moallemi.advanced-build-version' 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 { compileSdkVersion versions.compileSdk defaultConfig { applicationId "org.moire.ultrasonic" + versionCode advancedVersioning.versionCode + versionName advancedVersioning.versionName + minSdkVersion versions.minSdk targetSdkVersion versions.targetSdk diff --git a/ultrasonic/src/main/AndroidManifest.xml b/ultrasonic/src/main/AndroidManifest.xml index d24a6d8d..3d7bad42 100644 --- a/ultrasonic/src/main/AndroidManifest.xml +++ b/ultrasonic/src/main/AndroidManifest.xml @@ -1,9 +1,7 @@ + a:installLocation="auto"> diff --git a/ultrasonic/version.properties b/ultrasonic/version.properties new file mode 100644 index 00000000..61c77636 --- /dev/null +++ b/ultrasonic/version.properties @@ -0,0 +1,2 @@ +#Tue Dec 26 22:52:35 CET 2017 +AI_VERSION_CODE=59