Esempio n. 1
0
  public Set<ResolvedArtifact> getArtifacts() {
    Set<ComponentArtifactMetaData> componentArtifacts = resolveComponentArtifacts();
    Set<ResolvedArtifact> resolvedArtifacts =
        new LinkedHashSet<ResolvedArtifact>(componentArtifacts.size());
    for (ComponentArtifactMetaData artifact : componentArtifacts) {
      IvyArtifactName artifactName = artifact.getName();
      if (!selector.acceptArtifact(moduleVersionIdentifier.getModule(), artifactName)) {
        continue;
      }

      ResolvedArtifact resolvedArtifact = allResolvedArtifacts.get(artifact.getId());
      if (resolvedArtifact == null) {
        Factory<File> artifactSource =
            new LazyArtifactSource(artifact, moduleSource, artifactResolver);
        resolvedArtifact =
            new DefaultResolvedArtifact(
                new DefaultResolvedModuleVersion(moduleVersionIdentifier),
                artifactName,
                artifact.getId(),
                artifactSource);
        allResolvedArtifacts.put(artifact.getId(), resolvedArtifact);
      }
      resolvedArtifacts.add(resolvedArtifact);
    }
    return resolvedArtifacts;
  }
 public void resolveArtifact(
     ComponentArtifactMetaData component,
     ModuleSource moduleSource,
     BuildableArtifactResolveResult result) {
   if (isProjectModule(component.getComponentId())) {
     LocalComponentArtifactIdentifier id = (LocalComponentArtifactIdentifier) component.getId();
     File localArtifactFile = id.getFile();
     if (localArtifactFile != null) {
       result.resolved(localArtifactFile);
     } else {
       result.notFound(component.getId());
     }
   }
 }