gradle
8.6

# registerFeature

abstract fun registerFeature(name: String, configureAction: Action<out Any>)(source)

Registers a feature.

The new feature will have a default capability corresponding to the "group", "name" + feature name and version of this project. For example, if the group of the component is "org", that the project name is "lib" the version is "1.0" and the feature name is "myFeature", then a capability named "org:lib-my-feature:1.0" is automatically added.

In order to consume this feature in another module add a dependency like the following:

     dependencies {
         implementation(project(":lib")) {
             capabilities {
                 requireCapability("org:lib-my-feature:1.0")
             }
         }
     }

Content copied to clipboard
The capability method can be used to refine the capabilities of this feature.

#### Parameters

name

the name of the feature

configureAction

the configuration for the feature