Esempio n. 1
1
 private Set<ResolvedArtifact> getArtifacts(ConfigurationNode childConfiguration) {
   String[] targetConfigurations =
       from.metaData.getHierarchy().toArray(new String[from.metaData.getHierarchy().size()]);
   DependencyArtifactDescriptor[] dependencyArtifacts =
       dependencyDescriptor.getDependencyArtifacts(targetConfigurations);
   if (dependencyArtifacts.length == 0) {
     return Collections.emptySet();
   }
   Set<ResolvedArtifact> artifacts = new LinkedHashSet<ResolvedArtifact>();
   for (DependencyArtifactDescriptor artifactDescriptor : dependencyArtifacts) {
     ModuleRevisionId id =
         childConfiguration.moduleRevision.metaData.getDescriptor().getModuleRevisionId();
     Artifact artifact =
         new DefaultArtifact(
             id,
             null,
             artifactDescriptor.getName(),
             artifactDescriptor.getType(),
             artifactDescriptor.getExt(),
             artifactDescriptor.getUrl(),
             artifactDescriptor.getQualifiedExtraAttributes());
     artifacts.add(
         resolveState.builder.newArtifact(
             childConfiguration.getResult(),
             artifact,
             targetModuleRevision.resolve().getArtifactResolver()));
   }
   return artifacts;
 }
Esempio n. 2
0
    public void attachToParents(
        ConfigurationNode childConfiguration, ResolvedConfigurationBuilder result) {
      ResolvedConfigurationIdentifier parent = from.getResult();
      ResolvedConfigurationIdentifier child = childConfiguration.getResult();
      result.addChild(parent, child);

      Set<ResolvedArtifact> artifacts = getArtifacts(childConfiguration);
      if (artifacts.isEmpty()) {
        artifacts = childConfiguration.getArtifacts();
      }
      // TODO SF merge with addChild
      result.addParentSpecificArtifacts(child, parent, artifacts);

      if (parent == resolveState.root.getResult()) {
        EnhancedDependencyDescriptor enhancedDependencyDescriptor =
            (EnhancedDependencyDescriptor) dependencyDescriptor;
        result.addFirstLevelDependency(enhancedDependencyDescriptor.getModuleDependency(), child);
      }
    }