Declares that a custom
BinarySpec
type.
The following example demonstrates how to register a custom component type using a plugin with a
BinaryType
annotation.
import org.gradle.model.*
import org.gradle.model.collection.*
interface SampleBinary extends BinarySpec {}
class DefaultSampleBinary extends BaseBinarySpec implements SampleBinary {}
apply plugin: MySamplePlugin
class MySamplePlugin implements Plugin {
void apply(final Project project) {}
@RuleSource
static class ComponentModel {
@BinaryType
void defineBinaryType(BinaryTypeBuilder builder) {
builder.defaultImplementation(DefaultSampleBinary)
}
}
}