コード例 #1
0
 public ModuleVersionResolveState clearSelection() {
   ModuleVersionResolveState previousSelection = selected;
   selected = null;
   for (ModuleVersionResolveState version : versions.values()) {
     version.state = ModuleState.Conflict;
   }
   return previousSelection;
 }
コード例 #2
0
 public void select(ModuleVersionResolveState selected) {
   assert this.selected == null;
   this.selected = selected;
   for (ModuleVersionResolveState version : versions.values()) {
     version.state = ModuleState.Evicted;
   }
   selected.state = ModuleState.Selected;
 }
コード例 #3
0
 public void restart(ModuleVersionResolveState selected) {
   select(selected);
   for (ModuleVersionResolveState version : versions.values()) {
     version.restart(selected);
   }
   for (ModuleVersionSelectorResolveState selector : selectors) {
     selector.restart(selected);
   }
   for (DependencyEdge dependency : new ArrayList<DependencyEdge>(unattachedDependencies)) {
     dependency.restart(selected);
   }
   unattachedDependencies.clear();
 }
コード例 #4
0
 private ConfigurationNode(
     ResolvedConfigurationIdentifier id,
     ModuleVersionResolveState moduleRevision,
     ResolveState resolveState) {
   this.id = id;
   this.moduleRevision = moduleRevision;
   this.resolveState = resolveState;
   this.metaData = moduleRevision.metaData.getConfiguration(id.getConfiguration());
   moduleRevision.addConfiguration(this);
 }
コード例 #5
0
 public ResolveState(
     ComponentResolveResult rootResult,
     String rootConfigurationName,
     DependencyToComponentIdResolver idResolver,
     ComponentMetaDataResolver metaDataResolver,
     DependencyToConfigurationResolver dependencyToConfigurationResolver) {
   this.idResolver = idResolver;
   this.metaDataResolver = metaDataResolver;
   this.dependencyToConfigurationResolver = dependencyToConfigurationResolver;
   ModuleVersionResolveState rootVersion = getRevision(rootResult.getId());
   rootVersion.setMetaData(rootResult.getMetaData());
   root =
       new RootConfigurationNode(
           rootVersion,
           new ResolvedConfigurationIdentifier(rootVersion.id, rootConfigurationName),
           this);
   nodes.put(root.id, root);
   root.moduleRevision.module.select(root.moduleRevision);
 }
コード例 #6
0
    /** @return The module version, or null if there is a failure to resolve this selector. */
    public ModuleVersionResolveState resolveModuleRevisionId() {
      if (targetModuleRevision != null) {
        return targetModuleRevision;
      }
      if (failure != null) {
        return null;
      }

      idResolveResult = new DefaultBuildableComponentIdResolveResult();
      resolver.resolve(dependencyMetaData, idResolveResult);
      if (idResolveResult.getFailure() != null) {
        failure = idResolveResult.getFailure();
        return null;
      }

      targetModuleRevision = resolveState.getRevision(idResolveResult.getModuleVersionId());
      targetModuleRevision.addResolver(this);
      targetModuleRevision.selectionReason = idResolveResult.getSelectionReason();
      targetModule = targetModuleRevision.module;
      targetModule.addSelector(this);

      return targetModuleRevision;
    }
コード例 #7
0
    private void calculateTargetConfigurations() {
      targetConfigurations.clear();
      ComponentResolveMetaData targetModuleVersion = targetModuleRevision.getMetaData();
      if (targetModuleVersion == null) {
        // Broken version
        return;
      }

      Set<ConfigurationMetaData> targetConfigurations =
          resolveState.dependencyToConfigurationResolver.resolveTargetConfigurations(
              dependencyMetaData, from.metaData, targetModuleVersion);
      for (ConfigurationMetaData targetConfiguration : targetConfigurations) {
        ConfigurationNode targetConfigurationNode =
            resolveState.getConfigurationNode(targetModuleRevision, targetConfiguration.getName());
        this.targetConfigurations.add(targetConfigurationNode);
      }
    }
コード例 #8
0
 public ComponentSelectionReason getSelectionReason() {
   return targetModuleRevision == null
       ? idResolveResult.getSelectionReason()
       : targetModuleRevision.getSelectionReason();
 }
コード例 #9
0
 private ModuleVersionResolveException getFailure() {
   return failure != null ? failure : targetModuleRevision.getFailure();
 }
コード例 #10
0
 public ComponentIdentifier getComponentId() {
   return moduleRevision.getComponentId();
 }