The design applies from: to: in a Gradle script

I met this construct applicable from: - to: in one Gradle construct, and I don't understand what it does

task ("someName", type: someType) { task ->
        def path = "src/main/tran/${transformType}.groovy"

        def global = "$rootDir/$path"
        apply from: global, to: task
}

If this is something Groovysh or is it a completely gradle concept?

+4
source share
1 answer

applyis a Gradle concept. apply from:applies this script to the current project. In other words, simple names found in a script (e.g. path) will be resolved using the object project. To give an example, a script application containing println pathprints project.path.

apply from:, to: script , to:. , script, println path to task, task.path.

+9

Source: https://habr.com/ru/post/1544018/


All Articles