private ProjectDependencyGraph createDependencyGraph( ProjectSorter sorter, MavenExecutionRequest request ) throws MavenExecutionException { ProjectDependencyGraph graph = new DefaultProjectDependencyGraph( sorter ); List<MavenProject> activeProjects = sorter.getSortedProjects(); activeProjects = trimSelectedProjects( activeProjects, graph, request ); activeProjects = trimResumedProjects( activeProjects, request ); if ( activeProjects.size() != sorter.getSortedProjects().size() ) { graph = new FilteredProjectDependencyGraph( graph, activeProjects ); } return graph; }
/** * Creates a new project dependency graph based on the specified project sorting. * * @param sorter The project sorter backing the graph, must not be {@code null}. */ public DefaultProjectDependencyGraph( ProjectSorter sorter ) { if ( sorter == null ) { throw new IllegalArgumentException( "project sorter missing" ); } this.sorter = sorter; }
public List<MavenProject> getDownstreamProjects( MavenProject project, boolean transitive ) { if ( project == null ) { throw new IllegalArgumentException( "project missing" ); } Collection<String> projectIds = new HashSet<String>(); getDownstreamProjects( ProjectSorter.getId( project ), projectIds, transitive ); return getProjects( projectIds ); }
public List<MavenProject> getUpstreamProjects( MavenProject project, boolean transitive ) { if ( project == null ) { throw new IllegalArgumentException( "project missing" ); } Collection<String> projectIds = new HashSet<String>(); getUpstreamProjects( ProjectSorter.getId( project ), projectIds, transitive ); return getProjects( projectIds ); }
private List<MavenProject> getProjects( Collection<String> projectIds ) { List<MavenProject> projects = new ArrayList<MavenProject>(); for ( MavenProject p : sorter.getSortedProjects() ) { if ( projectIds.contains( ProjectSorter.getId( p ) ) ) { projects.add( p ); } } return projects; }
@Test public void blah() throws Exception { ArrayList projects = new ArrayList(); projects.add(new MavenProject()); new ProjectSorter(projects); }
public ReactorManager( List projects ) throws CycleDetectedException, DuplicateProjectException { this.sorter = new ProjectSorter( projects ); }