Search in sources :

Example 6 with ExternalModuleDependency

use of org.gradle.api.artifacts.ExternalModuleDependency in project gradle by gradle.

the class DefaultDependencyHandler method enforcedPlatform.

@Override
@SuppressWarnings("deprecation")
public Dependency enforcedPlatform(Object notation) {
    Dependency platformDependency = create(notation);
    if (platformDependency instanceof ExternalModuleDependency) {
        ExternalModuleDependency externalModuleDependency = (ExternalModuleDependency) platformDependency;
        DeprecationLogger.whileDisabled(() -> externalModuleDependency.setForce(true));
        platformSupport.addPlatformAttribute(externalModuleDependency, toCategory(Category.ENFORCED_PLATFORM));
    } else if (platformDependency instanceof HasConfigurableAttributes) {
        platformSupport.addPlatformAttribute((HasConfigurableAttributes<?>) platformDependency, toCategory(Category.ENFORCED_PLATFORM));
    }
    return platformDependency;
}
Also used : HasConfigurableAttributes(org.gradle.api.attributes.HasConfigurableAttributes) ExternalModuleDependency(org.gradle.api.artifacts.ExternalModuleDependency) ModuleDependency(org.gradle.api.artifacts.ModuleDependency) MinimalExternalModuleDependency(org.gradle.api.artifacts.MinimalExternalModuleDependency) ProjectDependency(org.gradle.api.artifacts.ProjectDependency) Dependency(org.gradle.api.artifacts.Dependency) ExternalModuleDependency(org.gradle.api.artifacts.ExternalModuleDependency) MinimalExternalModuleDependency(org.gradle.api.artifacts.MinimalExternalModuleDependency)

Aggregations

ExternalModuleDependency (org.gradle.api.artifacts.ExternalModuleDependency)6 ModuleComponentSelector (org.gradle.api.artifacts.component.ModuleComponentSelector)2 DefaultModuleComponentSelector (org.gradle.internal.component.external.model.DefaultModuleComponentSelector)2 DslOriginDependencyMetadataWrapper (org.gradle.internal.component.local.model.DslOriginDependencyMetadataWrapper)2 LocalComponentDependencyMetadata (org.gradle.internal.component.model.LocalComponentDependencyMetadata)2 InvalidUserDataException (org.gradle.api.InvalidUserDataException)1 Dependency (org.gradle.api.artifacts.Dependency)1 MinimalExternalModuleDependency (org.gradle.api.artifacts.MinimalExternalModuleDependency)1 ModuleDependency (org.gradle.api.artifacts.ModuleDependency)1 ModuleVersionSelector (org.gradle.api.artifacts.ModuleVersionSelector)1 MutableVersionConstraint (org.gradle.api.artifacts.MutableVersionConstraint)1 ProjectDependency (org.gradle.api.artifacts.ProjectDependency)1 VersionConstraint (org.gradle.api.artifacts.VersionConstraint)1 HasConfigurableAttributes (org.gradle.api.attributes.HasConfigurableAttributes)1 DefaultModuleVersionSelector (org.gradle.api.internal.artifacts.DefaultModuleVersionSelector)1 ImmutableVersionConstraint (org.gradle.api.internal.artifacts.ImmutableVersionConstraint)1 Exclude (org.gradle.internal.component.model.Exclude)1 ExcludeMetadata (org.gradle.internal.component.model.ExcludeMetadata)1