From b938bb483af1b63cfcda74a9ebb42c834ba5f3cb Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Thu, 23 Feb 2017 15:00:30 +0100 Subject: [PATCH] Updated gradle build, allow to configure from file. --- client/Android/Studio/aFreeRDP/build.gradle | 11 +++++--- .../Studio/aFreeRDP/src/main/AndroidManifest.xml | 4 +-- client/Android/Studio/build.gradle | 33 ++++++++++++++++++++++ client/Android/Studio/freeRDPCore/build.gradle | 10 ++++--- .../freeRDPCore/src/main/AndroidManifest.xml | 6 ++-- 5 files changed, 49 insertions(+), 15 deletions(-) diff --git a/client/Android/Studio/aFreeRDP/build.gradle b/client/Android/Studio/aFreeRDP/build.gradle index a28990d..55cd95e 100644 --- a/client/Android/Studio/aFreeRDP/build.gradle +++ b/client/Android/Studio/aFreeRDP/build.gradle @@ -1,13 +1,16 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 25 - buildToolsVersion "25.0.2" + compileSdkVersion = rootProject.ext.compileSdk + buildToolsVersion = rootProject.ext.buildToolsVersion defaultConfig { applicationId "com.freerdp.afreerdp" - minSdkVersion 14 - targetSdkVersion 25 + minSdkVersion rootProject.ext.minSdk + targetSdkVersion rootProject.ext.targetSdk + vectorDrawables.useSupportLibrary = true + versionCode = rootProject.ext.versionCode + versionName = rootProject.ext.versionName } buildTypes { diff --git a/client/Android/Studio/aFreeRDP/src/main/AndroidManifest.xml b/client/Android/Studio/aFreeRDP/src/main/AndroidManifest.xml index a629532..1b0b81d 100644 --- a/client/Android/Studio/aFreeRDP/src/main/AndroidManifest.xml +++ b/client/Android/Studio/aFreeRDP/src/main/AndroidManifest.xml @@ -2,9 +2,7 @@ + android:installLocation="auto"> + def stdout = new ByteArrayOutputStream() + exec { + commandLine 'git', 'describe', '--tags' + standardOutput = stdout + } + return stdout.toString().trim() +} + +ext { + versionCode = properties.get('VERSION', "10").toInteger() + minSdk = properties.get('MIN_SDK', "14").toInteger() + targetSdk = properties.get('TARGET_SDK', "25").toInteger() + compileSdk = properties.get('COMPILE_SDK', "25").toInteger() + buildToolsVersion = properties.get('BUILD_TOOLS', "25.0.2") + versionName = properties.get('VERSION_NAME', getVersionName()) + + println '----------------- Project configuration -------------------' + println 'VERSION: ' + versionCode + println 'MIN_SDK: ' + minSdk + println 'TARGET_SDK: ' + targetSdk + println 'COMPILE_SDK: ' + compileSdk + println 'BUILD_TOOLS: ' + buildToolsVersion + println 'VERSION_NAME: ' + versionName + println '-----------------------------------------------------------' +} + buildscript { repositories { jcenter() diff --git a/client/Android/Studio/freeRDPCore/build.gradle b/client/Android/Studio/freeRDPCore/build.gradle index 96dfc09..1f66bac 100644 --- a/client/Android/Studio/freeRDPCore/build.gradle +++ b/client/Android/Studio/freeRDPCore/build.gradle @@ -1,13 +1,15 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 25 - buildToolsVersion "25.0.2" + compileSdkVersion = rootProject.ext.compileSdk + buildToolsVersion = rootProject.ext.buildToolsVersion defaultConfig { - minSdkVersion 14 - targetSdkVersion 25 + minSdkVersion rootProject.ext.minSdk + targetSdkVersion rootProject.ext.targetSdk vectorDrawables.useSupportLibrary = true + versionCode = rootProject.ext.versionCode + versionName = rootProject.ext.versionName } buildTypes { diff --git a/client/Android/Studio/freeRDPCore/src/main/AndroidManifest.xml b/client/Android/Studio/freeRDPCore/src/main/AndroidManifest.xml index b3bc661..3293718 100644 --- a/client/Android/Studio/freeRDPCore/src/main/AndroidManifest.xml +++ b/client/Android/Studio/freeRDPCore/src/main/AndroidManifest.xml @@ -1,9 +1,7 @@ + android:installLocation="auto"> @@ -102,4 +100,4 @@ - \ No newline at end of file + -- 2.7.4