Skip to content

Commit 570a1d7

Browse files
committed
Add links metadata to generated projects
1 parent 989c209 commit 570a1d7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/SourceBrowser/src/BinLogToSln/Program.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ static void Main(string[] args)
152152
string repoRelativePath = Path.GetRelativePath(repoRoot, filePath);
153153
string projectRelativePath;
154154
string outputFile;
155+
string link = null;
155156
if (repoRelativePath.StartsWith("..\\") || repoRelativePath.StartsWith("../") || Path.IsPathRooted(repoRelativePath))
156157
{
157158
string externalPath = Path.Join("_external", idx++.ToString(), Path.GetFileName(filePath));
@@ -162,9 +163,13 @@ static void Main(string[] args)
162163
else
163164
{
164165
projectRelativePath = Path.GetRelativePath(invocation.ProjectDirectory, filePath);
166+
if (projectRelativePath.StartsWith(".."))
167+
{
168+
link = repoRelativePath;
169+
}
165170
outputFile = Path.Join(output, "src", repoRelativePath);
166171
}
167-
project.WriteLine($" <Compile Include=\"{projectRelativePath}\"/>");
172+
project.WriteLine($" <Compile Include=\"{projectRelativePath}\"{(link != null ? $" Link=\"{link}\"" : "")}/>");
168173
Directory.CreateDirectory(Path.GetDirectoryName(outputFile));
169174
if (!File.Exists(outputFile))
170175
{

0 commit comments

Comments
 (0)