Annotation Type ComponentBinaries

  • @Retention(RUNTIME)
    public @interface ComponentBinaries
    Declares the binaries that should be built for a custom ComponentSpec type. The following example demonstrates how to register a binary for a custom component type using a plugin with a ComponentBinaries annotation. Furthermore the plugin registers 'DefaultSampleBinary' as implementation for BinarySpec.
     interface SampleComponent extends VariantComponentSpec {}
     interface SampleBinary extends BinarySpec {}
     class DefaultSampleBinary extends BaseBinarySpec implements SampleBinary {}
     apply plugin: MyCustomBinariesPlugin
     class MyCustomBinariesPlugin extends RuleSource {
         void register(TypeBuilder<SampleBinary> builder) {
         void createBinariesForSampleLibrary(ModelMap<SampleBinary> binaries, SampleComponent component) {
             binaries.create("${}Binary", SampleBinary)