I have created a basic gradle build. My build scripts contain constructs such as:
subprojects {
group = 'tld.example'
version = '0.1'
}
I deciphered this one: Build script is delegating all calls to Project object, and subprojects is just a method defined on that object, which accepts a Closure.
Easy enough. But what does this one mean?
model {
components {
foo(NativeLibrarySpec) {
sources {
cpp {
source {
srcDir "src"
include "**/*.cpp"
}
exportedHeaders {
srcDirs "${rootDir}/include"
}
}
}
}
}
}
Fair enough, it is bit longer than the previous snippet, so namely:
- I have a bit of trouble to follow the context, while going all the way down from model to e.g. source
- I am quite certain there is no foo method/property defined on anything, so what am I actually calling/doing by saying foo(NativeLibrarySpec)? Wild guess would be that groovy has some PHP-like magic functions, which will handle this?
Note: I have asked this same quesiton on StackOverflow some time ago, but without any success, so I am asking the same thing right at the source.