Skip to content

Commit c2e4e88

Browse files
committed
Fully generated ReferenceInfo
1 parent 7a285ce commit c2e4e88

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

Basic.Reference.Assemblies/ReferenceInfo.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// This is a generated file, please edit Generate\Program.cs to change the contents
12
using Microsoft.CodeAnalysis;
23
using System;
34

@@ -16,15 +17,15 @@ public ReferenceInfo(string fileName, byte[] imageBytes, PortableExecutableRefer
1617
Reference = reference;
1718
Mvid = mvid;
1819
}
19-
20+
2021
public void Deconstruct(out string fileName, out byte[] imageBytes, out PortableExecutableReference reference, out Guid mvid)
2122
{
2223
fileName = FileName;
2324
imageBytes = ImageBytes;
2425
reference = Reference;
2526
mvid = Mvid;
2627
}
27-
28+
2829
public (string FileName, byte[] ImageBytes, PortableExecutableReference Reference, Guid Mvid) AsTuple() =>
2930
(FileName, ImageBytes, Reference, Mvid);
3031
}

Generate/Program.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
NetStandard20();
2626
Net461();
2727
Net472();
28+
CombinedReferenceInfo();
2829

2930
void NetCoreApp31()
3031
{
@@ -152,6 +153,22 @@ public void Deconstruct(out string fileName, out byte[] imageBytes, out Portable
152153
}
153154
""";
154155

156+
void CombinedReferenceInfo()
157+
{
158+
var content = $$"""
159+
// This is a generated file, please edit Generate\Program.cs to change the contents
160+
using Microsoft.CodeAnalysis;
161+
using System;
162+
163+
namespace Basic.Reference.Assemblies
164+
{
165+
{{GetReferenceInfoIndented(" ")}}
166+
}
167+
""";
168+
169+
File.WriteAllText(Path.Combine(combinedDir, "ReferenceInfo.cs"), content, encoding);
170+
}
171+
155172
string GetWorkspacePath(string[] args)
156173
{
157174
var dir = Environment.CurrentDirectory;

0 commit comments

Comments
 (0)