I have a RuleSource based plugin that extends the C++ plugin.
I want to add PrebuiltStaticLibrariy and PrebuiltSharedLibrary to the set of prebuilt libraries in the model.
E.g.
model {
repositories {
libs { // The libs is also added through the plugin
// Add prebuilt libs using the plugin here
}
}
}
I found how to add a PrebuiltLibraries to the repositories.
However I can’t find a way to create and add a prebuilt library to libs.
I did this in a groovy source file to take advantage of the Groovy configuration closure syntax but this could just as easily have been pure Java.
All you would have to change to attach to the predefined “libs” repository instead of creating one called “preBuiltLibsLinux” is the first line which would have to use maybeCreate() instead to be most flexible.
Yes, every aspect of the model configuration is accessible and modifiable by Rules as needed. Care should be taken to pick the appropriate rule each time depending on what you are trying to do. This is all explained in the Gradle documentation.