Declares that a custom
BinarySpec
type.
The following example demonstrates how to register a custom language type using a plugin with a
LanguageType
annotation.
import org.gradle.model.*
import org.gradle.model.collection.*
interface CustomLanguageSourceSet extends LanguageSourceSet {}
class DefaultCustomLanguageSourceSet extends BaseLanguageSourceSet implements CustomLanguageSourceSet {}
apply plugin: MySamplePlugin
@RuleSource
class MySamplePlugin {
@LanguageType
void declareCustomLanguage(LanguageTypeBuilder builder) {
builder.setLanguageName("custom")
builder.defaultImplementation(DefaultCustomLanguageSourceSet)
}
}