Skip to content

Commit be5e620

Browse files
committed
tuple support in net461
1 parent 5bcaa26 commit be5e620

File tree

4 files changed

+39
-1
lines changed

4 files changed

+39
-1
lines changed

Src/Basic.Reference.Assemblies.Net461/Basic.Reference.Assemblies.Net461.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<ItemGroup>
99
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net461" Version="1.0.3" IncludeAssets="none" PrivateAssets="all" GeneratePathProperty="true" />
1010
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" IncludeAssets="none" PrivateAssets="all" GeneratePathProperty="true" />
11+
<PackageReference Include="System.ValueTuple" Version="4.5.0" IncludeAssets="none" PrivateAssets="all" GeneratePathProperty="true" />
1112
</ItemGroup>
1213

1314
<Import Project="Generated.targets" />

Src/Basic.Reference.Assemblies.Net461/Generated.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4476,6 +4476,11 @@ public static class ExtraReferenceInfos
44764476
/// The <see cref="ReferenceInfo"/> for System.Threading.Tasks.Extensions.dll
44774477
/// </summary>
44784478
public static ReferenceInfo SystemThreadingTasksExtensions => new ReferenceInfo("System.Threading.Tasks.Extensions.dll", Resources.SystemThreadingTasksExtensions, Net461.ExtraReferences.SystemThreadingTasksExtensions, global::System.Guid.Parse("bc890e4e-a34f-463c-8fd9-60f43c8beb88"));
4479+
4480+
/// <summary>
4481+
/// The <see cref="ReferenceInfo"/> for System.ValueTuple.dll
4482+
/// </summary>
4483+
public static ReferenceInfo SystemValueTuple => new ReferenceInfo("System.ValueTuple.dll", Resources.SystemValueTuple, Net461.ExtraReferences.SystemValueTuple, global::System.Guid.Parse("1aa5ee86-d143-43bd-94ec-c0749ff98222"));
44794484
private static ImmutableArray<ReferenceInfo> _all;
44804485
public static ImmutableArray<ReferenceInfo> All
44814486
{
@@ -4486,6 +4491,7 @@ public static ImmutableArray<ReferenceInfo> All
44864491
_all =
44874492
[
44884493
SystemThreadingTasksExtensions,
4494+
SystemValueTuple,
44894495
];
44904496
}
44914497
return _all;
@@ -4517,6 +4523,23 @@ public static PortableExecutableReference SystemThreadingTasksExtensions
45174523
}
45184524
}
45194525

4526+
private static PortableExecutableReference? _SystemValueTuple;
4527+
4528+
/// <summary>
4529+
/// The <see cref="PortableExecutableReference"/> for System.ValueTuple.dll
4530+
/// </summary>
4531+
public static PortableExecutableReference SystemValueTuple
4532+
{
4533+
get
4534+
{
4535+
if (_SystemValueTuple is null)
4536+
{
4537+
_SystemValueTuple = AssemblyMetadata.CreateFromImage(Resources.SystemValueTuple).GetReference(filePath: "System.ValueTuple.dll", display: "System.ValueTuple (net461)");
4538+
}
4539+
return _SystemValueTuple;
4540+
}
4541+
}
4542+
45204543
private static ImmutableArray<PortableExecutableReference> _all;
45214544
public static ImmutableArray<PortableExecutableReference> All
45224545
{
@@ -4527,6 +4550,7 @@ public static ImmutableArray<PortableExecutableReference> All
45274550
_all =
45284551
[
45294552
SystemThreadingTasksExtensions,
4553+
SystemValueTuple,
45304554
];
45314555
}
45324556
return _all;
@@ -5649,6 +5673,12 @@ public static class Resources
56495673
public static byte[] SystemThreadingTasksExtensions => ResourceLoader.GetOrCreateResource(ref _SystemThreadingTasksExtensions, "net461.System.Threading.Tasks.Extensions");
56505674
private static byte[]? _SystemThreadingTasksExtensions;
56515675

5676+
/// <summary>
5677+
/// The image bytes for System.ValueTuple.dll
5678+
/// </summary>
5679+
public static byte[] SystemValueTuple => ResourceLoader.GetOrCreateResource(ref _SystemValueTuple, "net461.System.ValueTuple");
5680+
private static byte[]? _SystemValueTuple;
5681+
56525682

56535683
}
56545684
}

Src/Basic.Reference.Assemblies.Net461/Generated.targets

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,5 +740,9 @@
740740
<LogicalName>net461.System.Threading.Tasks.Extensions</LogicalName>
741741
<Link>Resources\net461\System.Threading.Tasks.Extensions.dll</Link>
742742
</EmbeddedResource>
743+
<EmbeddedResource Include="$(NuGetPackageRoot)\system.valuetuple\4.5.0\lib\net461\System.ValueTuple.dll" WithCulture="false">
744+
<LogicalName>net461.System.ValueTuple</LogicalName>
745+
<Link>Resources\net461\System.ValueTuple.dll</Link>
746+
</EmbeddedResource>
743747
</ItemGroup>
744748
</Project>

Src/Generate/Program.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,10 @@ void Net461()
166166
var content = GetGeneratedContent(
167167
"Net461",
168168
[@"microsoft.netframework.referenceassemblies.net461\1.0.3\build\.NETFramework\v4.6.1"],
169-
[@"system.threading.tasks.extensions\4.5.4\lib\net461"]);
169+
[
170+
@"system.threading.tasks.extensions\4.5.4\lib\net461",
171+
@"system.valuetuple\4.5.0\lib\net461"
172+
]);
170173
var targetDir = Path.Combine(srcPath, "Basic.Reference.Assemblies.Net461");
171174
File.WriteAllText(Path.Combine(targetDir, "Generated.cs"), content.CodeContent, encoding);
172175
File.WriteAllText(Path.Combine(targetDir, "Generated.targets"), content.TargetsContent, encoding);

0 commit comments

Comments
 (0)