Merge pull request #1491 from Mygod/split-abi
Split ABIs for smaller apk size
This commit is contained in:
+19
-1
@@ -1,3 +1,4 @@
|
||||
import com.android.build.OutputFile
|
||||
import java.util.regex.Matcher
|
||||
import java.util.regex.Pattern
|
||||
|
||||
@@ -20,7 +21,7 @@ android {
|
||||
applicationId "com.github.shadowsocks"
|
||||
minSdkVersion rootProject.minSdkVersion
|
||||
targetSdkVersion rootProject.sdkVersion
|
||||
versionCode 205
|
||||
versionCode 210
|
||||
versionName "4.4.5"
|
||||
testApplicationId "com.github.shadowsocks.test"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
@@ -36,6 +37,15 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
lintOptions.checkReleaseBuilds false
|
||||
splits {
|
||||
abi {
|
||||
enable true
|
||||
reset()
|
||||
include 'armeabi-v7a', 'arm64-v8a', 'x86'
|
||||
universalApk true
|
||||
}
|
||||
}
|
||||
sourceSets.main.jniLibs.srcDirs +=
|
||||
new File(project(':core').buildDir, "intermediates/bundles/${getCurrentFlavor()}/jni")
|
||||
sourceSets.main.jniLibs.srcDirs += new File(project(':core').projectDir, "src/overture/bin")
|
||||
@@ -71,3 +81,11 @@ repositories {
|
||||
}
|
||||
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
ext.abiCodes = ['armeabi-v7a': 1, 'arm64-v8a': 2, x86: 3]
|
||||
if (getCurrentFlavor() == 'release') android.applicationVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
def offset = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))
|
||||
if (offset != null) output.versionCodeOverride = variant.versionCode + offset
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user