Package org.apache.maven.project
Class ProjectSorter
- java.lang.Object
-
- org.apache.maven.project.ProjectSorter
-
public class ProjectSorter extends java.lang.ObjectSort projects by dependencies.- Version:
- $Id$
- Author:
- Brett Porter
-
-
Constructor Summary
Constructors Constructor Description ProjectSorter(java.util.List projects)Sort a list of projects.ProjectSorter(java.util.List projects, java.util.List selectedProjectNames, java.lang.String resumeFrom, boolean make, boolean makeDependents)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.codehaus.plexus.util.dag.DAGgetDAG()java.util.ListgetDependents(java.lang.String id)java.util.MapgetProjectMap()java.util.List<MavenProject>getSortedProjects()MavenProjectgetTopLevelProject()booleanhasMultipleProjects()
-
-
-
Constructor Detail
-
ProjectSorter
public ProjectSorter(java.util.List projects) throws org.codehaus.plexus.util.dag.CycleDetectedException, DuplicateProjectException, MissingProjectExceptionSort a list of projects.- collect all the vertices for the projects that we want to build.
- iterate through the deps of each project and if that dep is within the set of projects we want to build then add an edge, otherwise throw the edge away because that dependency is not within the set of projects we are trying to build. we assume a closed set.
- do a topo sort on the graph that remains.
- Throws:
DuplicateProjectException- if any projects are duplicated by idMissingProjectExceptionorg.codehaus.plexus.util.dag.CycleDetectedException
-
ProjectSorter
public ProjectSorter(java.util.List projects, java.util.List selectedProjectNames, java.lang.String resumeFrom, boolean make, boolean makeDependents) throws org.codehaus.plexus.util.dag.CycleDetectedException, DuplicateProjectException, MissingProjectException- Throws:
org.codehaus.plexus.util.dag.CycleDetectedExceptionDuplicateProjectExceptionMissingProjectException
-
-
Method Detail
-
getTopLevelProject
public MavenProject getTopLevelProject()
-
getSortedProjects
public java.util.List<MavenProject> getSortedProjects()
-
hasMultipleProjects
public boolean hasMultipleProjects()
-
getDependents
public java.util.List getDependents(java.lang.String id)
-
getDAG
public org.codehaus.plexus.util.dag.DAG getDAG()
-
getProjectMap
public java.util.Map getProjectMap()
-
-