I always get Source Sets: 0. I have also used afterEach and all to try to get the source sets but don’t ever see them.
However when I run gradle components I get
DefaultTestSchemaComponentSpec 'schema'
------------------------------------------
Source sets
Test Data Schema Source 'schema:ds'
srcDir: src/main/dataSource
Binaries
DefaultTestJavaDataSchemaBinary 'jar'
build using task: :test:jar
Note: currently not all plugins register their components, so some components may not be visible here.
so Gradle see’s the source set but I can’t access it in the plugin. Can anyone tell me what I’m doing wrong?
Looks like it works if you use getInputs() rather than getSources(). In reality getSources() should return the value of getInputs() but that’s only on unmanaged binaries that extend from BaseBinarySpec. We should probably deprecate getSources() (which we’ve done in BaseBinarySpec) or bridge this somehow for managed models.