diff --git a/Source/Android/app/build.gradle b/Source/Android/app/build.gradle index d7590156e4..43cb878059 100644 --- a/Source/Android/app/build.gradle +++ b/Source/Android/app/build.gradle @@ -23,8 +23,7 @@ android { // TODO This should be set to the Buildbot build number for release builds, and be "1" for debug builds. versionCode 13 - // TODO This should be set to the string currently provided by NativeLibrary.GetVersionString(). - versionName "0.13" + versionName "${getVersion()}" } signingConfigs { @@ -69,16 +68,28 @@ android { } } } + + applicationVariants.all { variant -> + variant.outputs.each { output -> + def name = output.outputFile.name.replace(variant.buildType.name, "${variant.versionName}") + name = name.replace("app", "dolphin") + output.outputFile = new File(output.outputFile.parent, name) + } + } +} + +ext { + androidSupportVersion = '25.3.0' } dependencies { - compile 'com.android.support:support-v13:25.3.0' - compile 'com.android.support:cardview-v7:25.3.0' - compile 'com.android.support:recyclerview-v7:25.3.0' - compile 'com.android.support:design:25.3.0' + compile "com.android.support:support-v13:$androidSupportVersion" + compile "com.android.support:cardview-v7:$androidSupportVersion" + compile "com.android.support:recyclerview-v7:$androidSupportVersion" + compile "com.android.support:design:$androidSupportVersion" // Android TV UI libraries. - compile 'com.android.support:leanback-v17:25.3.0' + compile "com.android.support:leanback-v17:$androidSupportVersion" // For showing the banner as a circle a-la Material Design Guidelines compile 'de.hdodenhof:circleimageview:2.1.0' @@ -89,3 +100,17 @@ dependencies { // Allows FRP-style asynchronous operations in Android. compile 'io.reactivex:rxandroid:1.2.1' } + +def getVersion() { + def versionNumber = '0.0' + + try { + versionNumber = 'git describe --always --long'.execute([], project.rootDir).text + .trim() + .replaceAll(/(-0)?-[^-]+$/, "") + } catch (Exception e) { + logger.error('Cannot find git, defaulting to dummy version number') + } + + return versionNumber +} diff --git a/Source/Android/app/src/main/res/values/strings.xml b/Source/Android/app/src/main/res/values/strings.xml index fcc9e80ed4..c85d00df52 100644 --- a/Source/Android/app/src/main/res/values/strings.xml +++ b/Source/Android/app/src/main/res/values/strings.xml @@ -239,8 +239,5 @@ General Controllers - - org.dolphinemu.dolphinemu - You need to allow write access to external storage for the emulator to work diff --git a/Source/Android/build.gradle b/Source/Android/build.gradle index c6f2f5009e..3f806cd79c 100644 --- a/Source/Android/build.gradle +++ b/Source/Android/build.gradle @@ -1,14 +1,9 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.3.0' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files } }