From dde51373bb08a7a13aca50259f533fbd85cef53d Mon Sep 17 00:00:00 2001 From: cyberta Date: Tue, 26 Nov 2019 03:33:50 +0100 Subject: remove unrelated abi specific assets in split apk builds --- app/build.gradle | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'app/build.gradle') diff --git a/app/build.gradle b/app/build.gradle index 988b0a31..1a4e7632 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -60,7 +60,7 @@ android { flavorDimensions "branding", "implementation", "abi" productFlavors { productFlavors.all { - ext.appName = null; + ext.appName = null ext.splitApk = false } production { @@ -125,6 +125,7 @@ android { dimension "abi" ext { abiVersionCode = 0 + abiFilter = "" } } @@ -135,6 +136,7 @@ android { } ext { abiVersionCode = 1 + abiFilter = "x86" } } @@ -145,6 +147,7 @@ android { } ext { abiVersionCode = 2 + abiFilter = "armeabi-v7a" } } @@ -155,6 +158,7 @@ android { } ext { abiVersionCode = 3 + abiFilter = "x86_64" } } @@ -165,6 +169,7 @@ android { } ext { abiVersionCode = 4 + abiFilter = "arm64-v8a" } } } @@ -333,6 +338,19 @@ android.applicationVariants.all { variant -> output.versionCodeOverride = android.defaultConfig.versionCode * 1000 + abiDimension.abiVersionCode } } + + // remove unrelated abi specific assets + variant.mergeAssets.doLast { + // if not a fat build + if (abiDimension.abiVersionCode > 0) { + def filesToDelete = fileTree(dir: variant.mergeAssets.outputDir, excludes: ["*pie_openvpn.${abiDimension.abiFilter}", + 'urls/', + '*.url', + '*.json', + '*.pem']) + delete(filesToDelete) + } + } } -- cgit v1.2.3