Package org.gradle.platform.base
Annotation Type ComponentBinaries
-
@Retention(RUNTIME) @Target(METHOD) @Incubating public @interface ComponentBinaries
Declares the binaries that should be built for a customComponentSpec
type. The following example demonstrates how to register a binary for a custom component type using a plugin with aComponentBinaries
annotation. Furthermore the plugin registers 'DefaultSampleBinary' as implementation forBinarySpec
.interface SampleComponent extends VariantComponentSpec {} interface SampleBinary extends BinarySpec {} class DefaultSampleBinary extends BaseBinarySpec implements SampleBinary {} apply plugin: MyCustomBinariesPlugin class MyCustomBinariesPlugin extends RuleSource { @ComponentType void register(TypeBuilder<SampleBinary> builder) { builder.defaultImplementation(DefaultSampleBinary) } @ComponentBinaries void createBinariesForSampleLibrary(ModelMap<SampleBinary> binaries, SampleComponent component) { binaries.create("${component.name}Binary", SampleBinary) } }