Gradle 中引用外部Gradle脚本,至关于import/include功能

原文地址 Configuring the project using an external build script

You can configure the current project using an external build script. All of the Gradle build language is available in the external script. You can even apply other scripts from the external script.html

Configuring the project using an external build script build.gradleapp

apply from: 'other.gradle'

other.gradleide

println "configuring $project"
task hello << {
    println 'hello from other script'
}

Output of gradle -q hellogradle

configuring root project 'configureProjectUsingScript' hello from other scriptui

相关文章
相关标签/搜索