[tor-commits] [orbot/master] Add in versionCode updates based on ABI

n8fr8 at torproject.org n8fr8 at torproject.org
Wed Dec 22 21:55:09 UTC 2021


commit ff8411ab45884dba72f32a458653b6f9d2d3fb73
Author: sisbell <shane.isbell at gmail.com>
Date:   Mon Aug 2 16:22:42 2021 -0700

    Add in versionCode updates based on ABI
---
 commons-device.gradle | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/commons-device.gradle b/commons-device.gradle
index ed69f6ac..3a9a0faa 100644
--- a/commons-device.gradle
+++ b/commons-device.gradle
@@ -4,17 +4,22 @@
 apply plugin: 'com.android.application'
 apply from: "../commons.gradle"
 
-ext.createKeyStoreProperties = { ->
-    def keystorePropertiesFile = rootProject.file("keystore.properties")
-    def properties = new Properties()
-    if (keystorePropertiesFile.canRead()) {
-        properties.load(new FileInputStream(keystorePropertiesFile))
+def keystorePropertiesFile = rootProject.file("keystore.properties")
+def keystoreProperties = new Properties()
+if (keystorePropertiesFile.canRead()) {
+    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
+}
+//Increments versionCode by ABI type
+def abiCodeMap = ['armeabi-v7a': '1', 'arm64-v8a': '2', 'x86': '4', 'x86_64': '5']
+android.applicationVariants.all { variant ->
+    variant.outputs.each { output ->
+        def baseVersionCode = abiCodeMap.get(output.getFilter("ABI"))
+        if(baseVersionCode != null) {
+            output.versionCodeOverride = Integer.valueOf(variant.versionCode) + Integer.valueOf(baseVersionCode)
+        }
     }
-    return properties
 }
 
-def keystoreProperties = createKeyStoreProperties()
-
 android {
 
     signingConfigs {





More information about the tor-commits mailing list