How can I recreate the new 2.3-rc-2 “model” closure which contains a CppSourceSet inside my plugin? I used to be able to do something like project.libraries.create but I’m not sure how to create or access the components piece.
This boils down to how do you add a sourceset to a component container? Im trying to do something like the following:
project.model {
project.extensions.rs.libs.each { l ->
components.create(
l.name, NativeLibrarySpec.class, {
sources {
l.sources(project)
}
}
)
}
}
or
project.model {
project.extensions.rs.libs.each { l ->
components {
l.name(NativeLibrarySpec) {
sources {
l.sources(project)
}
}
)
}
}
where l.name is just the string name of the binary and sources(project) will return the sourceset.