Package org.gradle.api.plugins
Interface FeatureSpec
public interface FeatureSpec
Handler for configuring features, which may contribute additional
 configurations, publications, dependencies, ...
- Since:
- 5.3
- 
Method SummaryModifier and TypeMethodDescriptionvoidcapability(String group, String name, String version) Declares a capability of this feature.voidBy default, features are published on external repositories.voidusingSourceSet(SourceSet sourceSet) Declares the source set which this feature is built from.voidAutomatically package Javadoc and register the produced JAR as a variant.voidAutomatically package sources from the linkedSourceSetand register the produced JAR as a variant.
- 
Method Details- 
usingSourceSetDeclares the source set which this feature is built from.- Parameters:
- sourceSet- the source set
 
- 
capabilityDeclares a capability of this feature.Calling this method multiple times will declare additional capabilities. Note that calling this method will drop the default capability that is added by JavaPluginExtension.registerFeature(String, org.gradle.api.Action). If you want to keep the default capability and add a new one you need to restore the default capability:registerFeature("myFeature") { capability("${project.group}", "${project.name}-my-feature", "${project.version}") capability("com.example", "some-other-capability", "2.0") }- Parameters:
- group- the group of the capability
- name- the name of the capability
- version- the version of the capability
 
- 
withJavadocJarvoid withJavadocJar()Automatically package Javadoc and register the produced JAR as a variant. See alsoJavaPluginExtension.withJavadocJar().- Since:
- 6.0
 
- 
withSourcesJarvoid withSourcesJar()Automatically package sources from the linkedSourceSetand register the produced JAR as a variant. See alsoJavaPluginExtension.withSourcesJar().- Since:
- 6.0
 
- 
disablePublicationvoid disablePublication()By default, features are published on external repositories. Calling this method allows disabling publishing.- Since:
- 6.7
 
 
-