-
-
Save Insire/c0043bd02a069c735a56fac7cbbac0b0 to your computer and use it in GitHub Desktop.
Revisions
-
Cryental revised this gist
Feb 8, 2020 . 1 changed file with 1 addition and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,10 +20,5 @@ private static string[] PrintResultItems(BuildResult result, string targetName) var buildResult = result.ResultsByTarget[targetName]; var buildResultItems = buildResult.Items; return buildResultItems.Length == 0 ? new string[0] { } : buildResultItems.Select(item => item.ItemSpec).ToArray(); } -
Cryental revised this gist
Feb 8, 2020 . 1 changed file with 1 addition and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,11 +25,5 @@ private static string[] PrintResultItems(BuildResult result, string targetName) return new string[0] { }; } return buildResultItems.Select(item => item.ItemSpec).ToArray(); } -
Cryental created this gist
Feb 8, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ private static List<string> GetAllReferences(string fullPath) { var logger = new ConsoleLogger(LoggerVerbosity.Quiet); var manager = BuildManager.DefaultBuildManager; var projectInstance = new ProjectInstance(fullPath); var result = manager.Build(new BuildParameters {DetailedSummary = false, Loggers = new List<ILogger> {logger}}, new BuildRequestData(projectInstance, new[] {"ResolveProjectReferences", "ResolveAssemblyReferences"})); var items1 = PrintResultItems(result, "ResolveProjectReferences"); var items2 = PrintResultItems(result, "ResolveAssemblyReferences"); var allItems = items1.ToList(); allItems.AddRange(items2); return allItems; } private static string[] PrintResultItems(BuildResult result, string targetName) { var buildResult = result.ResultsByTarget[targetName]; var buildResultItems = buildResult.Items; if (buildResultItems.Length == 0) { return new string[0] { }; } var items = new List<string>(); foreach (var item in buildResultItems) { items.Add(item.ItemSpec); } return items.ToArray(); }