[android] Allow x86 builds for emulator

Signed-off-by: Roman Tsisyk <roman@tsisyk.com>
This commit is contained in:
Roman Tsisyk 2021-05-31 11:13:43 +03:00 committed by Viktor Govako
parent 9af623e6d9
commit 4d572933f9

View file

@ -195,32 +195,6 @@ android {
}
setProperty("archivesBaseName", appName.replaceAll("\\s","") + "-" + defaultConfig.versionCode)
ndk {
abiFilters = new HashSet<>()
if (project.hasProperty('arm32') || project.hasProperty('armeabi-v7a')) {
abiFilters.add('armeabi-v7a')
}
if (project.hasProperty('arm64') || project.hasProperty('arm64-v8a')) {
abiFilters.add('arm64-v8a')
}
if (project.hasProperty('x86_64')) {
abiFilters.add('x86_64')
}
if (project.hasProperty('x86')) {
abiFilters.add('x86')
}
if (abiFilters.isEmpty()) {
abiFilters.add('armeabi-v7a')
abiFilters.add('arm64-v8a')
// Intel phone is not a thing in 2021.
// We don't have enough space in bundles for libraries nobody use.
// Please manually specify -Px86 if you need a build of x86 emulator.
//abiFilters.add('x86_64')
//abiFilters.add('x86')
}
println('Building for ' + String.join(", ", abiFilters))
}
}
sourceSets.main {
@ -351,6 +325,24 @@ android {
resValue 'string', 'app_id', android.defaultConfig.applicationId + applicationIdSuffix
resValue 'string', 'app_name', project.ext.appName + ' ' + '(Debug)'
ndk.debugSymbolLevel = 'SYMBOL_TABLE'
ndk {
abiFilters = new HashSet<>()
if (project.hasProperty('arm32') || project.hasProperty('armeabi-v7a')) {
abiFilters.add('armeabi-v7a')
}
if (project.hasProperty('arm64') || project.hasProperty('arm64-v8a')) {
abiFilters.add('arm64-v8a')
}
if (project.hasProperty('x86')) {
abiFilters.add('x86')
}
if (abiFilters.isEmpty()) {
abiFilters.add('armeabi-v7a')
abiFilters.add('arm64-v8a')
abiFilters.add('x86') // for emulator
}
}
}
release {
@ -360,7 +352,10 @@ android {
proguardFile('proguard-mwm.txt')
resValue 'string', 'app_id', android.defaultConfig.applicationId
resValue 'string', 'app_name', project.ext.appName
ndk.debugSymbolLevel = 'SYMBOL_TABLE'
ndk {
debugSymbolLevel 'SYMBOL_TABLE'
abiFilters 'armeabi-v7a', 'arm64-v8a'
}
if (googleFirebaseServicesEnabled) {
firebaseCrashlytics {
nativeSymbolUploadEnabled true
@ -375,7 +370,10 @@ android {
matchingFallbacks = ['debug', 'release']
resValue 'string', 'app_id', android.defaultConfig.applicationId + applicationIdSuffix
resValue 'string', 'app_name', project.ext.appName + ' ' + '(Beta)'
ndk.debugSymbolLevel = 'SYMBOL_TABLE'
ndk {
debugSymbolLevel 'SYMBOL_TABLE'
abiFilters 'armeabi-v7a', 'arm64-v8a'
}
if (googleFirebaseServicesEnabled) {
firebaseCrashlytics {
nativeSymbolUploadEnabled true