Search in sources :

Example 1 with DefaultConflictHandler

use of org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.conflicts.DefaultConflictHandler in project gradle by gradle.

the class DefaultArtifactDependencyResolver method createConflictHandler.

private ConflictHandler createConflictHandler(ResolutionStrategyInternal resolutionStrategy, GlobalDependencyResolutionRules metadataHandler) {
    ModuleConflictResolver conflictResolver;
    ConflictResolution conflictResolution = resolutionStrategy.getConflictResolution();
    if (conflictResolution instanceof StrictConflictResolution) {
        conflictResolver = new StrictConflictResolver();
    } else {
        conflictResolver = new LatestModuleConflictResolver(versionComparator);
        if (conflictResolution instanceof PreferProjectModulesConflictResolution) {
            conflictResolver = new ProjectDependencyForcingResolver(conflictResolver);
        }
    }
    conflictResolver = new VersionSelectionReasonResolver(conflictResolver);
    return new DefaultConflictHandler(conflictResolver, metadataHandler.getModuleMetadataProcessor().getModuleReplacements());
}
Also used : StrictConflictResolution(org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.StrictConflictResolution) DefaultConflictHandler(org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.conflicts.DefaultConflictHandler) StrictConflictResolution(org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.StrictConflictResolution) ConflictResolution(org.gradle.api.internal.artifacts.configurations.ConflictResolution) PreferProjectModulesConflictResolution(org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.PreferProjectModulesConflictResolution) PreferProjectModulesConflictResolution(org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.PreferProjectModulesConflictResolution)

Example 2 with DefaultConflictHandler

use of org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.conflicts.DefaultConflictHandler in project gradle by gradle.

the class DefaultArtifactDependencyResolver method createModuleConflictHandler.

private ModuleConflictHandler createModuleConflictHandler(ResolutionStrategyInternal resolutionStrategy, GlobalDependencyResolutionRules metadataHandler) {
    ConflictResolution conflictResolution = resolutionStrategy.getConflictResolution();
    ModuleConflictResolver<ComponentState> conflictResolver = new ConflictResolverFactory(versionComparator, versionParser).createConflictResolver(conflictResolution);
    return new DefaultConflictHandler(conflictResolver, metadataHandler.getModuleMetadataProcessor().getModuleReplacements());
}
Also used : DefaultConflictHandler(org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.conflicts.DefaultConflictHandler) ConflictResolution(org.gradle.api.internal.artifacts.configurations.ConflictResolution) ComponentState(org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.ComponentState)

Aggregations

ConflictResolution (org.gradle.api.internal.artifacts.configurations.ConflictResolution)2 DefaultConflictHandler (org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.conflicts.DefaultConflictHandler)2 PreferProjectModulesConflictResolution (org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.PreferProjectModulesConflictResolution)1 StrictConflictResolution (org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.StrictConflictResolution)1 ComponentState (org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.ComponentState)1