Hello and good morning from germany.
I want to read the ProjectSourceSet via the rule based model. Running gradle model tells me, that my ProjectSourceSet contains two entries, and that the rule in which i try to read the ProjectSourceSet was applied to the ProjectSourceSet model object. However, within the rule, the ProjectSourceSet contains zero entries.
I tried to anotate my rule with @Mutate, @Validate and @Finalize, to no success. My understanding is, that the ProjectSourceSet model object should be complete in rules with @Validate or @Finalize, but obviously i have not figured out the big picture yet. What else could i do to access the ProjectSourceSet?
From gradle model:
+ sources
| Type: org.gradle.language.base.ProjectSourceSet
| Value: [C++ source 'mathematics:cpp', C++ source 'myLib:cpp']
| Creator: LanguageBasePlugin.Rules#sources
| Rules:
? MyPlugin.RuleSourceInnerClass#read
Source code of Rule:
public static class RuleSourceInnerClass extends RuleSource {
@Validate
void read(ProjectSourceSet projectSourceSet) {
println 'Rule fired'
println projectSourceSet.size() // <-- results to 0
}
}