Skip to content

Commit 954fdcd

Browse files
Backflow from https://github.com/dotnet/dotnet / e9f665e build 278626
[[ commit created by automation ]]
1 parent 69bd343 commit 954fdcd

File tree

10 files changed

+72
-58
lines changed

10 files changed

+72
-58
lines changed

NuGet.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
<!-- Begin: Package sources from dotnet-aspire -->
77
<!-- End: Package sources from dotnet-aspire -->
88
<!-- Begin: Package sources from dotnet-runtime -->
9+
<add key="darc-int-dotnet-runtime-aae90fa" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-runtime-aae90fa0/nuget/v3/index.json" />
10+
<add key="darc-int-dotnet-runtime-aae90fa-2" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-runtime-aae90fa0-2/nuget/v3/index.json" />
11+
<add key="darc-int-dotnet-runtime-aae90fa-1" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-runtime-aae90fa0-1/nuget/v3/index.json" />
912
<!-- End: Package sources from dotnet-runtime -->
1013
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
1114
<add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
@@ -37,6 +40,9 @@
3740
<clear />
3841
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
3942
<!-- Begin: Package sources from dotnet-runtime -->
43+
<add key="darc-int-dotnet-runtime-aae90fa-1" value="true" />
44+
<add key="darc-int-dotnet-runtime-aae90fa-2" value="true" />
45+
<add key="darc-int-dotnet-runtime-aae90fa" value="true" />
4046
<!-- End: Package sources from dotnet-runtime -->
4147
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
4248
</disabledPackageSources>

src/Cli/dotnet/Commands/Run/CSharpCompilerCommand.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,6 @@ private void PrepareAuxiliaryFiles(out string rspPath)
210210
build_property.EnableSingleFileAnalyzer = true
211211
build_property.EnableTrimAnalyzer = true
212212
build_property.IncludeAllContentForSelfExtract =
213-
build_property.VerifyReferenceTrimCompatibility =
214-
build_property.VerifyReferenceAotCompatibility =
215213
build_property.TargetFramework = net{TargetFrameworkVersion}
216214
build_property.TargetFrameworkIdentifier = .NETCoreApp
217215
build_property.TargetFrameworkVersion = v{TargetFrameworkVersion}

test/Microsoft.NET.Build.Tests/ArtifactsOutputPathTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ public void ItCanBuildWithMicrosoftBuildArtifactsSdk()
532532

533533
}
534534

