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

相關文章
相關標籤/搜索