【发布时间】:2016-12-01 10:49:21
【问题描述】:
我的构建文件很大,很难维护,如何将构建文件拆分成单独的文件,将较小的任务导入到主gradle文件中
【问题讨论】:
我的构建文件很大,很难维护,如何将构建文件拆分成单独的文件,将较小的任务导入到主gradle文件中
【问题讨论】:
build.gradle
apply from: 'other.gradle'
other.gradle
println "configuring $project"
task hello << {
println 'hello from other script'
}
gradle -q hello 的输出
> gradle -q hello
configuring root project 'configureProjectUsingScript'
hello from other script
【讨论】: