From a10ba83751cab0af7dc1d2a032959f5ae84824f1 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Mon, 18 Sep 2017 10:33:48 -0700 Subject: [PATCH] Add /t:UpdateRepoLineups which will automatically update the build/dependencies.targets file with appropriate versions --- build/repo.targets | 12 +++++++++++- build/tasks/AnalyzeBuildGraph.cs | 2 ++ build/tasks/GenerateLineup.cs | 11 ++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/build/repo.targets b/build/repo.targets index ad0354952e..7d105c3107 100644 --- a/build/repo.targets +++ b/build/repo.targets @@ -154,11 +154,21 @@ Solutions="@(Solution)" Artifacts="@(ArtifactInfo)" ShippedArtifacts="@(ShippedArtifactInfo)" + StartGraphAt="$(BuildGraphOf)" Properties="Configuration=$(Configuration);BuildNumber=$(BuildNumber)"> + + + + @@ -166,7 +176,7 @@ diff --git a/build/tasks/AnalyzeBuildGraph.cs b/build/tasks/AnalyzeBuildGraph.cs index 49d8eed87d..ebfe3ea108 100644 --- a/build/tasks/AnalyzeBuildGraph.cs +++ b/build/tasks/AnalyzeBuildGraph.cs @@ -38,6 +38,8 @@ namespace RepoTasks [Required] public string Properties { get; set; } + public string StartGraphAt { get; set; } + /// /// The order in which to build repositories /// diff --git a/build/tasks/GenerateLineup.cs b/build/tasks/GenerateLineup.cs index e2baf809de..544284e409 100644 --- a/build/tasks/GenerateLineup.cs +++ b/build/tasks/GenerateLineup.cs @@ -22,6 +22,9 @@ namespace RepoTasks [Required] public string OutputPath { get; set; } + // Can be set to filter the lists of packages when produce a list for a specific repository + public string Repository { get; set; } + public bool UseFloatingVersions { get; set; } public string BuildNumber { get; set; } @@ -48,7 +51,12 @@ namespace RepoTasks switch (info) { case ArtifactInfo.Package pkg when (!pkg.IsSymbolsArtifact): - packages.Add(pkg.PackageInfo); + // TODO filter this list based on topological sort info + if (string.IsNullOrEmpty(Repository) + || !Repository.Equals(pkg.RepoName, StringComparison.OrdinalIgnoreCase)) + { + packages.Add(pkg.PackageInfo); + } break; } } @@ -77,6 +85,7 @@ namespace RepoTasks }; using (var writer = XmlWriter.Create(OutputPath, settings)) { + Log.LogMessage(MessageImportance.High, $"Generate {OutputPath}"); doc.Save(writer); } return true;