7

My build file is big and hard to maintain, how to split the build file into separate files with smaller tasks to be imported into the main gradle file

Rudziankoŭ
  • 10,681
  • 20
  • 92
  • 192
ir2pid
  • 5,604
  • 12
  • 63
  • 107

1 Answers1

14

build.gradle

apply from: 'other.gradle'

other.gradle

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

Output of gradle -q hello

> gradle -q hello
configuring root project 'configureProjectUsingScript'
hello from other script

Source: Configuring the project using an external build script

Rudziankoŭ
  • 10,681
  • 20
  • 92
  • 192