535-
[Fact(Skip = "https://github.com/dotnet/sdk/issues/50140")]
535+
[Fact]
536536
public void PublishingRegistersWrittenFilesForProperCleanup()
537537
{
538538
var testProject = new TestProject()
@@ -580,7 +580,7 @@ public void PublishingRegistersWrittenFilesForProperCleanup()
580580
LocateAndRunApp(publishDir);
581581

582582
// now build the app in Release configuration.
583-
// not self-contained, so that we are forced to clean up the runtime
583+
// now self-contained, so that we are forced to clean up the runtime
584584
// files that were published.
585585
new DotnetBuildCommand(Log)
586586
.WithWorkingDirectory(projectDir)

test/Microsoft.NET.Build.Tests/GivenThatWeWantToControlGeneratedAssemblyInfo.cs

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,19 @@ public void It_respects_opt_outs(string attributeToOptOut)
5050
.Should()
5151
.Pass();
5252

53-
var expectedInfo = new HashSet<(string Key, string Value)>
54-
{
55-
("AssemblyInformationalVersionAttribute", "1.2.3-beta"),
56-
("AssemblyFileVersionAttribute", "4.5.6.7"),
57-
("AssemblyVersionAttribute", "8.9.10.11"),
58-
("AssemblyCompanyAttribute", "TestCompany"),
59-
("AssemblyConfigurationAttribute", "Release"),
60-
("AssemblyCopyrightAttribute", "TestCopyright"),
61-
("AssemblyDescriptionAttribute", "TestDescription"),
62-
("AssemblyProductAttribute", "TestProduct"),
63-
("AssemblyTitleAttribute", "TestTitle"),
64-
("AssemblyTrademarkAttribute", "TestTrademark"),
65-
("NeutralResourcesLanguageAttribute", "fr"),
53+
var expectedInfo = new SortedDictionary<string, string>
54+
{
55+
{ "AssemblyInformationalVersionAttribute", "1.2.3-beta" },
56+
{ "AssemblyFileVersionAttribute", "4.5.6.7" },
57+
{ "AssemblyVersionAttribute", "8.9.10.11" },
58+
{ "AssemblyCompanyAttribute", "TestCompany" },
59+
{ "AssemblyConfigurationAttribute", "Release" },
60+
{ "AssemblyCopyrightAttribute", "TestCopyright" },
61+
{ "AssemblyDescriptionAttribute", "TestDescription" },
62+
{ "AssemblyProductAttribute", "TestProduct" },
63+
{ "AssemblyTitleAttribute", "TestTitle" },
64+
{ "AssemblyTrademarkAttribute", "TestTrademark" },
65+
{ "NeutralResourcesLanguageAttribute", "fr" },
6666
};
6767

6868
if (attributeToOptOut == "All")
@@ -71,15 +71,15 @@ public void It_respects_opt_outs(string attributeToOptOut)
7171
}
7272
else
7373
{
74-
expectedInfo.RemoveWhere(i => i.Key == attributeToOptOut);
74+
expectedInfo.Remove(attributeToOptOut);
7575
}
7676

77-
expectedInfo.Add(("TargetFrameworkAttribute", $".NETCoreApp,Version=v{ToolsetInfo.CurrentTargetFrameworkVersion}"));
77+
expectedInfo.Add("TargetFrameworkAttribute", $".NETCoreApp,Version=v{ToolsetInfo.CurrentTargetFrameworkVersion}");
7878

7979
var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory(ToolsetInfo.CurrentTargetFramework, "Release").FullName, "HelloWorld.dll");
8080
var actualInfo = AssemblyInfo.Get(assemblyPath);
8181

82-
actualInfo.Should().BeEquivalentTo(expectedInfo);
82+
actualInfo.Should().Equal(expectedInfo);
8383
}
8484

8585
[Fact]
@@ -235,7 +235,7 @@ public void It_includes_source_revision_id_if_available__version_with_plus()
235235
command.GetValues().Should().BeEquivalentTo(new[] { "1.2.3+abc.xyz" });
236236
}
237237

238-
[Theory]
238+
[WindowsOnlyTheory]
239239
[InlineData(ToolsetInfo.CurrentTargetFramework)]
240240
[InlineData("net45")]
241241
public void It_respects_version_prefix(string targetFramework)
@@ -258,9 +258,9 @@ public void It_respects_version_prefix(string targetFramework)
258258
var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory(targetFramework).FullName, "HelloWorld.dll");
259259
var info = AssemblyInfo.Get(assemblyPath);
260260

261-
info.Should().Contain(("AssemblyVersionAttribute", "1.2.3.0"));
262-
info.Should().Contain(("AssemblyFileVersionAttribute", "1.2.3.0"));
263-
info.Should().Contain(("AssemblyInformationalVersionAttribute", "1.2.3"));
261+
info["AssemblyVersionAttribute"].Should().Be("1.2.3.0");
262+
info["AssemblyFileVersionAttribute"].Should().Be("1.2.3.0");
263+
info["AssemblyInformationalVersionAttribute"].Should().Be("1.2.3");
264264
}
265265

