Search in sources :

Example 1 with DefaultShadowedCapability

use of org.gradle.internal.component.external.model.DefaultShadowedCapability in project gradle by gradle.

the class JavaPlatformPlugin method createConfigurations.

private void createConfigurations(Project project) {
    ConfigurationContainer configurations = project.getConfigurations();
    Capability enforcedCapability = new DefaultShadowedCapability(new ProjectDerivedCapability(project), "-derived-enforced-platform");
    Configuration api = configurations.create(API_CONFIGURATION_NAME, AS_BUCKET);
    Configuration apiElements = createConsumableApi(project, configurations, api, API_ELEMENTS_CONFIGURATION_NAME, Category.REGULAR_PLATFORM);
    Configuration enforcedApiElements = createConsumableApi(project, configurations, api, ENFORCED_API_ELEMENTS_CONFIGURATION_NAME, Category.ENFORCED_PLATFORM);
    enforcedApiElements.getOutgoing().capability(enforcedCapability);
    Configuration runtime = project.getConfigurations().create(RUNTIME_CONFIGURATION_NAME, AS_BUCKET);
    runtime.extendsFrom(api);
    Configuration runtimeElements = createConsumableRuntime(project, runtime, RUNTIME_ELEMENTS_CONFIGURATION_NAME, Category.REGULAR_PLATFORM);
    Configuration enforcedRuntimeElements = createConsumableRuntime(project, runtime, ENFORCED_RUNTIME_ELEMENTS_CONFIGURATION_NAME, Category.ENFORCED_PLATFORM);
    enforcedRuntimeElements.getOutgoing().capability(enforcedCapability);
    Configuration classpath = configurations.create(CLASSPATH_CONFIGURATION_NAME, AS_RESOLVABLE_CONFIGURATION);
    classpath.extendsFrom(runtimeElements);
    declareConfigurationUsage(project.getObjects(), classpath, Usage.JAVA_RUNTIME, LibraryElements.JAR);
    createSoftwareComponent(project, apiElements, runtimeElements);
}
Also used : DefaultShadowedCapability(org.gradle.internal.component.external.model.DefaultShadowedCapability) Capability(org.gradle.api.capabilities.Capability) ProjectDerivedCapability(org.gradle.internal.component.external.model.ProjectDerivedCapability) Configuration(org.gradle.api.artifacts.Configuration) ConfigurationContainer(org.gradle.api.artifacts.ConfigurationContainer) ProjectDerivedCapability(org.gradle.internal.component.external.model.ProjectDerivedCapability) DefaultShadowedCapability(org.gradle.internal.component.external.model.DefaultShadowedCapability)

Aggregations

Configuration (org.gradle.api.artifacts.Configuration)1 ConfigurationContainer (org.gradle.api.artifacts.ConfigurationContainer)1 Capability (org.gradle.api.capabilities.Capability)1 DefaultShadowedCapability (org.gradle.internal.component.external.model.DefaultShadowedCapability)1 ProjectDerivedCapability (org.gradle.internal.component.external.model.ProjectDerivedCapability)1