ComponentMetadata
, HasAttributes
, HasConfigurableAttributes<ComponentMetadataDetails>
@NonExtensible public interface ComponentMetadataDetails extends ComponentMetadata, HasConfigurableAttributes<ComponentMetadataDetails>
ComponentMetadataHandler
.Modifier and Type | Method | Description |
---|---|---|
void |
addVariant(java.lang.String name,
java.lang.String base,
Action<? super VariantMetadata> action) |
Add a rule for adding a new variant to the component.
|
void |
addVariant(java.lang.String name,
Action<? super VariantMetadata> action) |
Add a rule for adding a new empty variant to the component.
|
void |
allVariants(Action<? super VariantMetadata> action) |
Add a rule for adjusting all variants of a component.
|
void |
belongsTo(java.lang.Object notation) |
Declares that this component belongs to a virtual platform, which should be
considered during dependency resolution.
|
void |
belongsTo(java.lang.Object notation,
boolean virtual) |
Declares that this component belongs to a platform, which should be
considered during dependency resolution.
|
void |
maybeAddVariant(java.lang.String name,
java.lang.String base,
Action<? super VariantMetadata> action) |
This is the lenient version of
addVariant(String, String, Action) . |
void |
setChanging(boolean changing) |
Sets whether the component is changing or immutable.
|
void |
setStatus(java.lang.String status) |
Sets the status of the component.
|
void |
setStatusScheme(java.util.List<java.lang.String> statusScheme) |
Sets the status scheme of the component.
|
void |
withVariant(java.lang.String name,
Action<? super VariantMetadata> action) |
Add a rule for adjusting an existing variant of the component.
|
getId, getStatus, getStatusScheme, isChanging
getAttributes
attributes
void setChanging(boolean changing)
changing
- whether the component is changing or immutablevoid setStatus(java.lang.String status)
ComponentMetadata.getStatusScheme()
.status
- the status of the componentvoid setStatusScheme(java.util.List<java.lang.String> statusScheme)
statusScheme
- the status scheme of the componentvoid withVariant(java.lang.String name, Action<? super VariantMetadata> action)
name
- name of the variant to adjust (e.g. 'compile')action
- the action to modify the variantvoid allVariants(Action<? super VariantMetadata> action)
action
- the action to be executed on each variant.void addVariant(java.lang.String name, Action<? super VariantMetadata> action)
name
- a name for the variantaction
- the action to populate the variantvoid addVariant(java.lang.String name, java.lang.String base, Action<? super VariantMetadata> action)
VariantMetadata.withFiles(Action)
.name
- a name for the variantbase
- name of the variant (pom or Gradle module metadata) or configuration (ivy.xml metadata) from which the new variant will be initializedaction
- the action to populate the variantvoid maybeAddVariant(java.lang.String name, java.lang.String base, Action<? super VariantMetadata> action)
addVariant(String, String, Action)
.
The only difference is that this will do nothing (instead of throwing an error), if the 'base' variant does not exist for a component.
This is particularly useful for rules that are applied to ComponentMetadataHandler.all(Class)
components.name
- a name for the variantbase
- name of the variant (pom or Gradle module metadata) or configuration (ivy.xml metadata) from which the new variant will be initializedaction
- the action to populate the variantvoid belongsTo(java.lang.Object notation)
notation
- the coordinates of the ownervoid belongsTo(java.lang.Object notation, boolean virtual)
notation
- the coordinates of the ownervirtual
- must be set to true if the platform is a virtual platform, or false if it's a published platform