Skip to content

Commit

Permalink
Changed graph-building logic to use full project names.
Browse files Browse the repository at this point in the history
Maven and Ivy Projects that are configured to build their modules as separate jobs can sometimes have modules with identical names in different projects. Using project.getName() meant that these modules were treated as the same graph node.
Using project.getFullName() ensures a unique string that correctly identifies these sub-projects.  Also, using project.getFullDisplayName() for the actual graph output results in a more readable output.
  • Loading branch information
tbingaman committed Jan 17, 2011
1 parent a553e89 commit be2b564
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public int compare(Dependency o1, Dependency o2) {
private static final Comparator<AbstractProject<?,?>> PROJECT_COMPARATOR = new Comparator<AbstractProject<?,?>>() {
@Override
public int compare(AbstractProject<?,?> o1, AbstractProject<?,?> o2) {
return o1.getName().compareTo(o2.getName());
return o1.getFullName().compareTo(o2.getFullName());
}
};

Expand Down Expand Up @@ -161,14 +161,14 @@ public String generateDotText(Set<AbstractProject<?,?>> projects, Set<Dependency
}

private String projectToNodeString(AbstractProject<?, ?> proj) {
return escapeString(proj.getName()) +
return escapeString(proj.getFullDisplayName()) +
" [href=" +
escapeString(Hudson.getInstance().getRootUrlFromRequest() + proj.getUrl()) + "]";
}

private String dependencyToEdgeString(Dependency dep) {
return escapeString(dep.getUpstreamProject().getName()) + " -> " +
escapeString(dep.getDownstreamProject().getName());
return escapeString(dep.getUpstreamProject().getFullDisplayName()) + " -> " +
escapeString(dep.getDownstreamProject().getFullDisplayName());
}

private String escapeString(String toEscape) {
Expand Down

0 comments on commit be2b564

Please sign in to comment.