Skip to content

Commit bd8aa41

Browse files
committed
优化构建缓存目录配置项
1 parent 5e5ab05 commit bd8aa41

2 files changed

Lines changed: 1 addition & 8 deletions

File tree

‎build.gradle‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ void main() {
1111
loadAppConfig()
1212
}
1313

14-
tasks.register('clean', Delete) {
15-
delete rootProject.buildDir
16-
}
17-
1814
/**
1915
* 根据 Gradle 命令行参数配置 App 的服务器类型和相关参数
2016
*/

‎common.gradle‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,7 @@ android {
6060
String buildDirPath = properties.getProperty("build.dir")
6161
if (buildDirPath != null && buildDirPath != "") {
6262
// 将构建文件统一输出到指定的目录下
63-
setBuildDir(new File(buildDirPath, rootProject.name + "/build/${path.replaceAll(':', '/')}"))
64-
} else {
65-
// 将构建文件统一输出到项目根目录下的 build 文件夹
66-
setBuildDir(new File(rootDir, "build/${path.replaceAll(':', '/')}"))
63+
layout.buildDirectory.set(new File(buildDirPath, rootProject.name + "/${path.replaceAll(':', '/')}"))
6764
}
6865
}
6966

0 commit comments

Comments
 (0)