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