Search in sources :

Example 21 with Capability

use of org.gradle.api.capabilities.Capability in project gradle by gradle.

the class ModuleMetadataFileGenerator method writeCapabilities.

private void writeCapabilities(UsageContext variant, JsonWriter jsonWriter) throws IOException {
    Set<? extends Capability> capabilities = variant.getCapabilities();
    if (!capabilities.isEmpty()) {
        jsonWriter.name("capabilities");
        jsonWriter.beginArray();
        for (Capability capability : capabilities) {
            jsonWriter.beginObject();
            jsonWriter.name("group").value(capability.getGroup());
            jsonWriter.name("name").value(capability.getName());
            jsonWriter.name("version").value(capability.getVersion());
            jsonWriter.endObject();
        }
        jsonWriter.endArray();
    }
}
Also used : Capability(org.gradle.api.capabilities.Capability)

Aggregations

Capability (org.gradle.api.capabilities.Capability)21 ImmutableCapability (org.gradle.internal.component.external.model.ImmutableCapability)7 VersionConstraint (org.gradle.api.artifacts.VersionConstraint)3 DefaultImmutableVersionConstraint (org.gradle.api.internal.artifacts.dependencies.DefaultImmutableVersionConstraint)3 ShadowedCapability (org.gradle.internal.component.external.model.ShadowedCapability)3 ImmutableList (com.google.common.collect.ImmutableList)2 DependencyConstraint (org.gradle.api.artifacts.DependencyConstraint)2 ModuleDependency (org.gradle.api.artifacts.ModuleDependency)2 ProjectDependency (org.gradle.api.artifacts.ProjectDependency)2 AttributeContainer (org.gradle.api.attributes.AttributeContainer)2 DefaultResolvedVariantResult (org.gradle.api.internal.artifacts.result.DefaultResolvedVariantResult)2 ImmutableAttributes (org.gradle.api.internal.attributes.ImmutableAttributes)2 UsageContext (org.gradle.api.internal.component.UsageContext)2 DisplayName (org.gradle.internal.DisplayName)2 DefaultShadowedCapability (org.gradle.internal.component.external.model.DefaultShadowedCapability)2 ProjectDerivedCapability (org.gradle.internal.component.external.model.ProjectDerivedCapability)2 Nullable (javax.annotation.Nullable)1 InvalidUserCodeException (org.gradle.api.InvalidUserCodeException)1 Configuration (org.gradle.api.artifacts.Configuration)1 ConfigurationContainer (org.gradle.api.artifacts.ConfigurationContainer)1