266266
[WindowsOnlyTheory]
@@ -285,7 +285,7 @@ public void It_respects_version_changes_on_incremental_build(string targetFramew
285285
// Then the version of the built assembly shall match the provided VersionPrefix
286286
var assemblyPath = Path.Combine(incrementalBuildCommand.GetOutputDirectory(targetFramework).FullName, "HelloWorld.dll");
287287
var info = AssemblyInfo.Get(assemblyPath);
288-
info.Should().Contain(("AssemblyVersionAttribute", "1.2.4.0"));
288+
info["AssemblyVersionAttribute"].Should().Be("1.2.4.0");
289289

290290
BuildCommand BuildProject(string versionPrefix)
291291
{
@@ -307,7 +307,7 @@ public void It_respects_custom_assembly_attribute_items_on_incremental_build()
307307

308308
var firstBuildCommand = BuildProject(buildNumber: "1");
309309
var assemblyPath = Path.Combine(firstBuildCommand.GetOutputDirectory(targetFramework).FullName, "TestLibrary.dll");
310-
AssemblyInfo.Get(assemblyPath).Should().Contain(("AssemblyMetadataAttribute", "BuildNumber:1"));
310+
AssemblyInfo.Get(assemblyPath)["AssemblyMetadataAttribute"].Should().Be("BuildNumber:1");
311311

312312
var firstWriteTime = File.GetLastWriteTimeUtc(assemblyPath);
313313

@@ -324,7 +324,7 @@ public void It_respects_custom_assembly_attribute_items_on_incremental_build()
324324
File.GetLastWriteTimeUtc(assemblyPath).Should().NotBe(firstWriteTime);
325325

326326
// and the custom assembly should be generated with the updated value.
327-
AssemblyInfo.Get(assemblyPath).Should().Contain(("AssemblyMetadataAttribute", "BuildNumber:2"));
327+
AssemblyInfo.Get(assemblyPath)["AssemblyMetadataAttribute"].Should().Be("BuildNumber:2");
328328

329329
BuildCommand BuildProject(string buildNumber)
330330
{
@@ -358,7 +358,7 @@ public void It_includes_internals_visible_to()
358358

359359
var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory("netstandard2.0").FullName, "HelloWorld.dll");
360360

361-
AssemblyInfo.Get(assemblyPath).Should().Contain(("InternalsVisibleToAttribute", "Tests"));
361+
AssemblyInfo.Get(assemblyPath)["InternalsVisibleToAttribute"].Should().Be("Tests");
362362
}
363363

364364
[RequiresMSBuildVersionTheory("17.0.0.32901")]
@@ -552,7 +552,7 @@ public void It_respects_out_out_of_internals_visible_to()
552552

553553
var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory("netstandard2.0").FullName, "HelloWorld.dll");
554554

555-
AssemblyInfo.Get(assemblyPath).Should().NotContain(i => i.Key == "InternalsVisibleToAttribute");
555+
Assert.False(AssemblyInfo.Get(assemblyPath).ContainsKey("InternalsVisibleToAttribute"));
556556
}
557557

558558
[Fact]
@@ -578,7 +578,7 @@ public void It_includes_internals_visible_to_with_key()
578578

579579
var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory("netstandard2.0").FullName, "HelloWorld.dll");
580580

581-
AssemblyInfo.Get(assemblyPath).Should().Contain(("InternalsVisibleToAttribute", "Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001001d3e6bbb36e11ea61ceff6e1022b23dd779fc6230838db2d25a2c7c8433b3fcf86b16c25b281fc3db1027c0675395e7d0548e6add88b6a811962bf958101fa9e243b1618313bee11f5e3b3fefda7b1d1226311b6cc2d07e87ff893ba6890b20082df34a0aac14b605b8be055e81081a626f8c69e9ed4bbaa4eae9f94a35accd2"));
581+
AssemblyInfo.Get(assemblyPath)["InternalsVisibleToAttribute"].Should().Be("Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001001d3e6bbb36e11ea61ceff6e1022b23dd779fc6230838db2d25a2c7c8433b3fcf86b16c25b281fc3db1027c0675395e7d0548e6add88b6a811962bf958101fa9e243b1618313bee11f5e3b3fefda7b1d1226311b6cc2d07e87ff893ba6890b20082df34a0aac14b605b8be055e81081a626f8c69e9ed4bbaa4eae9f94a35accd2");
582582
}
583583

