File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -15,4 +15,22 @@ android {
1515 targetCompatibility JavaVersion . VERSION_1_8
1616 sourceCompatibility JavaVersion . VERSION_1_8
1717 }
18+
19+ // 读取 local.properties 文件配置
20+ def properties = new Properties ()
21+ def localPropertiesFile = rootProject. file(" local.properties" )
22+ if (localPropertiesFile. exists()) {
23+ localPropertiesFile. withInputStream { inputStream ->
24+ properties. load(inputStream)
25+ }
26+ }
27+
28+ String buildDirPath = properties. getProperty(" build.dir" )
29+ if (buildDirPath != null && buildDirPath != " " ) {
30+ // 将构建文件统一输出到指定的目录下
31+ project. buildDir = new File (buildDirPath, rootProject. name + " /build/${ path.replaceAll(':', '/')} " )
32+ } else {
33+ // 将构建文件统一输出到项目根目录下的 build 文件夹
34+ project. buildDir = new File (rootDir, " build/${ path.replaceAll(':', '/')} " )
35+ }
1836}
You can’t perform that action at this time.
0 commit comments