Fix variant name

This commit is contained in:
LoveSy 2021-12-08 22:10:42 +08:00
parent cda0096007
commit 1e3be68fac
1 changed files with 3 additions and 3 deletions

View File

@ -53,7 +53,7 @@ android {
} }
applicationVariants.all { variant -> applicationVariants.all { variant ->
def buildType = variant.name.capitalize() def buildType = variant.name.capitalize()
def variantLowered = variant.name.toLowerCase() def variantName = variant.name
variant.outputs.all { variant.outputs.all {
outputFileName = "${variant.getFlavorName()}-${variant.versionName}.apk" outputFileName = "${variant.getFlavorName()}-${variant.versionName}.apk"
@ -61,7 +61,7 @@ android {
task "copyDex$buildType"(type: Copy) { task "copyDex$buildType"(type: Copy) {
dependsOn("assemble$buildType") dependsOn("assemble$buildType")
def dexFilePath = "$buildDir/intermediates/dex/${variantLowered}/mergeDex${buildType}/classes.dex" def dexFilePath = "$buildDir/intermediates/dex/${variantName}/mergeDex${buildType}/classes.dex"
from dexFilePath from dexFilePath
rename "classes.dex", "lsp.dex" rename "classes.dex", "lsp.dex"
into "$rootProject.projectDir/out/dexes" into "$rootProject.projectDir/out/dexes"
@ -69,7 +69,7 @@ android {
task "copySo$buildType"(type: Copy) { task "copySo$buildType"(type: Copy) {
dependsOn("assemble$buildType") dependsOn("assemble$buildType")
from "$buildDir/intermediates/merged_native_libs/${variantLowered}/out/lib" from "$buildDir/intermediates/merged_native_libs/${variantName}/out/lib"
into "$rootProject.projectDir/out/so" into "$rootProject.projectDir/out/so"
} }