584584
[Fact]
@@ -605,7 +605,7 @@ public void It_includes_internals_visible_to_with_project_publickey()
605605

606606
var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory("netstandard2.0").FullName, "HelloWorld.dll");
607607

608-
AssemblyInfo.Get(assemblyPath).Should().Contain(("InternalsVisibleToAttribute", "Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001001d3e6bbb36e11ea61ceff6e1022b23dd779fc6230838db2d25a2c7c8433b3fcf86b16c25b281fc3db1027c0675395e7d0548e6add88b6a811962bf958101fa9e243b1618313bee11f5e3b3fefda7b1d1226311b6cc2d07e87ff893ba6890b20082df34a0aac14b605b8be055e81081a626f8c69e9ed4bbaa4eae9f94a35accd2"));
608+
AssemblyInfo.Get(assemblyPath)["InternalsVisibleToAttribute"].Should().Be("Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001001d3e6bbb36e11ea61ceff6e1022b23dd779fc6230838db2d25a2c7c8433b3fcf86b16c25b281fc3db1027c0675395e7d0548e6add88b6a811962bf958101fa9e243b1618313bee11f5e3b3fefda7b1d1226311b6cc2d07e87ff893ba6890b20082df34a0aac14b605b8be055e81081a626f8c69e9ed4bbaa4eae9f94a35accd2");
609609
}
610610

611611
[Fact]
@@ -631,11 +631,11 @@ public void It_includes_assembly_metadata()
631631

632632
var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory("netstandard2.0").FullName, "HelloWorld.dll");
633633

634-
AssemblyInfo.Get(assemblyPath).Should().Contain(("AssemblyMetadataAttribute", "MetadataKey:MetadataValue"));
634+
AssemblyInfo.Get(assemblyPath)["AssemblyMetadataAttribute"].Should().Be("MetadataKey:MetadataValue");
635635
}
636636

637637
[Fact]
638-
public void It_respects_opt_out_of_assembly_metadata()
638+
public void It_respects_out_out_of_assembly_metadata()
639639
{
640640
var testAsset = _testAssetsManager
641641
.CopyTestAsset("HelloWorld")
@@ -659,7 +659,7 @@ public void It_respects_opt_out_of_assembly_metadata()
659659

660660
var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory("netstandard2.0").FullName, "HelloWorld.dll");
661661

662-
AssemblyInfo.Get(assemblyPath).Should().NotContain(i => i.Key == "AssemblyMetadataAttribute");
662+
Assert.False(AssemblyInfo.Get(assemblyPath).ContainsKey("AssemblyMetadataAttribute"));
663663
}
664664

665665
[Theory]
@@ -699,11 +699,11 @@ public void GenerateUserSecrets(bool referenceAspNetCore, bool referenceExtensio
699699

700700
if (shouldHaveAttribute)
701701
{
702-
AssemblyInfo.Get(assemblyPath).Should().Contain(("UserSecretsIdAttribute", "SecretsIdValue"));
702+
AssemblyInfo.Get(assemblyPath)["UserSecretsIdAttribute"].Should().Be("SecretsIdValue");
703703
}
704704
else
705705
{
706-
AssemblyInfo.Get(assemblyPath).Should().NotContain(i => i.Key == "SecretsIdValue");
706+
AssemblyInfo.Get(assemblyPath).Should().NotContainKey("SecretsIdValue");
707707
}
708708
}
709709

@@ -743,7 +743,7 @@ public void GenerateUserSecretsForTestProject()
743743

744744
var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory(testTestProject.TargetFrameworks).FullName, testTestProject.Name + ".dll");
745745

746-
AssemblyInfo.Get(assemblyPath).Should().Contain(("UserSecretsIdAttribute", "SecretsIdValue"));
746+
AssemblyInfo.Get(assemblyPath)["UserSecretsIdAttribute"].Should().Be("SecretsIdValue");
747747
}
748748

