use of org.gradle.api.attributes.HasConfigurableAttributes in project gradle by gradle.
the class DefaultDependencyHandler method platform.
@Override
public Dependency platform(Object notation) {
Dependency dependency = create(notation);
if (dependency instanceof ModuleDependency) {
ModuleDependency moduleDependency = (ModuleDependency) dependency;
moduleDependency.endorseStrictVersions();
platformSupport.addPlatformAttribute(moduleDependency, toCategory(Category.REGULAR_PLATFORM));
} else if (dependency instanceof HasConfigurableAttributes) {
platformSupport.addPlatformAttribute((HasConfigurableAttributes<?>) dependency, toCategory(Category.REGULAR_PLATFORM));
}
return dependency;
}
use of org.gradle.api.attributes.HasConfigurableAttributes 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;
}
Aggregations