I have a plugin that creates a native library ‘main’ I want users of my plugin to be able ot override the deafult location of the source files.
With Gradle 2.2 i could do this:
project.sources.main.cpp {
source {
srcDir "."
include "*.cpp"
}
}
but I’m having trouble finding the equivalent in Gradle 2.3. I thought I should b able to do this:
project.components.main.sources.cpp {
source {
srcDir "."
include "*.cpp"
}
}
but that just claims that there is no property ‘main’…
I’ll have to admint that I have a hard time figuring out the object model from looking at gradle sample files. For example the release notes have:
model {
components {
hello(NativeLibrarySpec)
main(NativeExecutableSpec) {
sources {
cpp {
lib library: "hello"
source {
srcDir "src/source"
include "**/*.cpp"
}
exportedHeaders {
srcDir "src/include"
}
}
}
}
}
}
but when I tried:
project.model.components.main.sources.cpp {
source {
srcDir "."
include "*.cpp"
}
}
it complained about ‘model’ not being a property.