Search in sources :

Example 1 with ProviderConvertible

use of org.gradle.api.provider.ProviderConvertible in project gradle by gradle.

the class DefaultDependencyConstraintHandler method doAdd.

private DependencyConstraint doAdd(Configuration configuration, Object dependencyNotation, @Nullable Action<? super DependencyConstraint> configureAction) {
    if (dependencyNotation instanceof ProviderConvertible<?>) {
        return doAddProvider(configuration, ((ProviderConvertible<?>) dependencyNotation).asProvider(), configureAction);
    }
    if (dependencyNotation instanceof Provider<?>) {
        return doAddProvider(configuration, (Provider<?>) dependencyNotation, configureAction);
    }
    DependencyConstraint dependency = doCreate(dependencyNotation, configureAction);
    configuration.getDependencyConstraints().add(dependency);
    return dependency;
}
Also used : DependencyConstraint(org.gradle.api.artifacts.DependencyConstraint) ProviderConvertible(org.gradle.api.provider.ProviderConvertible) Provider(org.gradle.api.provider.Provider)

Aggregations

DependencyConstraint (org.gradle.api.artifacts.DependencyConstraint)1 Provider (org.gradle.api.provider.Provider)1 ProviderConvertible (org.gradle.api.provider.ProviderConvertible)1