Created
August 29, 2017 01:32
-
-
Save bchavez/2b1fa005d3363c7d1e9c83ea5a8d2ee0 to your computer and use it in GitHub Desktop.
Scans corefx repo for all csproj files and extracts pertinent information for creating a master .SLN file.
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 characters
var csprojs = Directory.GetFiles(".", @"*.csproj", SearchOption.AllDirectories) | |
.Where(projFile => !projFile.Contains(@"\ref\")) | |
.Select(projFile => new { name = Path.GetFileNameWithoutExtension(projFile), file = projFile, guid = GetProjectGuid(projFile) }) | |
.Where( p => p.guid.IsNotNullOrWhiteSpace() ); | |
foreach (var project in csprojs) | |
{ | |
$@"Project(""{{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}}"") = ""{project.name}"", ""{project.file}"", ""{project.guid}""".Dump(); | |
} | |
string GetProjectGuid(string projFile) | |
{ | |
var data = File.ReadAllText(projFile); | |
return data.GetBetween("<ProjectGuid>", "</ProjectGuid>"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment