Commit d5045697 by pye52

适配android gradle 4.0

parent 39364701
...@@ -87,11 +87,12 @@ android { ...@@ -87,11 +87,12 @@ android {
// 命名生成的apk // 命名生成的apk
applicationVariants.all { variant -> applicationVariants.all { variant ->
if (variant.buildType.name != "debug") { if (variant.buildType.name != "debug") {
variant.getPackageApplicationProvider() variant.getVariantData()
.get() .getPublicVariantPropertiesApi()
.outputScope .getOutputs()
.apkDatas .forEach { output ->
.forEach { apkData -> apkData.outputFileName = "SmartCanteen" + "_v" + variant.versionName + ".apk" } output.apkData.outputFileName = "SmartCanteen" + "_v" + variant.versionName + ".apk"
}
} }
} }
lintOptions { lintOptions {
......
...@@ -9,7 +9,7 @@ buildscript { ...@@ -9,7 +9,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.6.3' classpath 'com.android.tools.build:gradle:4.0.0'
} }
} }
......
...@@ -55,15 +55,15 @@ android { ...@@ -55,15 +55,15 @@ android {
if (variant.buildType.name != "debug") { if (variant.buildType.name != "debug") {
String targetDir = findAppAssetsDir() String targetDir = findAppAssetsDir()
if (!targetDir.isEmpty()) { if (!targetDir.isEmpty()) {
variant.getPackageApplicationProvider() variant.getPackageApplication()
.get()
.outputDirectory = new File(targetDir) .outputDirectory = new File(targetDir)
} }
variant.getPackageApplicationProvider() variant.getVariantData()
.get() .getPublicVariantPropertiesApi()
.outputScope .getOutputs()
.apkDatas .forEach { output ->
.forEach { apkData -> apkData.outputFileName = signed } output.apkData.outputFileName = signed
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment