# ComponentBinaries

@Retention(value = RetentionPolicy.RUNTIME)
@Target(value = ElementType.METHOD)
@Incubating
annotation class ComponentBinaries(source)

### Deprecated

The Gradle software model is deprecated and will be removed in Gradle 10. Use the new component model (e.g. `cpp-application`, `cpp-library`, `swift-application`, `swift-library`, `xctest`) instead.

Declares the binaries that should be built for a custom org.gradle.platform.base.ComponentSpec type. The following example demonstrates how to register a binary for a custom component type using a plugin with a org.gradle.platform.base.ComponentBinaries annotation. Furthermore the plugin registers 'DefaultSampleBinary' as implementation for org.gradle.platform.base.BinarySpec.

    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)
        }
    }

Content copied to clipboard

#### Since

2.2

## Functions

annotationType
Link copied to clipboard
abstract fun annotationType(): Class<out Annotation>
equals
Link copied to clipboard
abstract fun equals(p: Any): Boolean
hashCode
Link copied to clipboard
abstract fun hashCode(): Int
toString
Link copied to clipboard
abstract fun toString(): String