maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject [1/2] git commit: Hiding the project sorter as it is an implementation detail of the graph and I want to make another implementation.
Date Mon, 03 Feb 2014 22:38:19 GMT
Updated Branches:
  refs/heads/master d55dca85a -> 3bf568eda


Hiding the project sorter as it is an implementation detail of the graph and I want to make
another implementation.


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/90ab9700
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/90ab9700
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/90ab9700

Branch: refs/heads/master
Commit: 90ab970006ccbd56558d5d1d0c326910e043c101
Parents: 0f26521
Author: Jason van Zyl <jason@tesla.io>
Authored: Mon Feb 3 17:37:05 2014 -0500
Committer: Jason van Zyl <jason@tesla.io>
Committed: Mon Feb 3 17:37:05 2014 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/maven/DefaultMaven.java   |  9 +++------
 .../maven/DefaultProjectDependencyGraph.java       | 17 ++++++++---------
 2 files changed, 11 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/90ab9700/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
index 76fc049..a0c3d3b 100644
--- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
+++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
@@ -58,7 +58,6 @@ import org.apache.maven.project.ProjectBuilder;
 import org.apache.maven.project.ProjectBuildingException;
 import org.apache.maven.project.ProjectBuildingRequest;
 import org.apache.maven.project.ProjectBuildingResult;
-import org.apache.maven.project.ProjectSorter;
 import org.apache.maven.repository.LocalRepositoryNotAccessibleException;
 import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
 import org.apache.maven.settings.Mirror;
@@ -757,19 +756,17 @@ public class DefaultMaven
 
         try
         {
-            ProjectSorter projectSorter = new ProjectSorter( projects );
-
-            projectDependencyGraph = new DefaultProjectDependencyGraph( projectSorter );
+            projectDependencyGraph = new DefaultProjectDependencyGraph( projects );
 
             if ( trimming )
             {
-                List<MavenProject> activeProjects = projectSorter.getSortedProjects();
+                List<MavenProject> activeProjects = projectDependencyGraph.getSortedProjects();
 
                 activeProjects = trimSelectedProjects( activeProjects, projectDependencyGraph,
request );
                 activeProjects = trimExcludedProjects( activeProjects,  request );
                 activeProjects = trimResumedProjects( activeProjects, request );
 
-                if ( activeProjects.size() != projectSorter.getSortedProjects().size() )
+                if ( activeProjects.size() != projectDependencyGraph.getSortedProjects().size()
)
                 {
                     projectDependencyGraph =
                         new FilteredProjectDependencyGraph( projectDependencyGraph, activeProjects
);

http://git-wip-us.apache.org/repos/asf/maven/blob/90ab9700/maven-core/src/main/java/org/apache/maven/DefaultProjectDependencyGraph.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/DefaultProjectDependencyGraph.java
b/maven-core/src/main/java/org/apache/maven/DefaultProjectDependencyGraph.java
index 9a4b83d..67ed340 100644
--- a/maven-core/src/main/java/org/apache/maven/DefaultProjectDependencyGraph.java
+++ b/maven-core/src/main/java/org/apache/maven/DefaultProjectDependencyGraph.java
@@ -25,8 +25,10 @@ import java.util.HashSet;
 import java.util.List;
 
 import org.apache.maven.execution.ProjectDependencyGraph;
+import org.apache.maven.project.DuplicateProjectException;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.ProjectSorter;
+import org.codehaus.plexus.util.dag.CycleDetectedException;
 
 /**
  * Describes the inter-dependencies between projects in the reactor.
@@ -40,18 +42,15 @@ class DefaultProjectDependencyGraph
     private ProjectSorter sorter;
 
     /**
-     * Creates a new project dependency graph based on the specified project sorting.
+     * Creates a new project dependency graph based on the specified projects.
      * 
-     * @param sorter The project sorter backing the graph, must not be {@code null}.
+     * @param projects The projects to create the dependency graph with
+     * @throws DuplicateProjectException 
+     * @throws CycleDetectedException 
      */
-    public DefaultProjectDependencyGraph( ProjectSorter sorter )
+    public DefaultProjectDependencyGraph( Collection<MavenProject> projects ) throws
CycleDetectedException, DuplicateProjectException
     {
-        if ( sorter == null )
-        {
-            throw new IllegalArgumentException( "project sorter missing" );
-        }
-
-        this.sorter = sorter;
+        this.sorter = new ProjectSorter( projects );
     }
 
     public List<MavenProject> getSortedProjects()


Mime
View raw message