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 Summary
Modifier 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
-
usingSourceSet
Declares the source set which this feature is built from.- Parameters:
sourceSet- the source set
-
capability
Declares 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 capabilityname- the name of the capabilityversion- the version of the capability
-
withJavadocJar
void withJavadocJar()Automatically package Javadoc and register the produced JAR as a variant. See alsoJavaPluginExtension.withJavadocJar().- Since:
- 6.0
-
withSourcesJar
void withSourcesJar()Automatically package sources from the linkedSourceSetand register the produced JAR as a variant. See alsoJavaPluginExtension.withSourcesJar().- Since:
- 6.0
-
disablePublication
void disablePublication()By default, features are published on external repositories. Calling this method allows disabling publishing.- Since:
- 6.7
-