Created
July 9, 2024 05:25
-
-
Save gouravkhunger/2974f5068d603fd5e9b8eefe2f346d7e to your computer and use it in GitHub Desktop.
Rename output APKs for split ABIs (Kotlin DSL)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
android { | |
// ... | |
applicationVariants.configureEach { | |
val archMap = mapOf( | |
"x86" to "i686", | |
"x86_64" to "x86_64", | |
"armeabi-v7a" to "arm", | |
"arm64-v8a" to "aarch64" | |
) | |
// rename the output APK file | |
outputs.configureEach { | |
(this as? ApkVariantOutputImpl)?.outputFileName = | |
"${rootProject.name.lowercase()}-${ | |
archMap[filters.find {it.filterType == "ABI" }?.identifier] ?: "universal" | |
}${if (buildType.name == "debug") "-debug" else ""}.apk" | |
} | |
} | |
} | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment