From ebda8bfd1a0180226ecae93eb825b6490632d855 Mon Sep 17 00:00:00 2001 From: Austin Shoemaker Date: Wed, 17 Aug 2022 15:32:03 -0500 Subject: [PATCH] Provide the unique proejct name to the -target flag when doing an msbuild -target:{unique project name} --- src/Microsoft.Tye.Core/MsBuild/ProjectInSolution.cs | 2 +- src/Microsoft.Tye.Hosting/BuildWatcher.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.Tye.Core/MsBuild/ProjectInSolution.cs b/src/Microsoft.Tye.Core/MsBuild/ProjectInSolution.cs index 1d3dd4122..e36d0f8c1 100644 --- a/src/Microsoft.Tye.Core/MsBuild/ProjectInSolution.cs +++ b/src/Microsoft.Tye.Core/MsBuild/ProjectInSolution.cs @@ -375,7 +375,7 @@ internal bool CanBeMSBuildProjectFile(out string errorMessage) /// /// Find the unique name for this project, e.g. SolutionFolder\SubSolutionFolder\Project_Name /// - internal string GetUniqueProjectName() + public string GetUniqueProjectName() { if (_uniqueProjectName == null) { diff --git a/src/Microsoft.Tye.Hosting/BuildWatcher.cs b/src/Microsoft.Tye.Hosting/BuildWatcher.cs index efae0d57a..00c5e3614 100644 --- a/src/Microsoft.Tye.Hosting/BuildWatcher.cs +++ b/src/Microsoft.Tye.Hosting/BuildWatcher.cs @@ -110,13 +110,13 @@ private async Task ResetAsync() } } - private static string GetProjectName(SolutionFile solution, string projectFile) + private static string GetUniqueProjectName(SolutionFile solution, string projectFile) { foreach (var project in solution.ProjectsInOrder) { if (project.AbsolutePath == projectFile) { - return project.ProjectName; + return project.GetUniqueProjectName(); } } @@ -205,7 +205,7 @@ async Task WithRequestCompletion(IEnumerable requests, Func GetProjectName(solution!, key))); + var targets = String.Join(",", solutionBatch.Keys.Select(key => GetUniqueProjectName(solution!, key))); tasks.Add( WithRequestCompletion(