Search in sources :

Example 1 with ProjectDerivedCapability

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

the class DefaultJavaPluginExtension method registerFeature.

public void registerFeature(String name, Action<? super FeatureSpec> configureAction) {
    Capability defaultCapability = new ProjectDerivedCapability(project, name);
    DefaultJavaFeatureSpec spec = new DefaultJavaFeatureSpec(validateFeatureName(name), defaultCapability, jvmPluginServices);
    configureAction.execute(spec);
    spec.create();
}
Also used : ProjectDerivedCapability(org.gradle.internal.component.external.model.ProjectDerivedCapability) Capability(org.gradle.api.capabilities.Capability) ProjectDerivedCapability(org.gradle.internal.component.external.model.ProjectDerivedCapability)

Example 2 with ProjectDerivedCapability

use of org.gradle.internal.component.external.model.ProjectDerivedCapability 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)

Example 3 with ProjectDerivedCapability

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

the class DefaultJvmPluginServices method createJvmVariant.

@Override
public void createJvmVariant(String name, Action<? super JvmVariantBuilder> configuration) {
    DefaultJvmVariantBuilder builder = instanceGenerator.newInstance(DefaultJvmVariantBuilder.class, name, new ProjectDerivedCapability(project, name), this, sourceSets, configurations, tasks, components, project);
    configuration.execute(builder);
    builder.build();
}
Also used : ProjectDerivedCapability(org.gradle.internal.component.external.model.ProjectDerivedCapability)

Aggregations

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