Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 651c5caf authored by Moez Bhatti's avatar Moez Bhatti
Browse files

Output different version codes for each apk

parent 0e4e1721
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ buildscript {
    ext.support_version = '27.1.0'
    ext.timber_version = '4.5.1'

    ext.abiCodes = ['armeabi-v7a': 1, 'arm64-v8a': 2]

    repositories {
        maven { url 'https://maven.google.com' }
+11 −0
Original line number Diff line number Diff line
@@ -66,6 +66,17 @@ android {
    }
}

import com.android.build.OutputFile

// For each APK output variant, override versionCode with one that is unique
// https://developer.android.com/studio/build/gradle-tips.html#configure-dynamic-version-codes
android.applicationVariants.all { variant ->
    variant.outputs.each { output ->
        def baseAbiVersionCode = abiCodes.get(output.getFilter(OutputFile.ABI), 0)
        output.versionCodeOverride = baseAbiVersionCode * 1000 + variant.versionCode
    }
}

dependencies {
    // lifecycle
    implementation "android.arch.lifecycle:extensions:$lifecycle_version"