Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the meaning of '$' in build.gradle script

I am reading documentation about native builds. And there is a following example for building all variants.

model {
    tasks {
        buildAllExecutables(Task) {
            dependsOn $.binaries.findAll { it.buildable }
        }
    }
}

Link to documentation

What is the meaning of this dollar sign before binaries container?

like image 920
Ilia Avatar asked Mar 10 '23 22:03

Ilia


1 Answers

The $. notation is a way to reference other elements of the model. By "the model" I mean all the stuff you see when you run gradle model. So when we do $.binaries we are telling Gradle to go searching for a model element named "binaries". As another example, I could use $.tasks.foo to reference the task named "foo".

See the documentation for more details.

like image 122
Mark Vieira Avatar answered Mar 19 '23 16:03

Mark Vieira