android: use projectDir for VERSION file path

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 <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2022-10-21 09:42:52 +02:00
parent 2bfc57281a
commit 41f2c08736
No known key found for this signature in database
GPG Key ID: 09AA5403E54D9931
1 changed files with 4 additions and 1 deletions

View File

@ -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","")
}
}