diff --git a/build.gradle b/build.gradle index fb08d73eb..2687053f5 100644 --- a/build.gradle +++ b/build.gradle @@ -15,6 +15,9 @@ buildscript { plugins { // Used for getting the eigen dir from local.properties id 'com.github.b3er.local.properties' version '1.1' + + // For getting git describe data and formatting it how Android wants. + id "com.gladed.androidgitversion" version "0.4.13" } ext { diff --git a/src/xrt/targets/openxr_android/build.gradle b/src/xrt/targets/openxr_android/build.gradle index 34060b5b9..31c6dc3db 100644 --- a/src/xrt/targets/openxr_android/build.gradle +++ b/src/xrt/targets/openxr_android/build.gradle @@ -4,6 +4,10 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' +androidGitVersion { + tagPattern(/^v[0-9]+.*/) + codeFormat = 'MNNPPPBBB' +} android { compileSdkVersion project.sharedTargetSdk buildToolsVersion '30.0.2' @@ -14,8 +18,9 @@ android { applicationId 'org.freedesktop.monado.openxr_runtime' minSdkVersion project.sharedMinSdk targetSdkVersion project.sharedTargetSdk - versionCode 1 - versionName '1.0' + + versionCode androidGitVersion.code() + versionName androidGitVersion.name() externalNativeBuild { cmake { arguments "-DEIGEN3_INCLUDE_DIR=${project.eigenIncludeDir}", "-DANDROID_PLATFORM=26", "-DANDROID_STL=c++_shared", "-DANDROID_ARM_NEON=TRUE"