コード例 #1
0
 public void getNodeValues(
     ResolvedDependency node,
     Collection<ResolvedArtifact> values,
     Collection<ResolvedDependency> connectedNodes) {
   values.addAll(node.getModuleArtifacts());
   connectedNodes.addAll(node.getChildren());
 }
コード例 #2
0
    public Set<File> getFiles(Spec<Dependency> dependencySpec) {
      rethrowFailure();
      Set<ModuleDependency> allDependencies =
          configuration.getAllDependencies(ModuleDependency.class);
      Set<ModuleDependency> selectedDependencies =
          Specs.filterIterable(allDependencies, dependencySpec);

      Set<ResolvedArtifact> artifacts = new LinkedHashSet<ResolvedArtifact>();

      for (ModuleDependency moduleDependency : selectedDependencies) {
        Set<ResolvedDependency> resolvedDependencies =
            conversionResult.getFirstLevelResolvedDependencies().get(moduleDependency);
        for (ResolvedDependency resolvedDependency : resolvedDependencies) {
          artifacts.addAll(resolvedDependency.getParentArtifacts(conversionResult.getRoot()));
          walker.add(resolvedDependency);
        }
      }

      artifacts.addAll(walker.findValues());

      Set<File> files = new LinkedHashSet<File>();
      for (ResolvedArtifact artifact : artifacts) {
        File depFile = artifact.getFile();
        if (depFile != null) {
          files.add(depFile);
        } else {
          logger.debug(String.format("Resolved artifact %s contains a null value.", artifact));
        }
      }
      return files;
    }
コード例 #3
0
 @Override
 public boolean equals(Object obj) {
   if (obj == this) {
     return true;
   }
   if (obj == null || obj.getClass() != getClass()) {
     return false;
   }
   DefaultResolvedArtifact other = (DefaultResolvedArtifact) obj;
   if (!other
       .resolvedDependency
       .getModule()
       .getId()
       .equals(resolvedDependency.getModule().getId())) {
     return false;
   }
   if (!other.getName().equals(getName())) {
     return false;
   }
   if (!other.getType().equals(getType())) {
     return false;
   }
   if (!other.getExtension().equals(getExtension())) {
     return false;
   }
   if (!other.extraAttributes.equals(extraAttributes)) {
     return false;
   }
   return true;
 }
コード例 #4
0
 @Override
 public int hashCode() {
   return resolvedDependency.getModule().getId().hashCode()
       ^ getName().hashCode()
       ^ getType().hashCode()
       ^ getExtension().hashCode()
       ^ extraAttributes.hashCode();
 }
コード例 #5
0
 public ResolvedModuleVersion getModuleVersion() {
   return resolvedDependency.getModule();
 }
コード例 #6
0
 public void getEdgeValues(
     ResolvedDependency from, ResolvedDependency to, Collection<ResolvedArtifact> values) {
   values.addAll(to.getParentArtifacts(from));
 }