ABI splits.

This commit is contained in:
Alan Evans 2019-03-28 17:21:57 -03:00 committed by GitHub
parent ce6d2d9c69
commit b9b4dccff4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -326,6 +326,15 @@ android {
} }
resConfigs autoResConfig() resConfigs autoResConfig()
splits {
abi {
enable true
reset()
include 'armeabi-v7a', 'x86', 'armeabi'
universalApk true
}
}
} }
compileOptions { compileOptions {
@ -455,31 +464,33 @@ def assembleWebsiteDescriptor = { variant, file ->
} }
def signProductionRelease = { variant -> def signProductionRelease = { variant ->
String apkName = variant.outputs[0].outputFile.name variant.outputs.collect { output ->
File inputFile = new File(variant.outputs[0].outputFile.path); String apkName = output.outputFile.name
File outputFile = new File(variant.outputs[0].outputFile.parent, apkName.replace("-unsigned", "")); File inputFile = new File(output.outputFile.path)
File outputFile = new File(output.outputFile.parent, apkName.replace('-unsigned', ''))
new ApkSignerUtil("sun.security.pkcs11.SunPKCS11", new ApkSignerUtil('sun.security.pkcs11.SunPKCS11',
"pkcs11.config", 'pkcs11.config',
"PKCS11", 'PKCS11',
"file:pkcs11.password").calculateSignature(inputFile.getAbsolutePath(), 'file:pkcs11.password').calculateSignature(inputFile.getAbsolutePath(),
outputFile.getAbsolutePath()); outputFile.getAbsolutePath())
inputFile.delete(); inputFile.delete()
return outputFile outputFile
}
} }
task signProductionPlayRelease { task signProductionPlayRelease {
doLast { doLast {
signProductionRelease(android.applicationVariants.find({ it.name.equals("playRelease") })) signProductionRelease(android.applicationVariants.find { (it.name == 'playRelease') })
} }
} }
task signProductionWebsiteRelease { task signProductionWebsiteRelease {
doLast { doLast {
def variant = android.applicationVariants.find({ it.name.equals("websiteRelease") }) def variant = android.applicationVariants.find { (it.name == 'websiteRelease') }
File signedRelease = signProductionRelease(variant) File signedRelease = signProductionRelease(variant).find { it.name.contains('universal') }
assembleWebsiteDescriptor(variant, signedRelease); assembleWebsiteDescriptor(variant, signedRelease)
} }
} }