From 41f2c08736df52bc21910efc74d2b54db95a4bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Fri, 21 Oct 2022 09:42:52 +0200 Subject: [PATCH] android: use projectDir for VERSION file path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise Android Studio can't find the relative path because it uses `/` as it's working directory. Which makes no sense. Signed-off-by: Jakub SokoĊ‚owski --- android/app/build.gradle | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index e9de80fe96..e7cd665e08 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -159,7 +159,10 @@ def getVersionName = { -> if (project.hasProperty("releaseVersion")) { return project.releaseVersion } - version = new File('../VERSION').text + /* Necessary because Android Studio uses wrong PWD. + * Is actually absolute directory path of this file. */ + def configDir = project.projectDir.toString() + version = new File(configDir + '/../../VERSION').text return version.replaceAll("\\s","") } }