更新gradle脚本

This commit is contained in:
zlzw 2022-10-13 16:07:52 +08:00
parent 2d122a93b7
commit 2cbc018764

View File

@ -54,6 +54,21 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8
} }
applicationVariants.all { variant ->
String variantName = variant.name.capitalize()
def processManifestTask = project.tasks.getByName("process${variantName}Manifest")
processManifestTask.doLast { pm->
String manifestPath = "build/intermediates/bundle_manifest/release/bundle-manifest/AndroidManifest.xml"
def isGooglePlay=rootProject.ext.manifestPlaceholders.isGooglePlay
if(file(manifestPath).exists()&&isGooglePlay) {
def manifestContent = file(manifestPath).getText()
manifestContent = manifestContent.replace('android.permission.REQUEST_INSTALL_PACKAGES', '')
file(manifestPath).write(manifestContent)
}else{
print "not Exists = "+manifestPath
}
}
}
signingConfigs { signingConfigs {
release { release {
keyAlias 'phonelive' keyAlias 'phonelive'
@ -141,6 +156,7 @@ dependencies {
} }
// //
/*
project.afterEvaluate { project.afterEvaluate {
android.applicationVariants.all { variant -> android.applicationVariants.all { variant ->
variant.outputs.each { output -> variant.outputs.each { output ->
@ -152,4 +168,4 @@ project.afterEvaluate {
} }
} }
} }
} }*/