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.gradle
app
apply from: 'other.gradle'
other.gradle
ide
println "configuring $project" task hello << { println 'hello from other script' }
Output of gradle -q hellogradle
configuring root project 'configureProjectUsingScript' hello from other scriptui