749749
[Theory]
@@ -775,7 +775,7 @@ public void It_includes_repository_url(bool privateRepo)
775775

776776
var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory(testProject.TargetFrameworks).FullName, testProject.Name + ".dll");
777777

778-
AssemblyInfo.Get(assemblyPath).Should().Contain(("AssemblyMetadataAttribute", "RepositoryUrl:" + fakeUrl));
778+
AssemblyInfo.Get(assemblyPath)["AssemblyMetadataAttribute"].Should().Be("RepositoryUrl:" + fakeUrl);
779779
}
780780

781781
[Theory]
@@ -804,11 +804,11 @@ public void It_does_not_write_to_undefined_assembly_metadata_attribute(string ta
804804

805805
if (containsAttribute)
806806
{
807-
AssemblyInfo.Get(assemblyPath).Should().Contain(("AssemblyMetadataAttribute", "RepositoryUrl:" + fakeUrl));
807+
AssemblyInfo.Get(assemblyPath)["AssemblyMetadataAttribute"].Should().Be("RepositoryUrl:" + fakeUrl);
808808
}
809809
else
810810
{
811-
AssemblyInfo.Get(assemblyPath).Should().NotContain(i => i.Key == "AssemblyMetadataAttribute");
811+
AssemblyInfo.Get(assemblyPath).ContainsKey("AssemblyMetadataAttribute").Should().Be(false);
812812
}
813813
}
814814

test/Microsoft.NET.Build.Tests/GivenThatWeWantToVerifyNuGetReferenceCompat.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ public void Nuget_reference_compat(string referencerTarget, string testDescripti
4141

4242
// Process all dependencies in parallel
4343
Parallel.ForEach(
44-
rawDependencyTargets.Split(',', ';', ' ').Where(s => !string.IsNullOrWhiteSpace(s)),
44+
rawDependencyTargets.Split(',', ';', ' ').Where(s => !string.IsNullOrWhiteSpace(s)),
4545
new ParallelOptions { MaxDegreeOfParallelism = Environment.ProcessorCount },
46-
dependencyTarget =>
46+
dependencyTarget =>
4747
{
4848
// Create the dependency project and package
4949
TestProject dependencyProject = GetTestProject(
50-
ConstantStringValues.DependencyDirectoryNamePrefix + dependencyTarget.Replace('.', '_'),
51-
dependencyTarget,
50+
ConstantStringValues.DependencyDirectoryNamePrefix + dependencyTarget.Replace('.', '_'),
51+
dependencyTarget,
5252
true);
53-
53+
5454
TestPackageReference dependencyPackageReference = new(
5555
dependencyProject.Name,
5656
"1.0.0",
@@ -208,7 +208,7 @@ public void It_chooses_lowest_netfx_in_default_atf()
208208
buildCommand.Execute().Should().Pass();
209209

210210
var referencedDll = buildCommand.GetOutputDirectory().File("net462_net472_pkg.dll").FullName;
211-
var referencedTargetFramework = AssemblyInfo.Get(referencedDll).Where(i => i.Key == "TargetFrameworkAttribute").Single().Value;
211+
var referencedTargetFramework = AssemblyInfo.Get(referencedDll)["TargetFrameworkAttribute"];
212212
referencedTargetFramework.Should().Be(".NETFramework,Version=v4.6.2");
213213
}
214214

test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ public void IsAotCompatible_implies_enable_analyzers(string targetFramework)
593593
var assemblyPath = Path.Combine(outputDirectory, $"{projectName}.dll");
594594

595595
// injects the IsTrimmable attribute
596-
AssemblyInfo.Get(assemblyPath).Should().Contain(("AssemblyMetadataAttribute", "IsTrimmable:True"));
596+
AssemblyInfo.Get(assemblyPath)["AssemblyMetadataAttribute"].Should().Be("IsTrimmable:True");
597597

598598
var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name));
599599
publishCommand

0 commit comments

Comments
 (0)