Skip to content

Commit

Permalink
mobile: fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ammarahm-ed committed Aug 10, 2024
1 parent 74187b3 commit 5ae8cdd
Show file tree
Hide file tree
Showing 6 changed files with 822 additions and 4,900 deletions.
11 changes: 9 additions & 2 deletions apps/mobile/native/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def getNpmVersion() {
return jsonPackage["version"]
}

def isBuildingAAB = gradle.startParameter.getTaskNames().any { it.contains("bundleRelease") }

android {
compileSdkVersion rootProject.ext.compileSdkVersion
Expand Down Expand Up @@ -183,9 +184,15 @@ android {
defaultConfig.versionCode * 5 + versionCodes.get(abi)
println("Fdroid Version code: ${output.versionCodeOverride} for abi ${versionCodes.get(abi)}");
} else {
println("Version code: ${output.versionCodeOverride} for abi ${versionCodes.get(abi)}");
output.versionCodeOverride =
if (isBuildingAAB) {
output.versionCodeOverride = 4 * 1048576 + defaultConfig.versionCode
println("AAB version code: ${output.versionCodeOverride}");
} else {
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
println("Version code: ${output.versionCodeOverride} for abi ${versionCodes.get(abi)}");
}

}

}
Expand Down
Loading

0 comments on commit 5ae8cdd

Please sign in to comment.