diff --git a/build/repo.targets b/build/repo.targets index 53ada8ef18..63af8766c3 100644 --- a/build/repo.targets +++ b/build/repo.targets @@ -239,7 +239,6 @@ Artifacts="@(ArtifactInfo);@(ShippedArtifactInfo)" Repositories="@(Repository);@(ShippedRepository)" Dependencies="@(ExternalDependency)" - StartGraphAt="$(BuildGraphOf)" Properties="Configuration=$(Configuration);BuildNumber=$(BuildNumber);DotNetPackageVersionPropsPath=$(GeneratedPackageVersionPropsPath);DotNetRestoreSourcePropsPath=$(GeneratedRestoreSourcesPropsPath)"> diff --git a/build/tasks/AnalyzeBuildGraph.cs b/build/tasks/AnalyzeBuildGraph.cs index 7975908bae..fac4914f30 100644 --- a/build/tasks/AnalyzeBuildGraph.cs +++ b/build/tasks/AnalyzeBuildGraph.cs @@ -38,8 +38,6 @@ namespace RepoTasks [Required] public string Properties { get; set; } - public string StartGraphAt { get; set; } - /// /// The order in which to build repositories /// @@ -270,14 +268,13 @@ namespace RepoTasks return repo; }).ToList(); - var graph = GraphBuilder.Generate(repositories, StartGraphAt, Log); + var graph = GraphBuilder.Generate(repositories, Log); var repositoriesWithOrder = new List<(ITaskItem repository, int order)>(); foreach (var repository in repositories) { var graphNodeRepository = graph.FirstOrDefault(g => g.Repository.Name == repository.Name); if (graphNodeRepository == null) { - // StartGraphAt was specified so the graph is incomplete. continue; } diff --git a/build/tasks/BuildGraph/GraphBuilder.cs b/build/tasks/BuildGraph/GraphBuilder.cs index d70b1ba45d..355989f171 100644 --- a/build/tasks/BuildGraph/GraphBuilder.cs +++ b/build/tasks/BuildGraph/GraphBuilder.cs @@ -11,7 +11,7 @@ namespace RepoTools.BuildGraph { public static class GraphBuilder { - public static IList Generate(IList repositories, string root, TaskLoggingHelper log) + public static IList Generate(IList repositories, TaskLoggingHelper log) { // Build global list of primary projects var primaryProjects = repositories.SelectMany(c => c.Projects) @@ -19,15 +19,9 @@ namespace RepoTools.BuildGraph var graphNodes = repositories.Select(r => new GraphNode { Repository = r }) .ToDictionary(r => r.Repository); - GraphNode searchRoot = null; - foreach (var project in repositories.SelectMany(r => r.AllProjects)) { var thisProjectRepositoryNode = graphNodes[project.Repository]; - if (!string.IsNullOrEmpty(root) && string.Equals(root, project.Repository.Name, StringComparison.OrdinalIgnoreCase)) - { - searchRoot = thisProjectRepositoryNode; - } foreach (var packageDependency in project.PackageReferences) { @@ -50,25 +44,7 @@ namespace RepoTools.BuildGraph } } - var results = new HashSet(); - if (searchRoot != null) - { - Visit(results, searchRoot); - return results.ToList(); - } - return graphNodes.Values.ToList(); } - - private static void Visit(HashSet results, GraphNode searchRoot) - { - if (results.Add(searchRoot)) - { - foreach (var node in searchRoot.Outgoing) - { - Visit(results, node); - } - } - } } }