Skip to content

Commit

Permalink
Fix include x86/x86_64 abi for release build
Browse files Browse the repository at this point in the history
  • Loading branch information
HokoFly committed Oct 27, 2023
1 parent 25dc87b commit ec4b1f6
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions hoko-blur/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.library'

def isReleaseBuildType = false
def isReleaseBuild = false
gradle.startParameter.taskNames.each({
String taskNameL = it.toLowerCase()
if (taskNameL.contains("release")) {
isReleaseBuildType = true
String taskName = it.toLowerCase()
if (taskName.contains("release")) {
isReleaseBuild = true
}
if (taskNameL.equalsIgnoreCase('uploadArchives')) {
isReleaseBuildType = true
if (taskName.equalsIgnoreCase('uploadArchives')) {
isReleaseBuild = true
}
})

Expand All @@ -29,7 +29,6 @@ android {
cppFlags "-std=c++11 -frtti -fexceptions"
}
}
externalNativeBuild.cmake.abiFilters = isReleaseBuildType ? ['armeabi-v7a', 'arm64-v8a'] : ['armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64']
consumerProguardFiles 'proguard-rules.pro'
}

Expand All @@ -41,12 +40,30 @@ android {
buildTypes {
release {
minifyEnabled false
externalNativeBuild {
cmake {
abiFilters = ['armeabi-v7a', 'arm64-v8a']
}
}
}

debug {
jniDebuggable true
externalNativeBuild {
cmake {
abiFilters = ['armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64']
}
}
}
}

packagingOptions {
if (isReleaseBuild) {
exclude 'lib/x86_64/*.so'
exclude 'lib/x86/*.so'
}
}

lint {
abortOnError false
}
Expand All @@ -56,7 +73,9 @@ android {
path 'src/main/jni/CMakeLists.txt'
}
}

namespace 'com.hoko.blur'

buildFeatures {
renderScript rootProject.ext.renderscriptEnabled
}
Expand Down

0 comments on commit ec4b1f6

Please sign in to comment.