I'm trying to use gradle to build simple native application. The below is an example code from Gradle documentation of native plugins.
model {
components {
main(NativeLibrarySpec) {
sources {
cpp {
source {
srcDirs "src/main/cpp", "src/shared/c++"
include "**/*.cpp"
}
exportedHeaders {
srcDirs "src/main/include", "src/shared/include"
}
}
}
}
}
}
I have several questions:
What do
model
,component
words mean? I read about the model rules, but I don't get the idea and new syntax.Model
looks like the method invocation, but there is not such method inProject
class. The same forcomponents
, where is it from?The second questions is about syntax
main(NativeLibrarySpec) { .. }
. What does it mean? It looks like method invocation, but why do we use theNativeLibrarySpec
interface name as a parameter?Where from does
cpp
name go on? I see thatNativeLibrarySpec
has thesources
method has prototypevoid sources(Action<? super ModelMap<LanguageSourceSet>> action)
and what does? super ..
mean? I don't understand why do we use the namecpp
? How can I find out this in documentation?
Gradle is a nightmare for me..