From b9af507cae732db2666f8aece19a21d084c92b9a Mon Sep 17 00:00:00 2001 From: William Godbe Date: Mon, 22 Mar 2021 20:16:34 -0700 Subject: [PATCH 1/6] Update nuget/msbuild versions --- eng/Versions.props | 6 +-- eng/tools/RepoTasks/RepoTasks.csproj | 2 +- .../test/GetOpenApiReferenceMetadataTest.cs | 54 +++++++++---------- .../test/MetadataSerializerTest.cs | 8 +-- 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index bb103b3f284f..5420c2fbff23 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -210,11 +210,11 @@ 3.1.1-preview4.19614.4 1.0.0 - 15.8.166 + 16.9.0 1.2.0 - 15.8.166 + 16.9.0 1.2.6 - 15.8.166 + 16.9.0 3.8.0 3.8.0 3.8.0 diff --git a/eng/tools/RepoTasks/RepoTasks.csproj b/eng/tools/RepoTasks/RepoTasks.csproj index 3895d24b071a..dde3165107ee 100644 --- a/eng/tools/RepoTasks/RepoTasks.csproj +++ b/eng/tools/RepoTasks/RepoTasks.csproj @@ -13,7 +13,7 @@ - + 2.1.1 2.2.0 From 594060ef5471ce2130975928fcef06152852a773 Mon Sep 17 00:00:00 2001 From: Will Godbe Date: Fri, 2 Apr 2021 13:30:25 -0700 Subject: [PATCH 3/6] Nuget only --- eng/Versions.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 26988f606929..7c5e7b8859ad 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -210,11 +210,11 @@ 3.1.1-preview4.19614.4 1.0.0 - 16.9.0 + 15.8.166 1.2.0 - 16.9.0 + 15.8.166 1.2.6 - 16.9.0 + 15.8.166 3.8.0 3.8.0 3.8.0 From a679991aa214e265e5ace69b8a74520e8f5e035a Mon Sep 17 00:00:00 2001 From: Will Godbe Date: Fri, 2 Apr 2021 14:05:02 -0700 Subject: [PATCH 4/6] Fix baseline, update to 5.8.1 --- eng/Baseline.Designer.props | 52 +++++++++---------- .../BaselineGenerator.csproj | 2 +- eng/tools/BaselineGenerator/Program.cs | 4 +- 3 files changed, 28 insertions(+), 30 deletions(-) diff --git a/eng/Baseline.Designer.props b/eng/Baseline.Designer.props index 60779e1f16b7..00cdc1685bc3 100644 --- a/eng/Baseline.Designer.props +++ b/eng/Baseline.Designer.props @@ -153,7 +153,7 @@ - + @@ -167,7 +167,7 @@ 5.0.4 - + @@ -190,7 +190,7 @@ 5.0.4 - + @@ -198,14 +198,14 @@ 5.0.4 - + 5.0.4 - + @@ -216,7 +216,7 @@ 5.0.4 - + @@ -232,7 +232,7 @@ 5.0.4 - + @@ -243,7 +243,7 @@ 5.0.4 - + @@ -263,7 +263,7 @@ - + @@ -284,7 +284,7 @@ - + @@ -310,7 +310,7 @@ - + @@ -345,7 +345,7 @@ - + @@ -417,7 +417,7 @@ - + @@ -432,7 +432,7 @@ - + @@ -444,7 +444,7 @@ 5.0.4 - + @@ -592,7 +592,7 @@ - + @@ -608,7 +608,7 @@ - + @@ -677,7 +677,7 @@ 5.0.4 - + @@ -725,7 +725,7 @@ - + @@ -756,7 +756,7 @@ - + @@ -772,7 +772,7 @@ 5.0.4 - + @@ -788,7 +788,7 @@ - + @@ -808,7 +808,7 @@ - + @@ -832,7 +832,7 @@ - + @@ -878,7 +878,7 @@ - + @@ -891,7 +891,7 @@ 5.0.4 - + diff --git a/eng/tools/BaselineGenerator/BaselineGenerator.csproj b/eng/tools/BaselineGenerator/BaselineGenerator.csproj index 775e7523c847..21528646afba 100644 --- a/eng/tools/BaselineGenerator/BaselineGenerator.csproj +++ b/eng/tools/BaselineGenerator/BaselineGenerator.csproj @@ -7,7 +7,7 @@ - + diff --git a/eng/tools/BaselineGenerator/Program.cs b/eng/tools/BaselineGenerator/Program.cs index cd8c41d39468..e18791792179 100644 --- a/eng/tools/BaselineGenerator/Program.cs +++ b/eng/tools/BaselineGenerator/Program.cs @@ -91,11 +91,9 @@ private async Task Run() var baselineVersion = input.Root.Attribute("Version").Value; // Baseline and .NET Core versions always align in non-preview releases. - // But, NuspecReader reports netcoreapp5.0 instead of net5.0. We use net5.0 in Baseline.Designer.props. var parsedVersion = Version.Parse(baselineVersion); var defaultTarget = ((parsedVersion.Major < 5) ? "netcoreapp" : "net") + $"{parsedVersion.Major}.{parsedVersion.Minor}"; - var matchTarget = $"netcoreapp{parsedVersion.Major}.{parsedVersion.Minor}"; var doc = new XDocument( new XComment(" Auto generated. Do not edit manually, use eng/tools/BaselineGenerator/ to recreate. "), @@ -154,7 +152,7 @@ private async Task Run() var targetCondition = $"'$(TargetFramework)' == '{group.TargetFramework.GetShortFolderName()}'"; if (string.Equals( group.TargetFramework.GetShortFolderName(), - matchTarget, + defaultTarget, StringComparison.OrdinalIgnoreCase)) { targetCondition = From c86c90e8c88873e7691d96d918c4e9de6e6d750c Mon Sep 17 00:00:00 2001 From: Will Godbe Date: Fri, 2 Apr 2021 16:04:59 -0700 Subject: [PATCH 5/6] Undo test change --- .../test/GetOpenApiReferenceMetadataTest.cs | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/Tools/Extensions.ApiDescription.Client/test/GetOpenApiReferenceMetadataTest.cs b/src/Tools/Extensions.ApiDescription.Client/test/GetOpenApiReferenceMetadataTest.cs index b642d43ab255..3602ea1c56cb 100644 --- a/src/Tools/Extensions.ApiDescription.Client/test/GetOpenApiReferenceMetadataTest.cs +++ b/src/Tools/Extensions.ApiDescription.Client/test/GetOpenApiReferenceMetadataTest.cs @@ -37,9 +37,9 @@ public void Execute_AddsExpectedMetadata() { "OutputPath", outputPath }, { "SerializedMetadata", - $"Identity={identity}|FirstForGenerator=true|" + - $"CodeGenerator=NSwagCSharp|OutputPath={outputPath}|Namespace={@namespace}|" + - $"OriginalItemSpec={identity}|ClassName=NSwagClient" + $"Identity={identity}|CodeGenerator=NSwagCSharp|" + + $"OriginalItemSpec={identity}|FirstForGenerator=true|" + + $"OutputPath={outputPath}|ClassName=NSwagClient|Namespace={@namespace}" }, }; @@ -95,9 +95,9 @@ public void Execute_DoesNotOverrideClassName() { "OutputPath", outputPath }, { "SerializedMetadata", - $"Identity={identity}|FirstForGenerator=true|" + - $"CodeGenerator=NSwagCSharp|OutputPath={outputPath}|Namespace={@namespace}|" + - $"OriginalItemSpec={identity}|ClassName={className}" + $"Identity={identity}|CodeGenerator=NSwagCSharp|" + + $"ClassName={className}|OriginalItemSpec={identity}|FirstForGenerator=true|" + + $"OutputPath={outputPath}|Namespace={@namespace}" }, }; @@ -153,9 +153,9 @@ public void Execute_DoesNotOverrideNamespace() { "OutputPath", outputPath }, { "SerializedMetadata", - $"Identity={identity}|FirstForGenerator=true|" + - $"CodeGenerator=NSwagCSharp|OutputPath={outputPath}|Namespace={@namespace}|" + - $"OriginalItemSpec={identity}|ClassName=NSwagClient" + $"Identity={identity}|CodeGenerator=NSwagCSharp|" + + $"Namespace={@namespace}|OriginalItemSpec={identity}|FirstForGenerator=true|" + + $"OutputPath={outputPath}|ClassName=NSwagClient" }, }; @@ -211,9 +211,9 @@ public void Execute_DoesNotOverrideOutputPath_IfRooted() { "OutputPath", outputPath }, { "SerializedMetadata", - $"Identity={identity}|FirstForGenerator=true|" + - $"CodeGenerator=NSwagCSharp|OutputPath={outputPath}|Namespace={@namespace}|" + - $"OriginalItemSpec={identity}|ClassName={className}" + $"Identity={identity}|CodeGenerator=NSwagCSharp|" + + $"OutputPath={outputPath}|OriginalItemSpec={identity}|FirstForGenerator=true|" + + $"ClassName={className}|Namespace={@namespace}" }, }; @@ -361,9 +361,9 @@ public void Execute_SetsClassName_BasedOnOutputPath() { "OutputPath", expectedOutputPath }, { "SerializedMetadata", - $"Identity={identity}|FirstForGenerator=true|" + - $"CodeGenerator=NSwagCSharp|OutputPath={expectedOutputPath}|Namespace={@namespace}|" + - $"OriginalItemSpec={identity}|ClassName={className}" + $"Identity={identity}|CodeGenerator=NSwagCSharp|" + + $"OutputPath={expectedOutputPath}|OriginalItemSpec={identity}|FirstForGenerator=true|" + + $"ClassName={className}|Namespace={@namespace}" }, }; @@ -424,9 +424,9 @@ public void Execute_SetsClassName_BasedOnSanitizedOutputPath(string outputPath, { "OutputPath", expectedOutputPath }, { "SerializedMetadata", - $"Identity={identity}|FirstForGenerator=true|" + - $"CodeGenerator=NSwagCSharp|OutputPath={expectedOutputPath}|Namespace={@namespace}|" + - $"OriginalItemSpec={identity}|ClassName={className}" + $"Identity={identity}|CodeGenerator=NSwagCSharp|" + + $"OutputPath={expectedOutputPath}|OriginalItemSpec={identity}|FirstForGenerator=true|" + + $"ClassName={className}|Namespace={@namespace}" }, }; @@ -491,9 +491,9 @@ public void Execute_SetsFirstForGenerator_UsesCorrectExtension() { "OutputPath", outputPath1 }, { "SerializedMetadata", - $"Identity={identity12}|FirstForGenerator=true|" + - $"CodeGenerator={codeGenerator13}|OutputPath={outputPath1}|Namespace={@namespace}|" + - $"OriginalItemSpec={identity12}|ClassName={className12}" + $"Identity={identity12}|CodeGenerator={codeGenerator13}|" + + $"OriginalItemSpec={identity12}|FirstForGenerator=true|" + + $"OutputPath={outputPath1}|ClassName={className12}|Namespace={@namespace}" }, }; var expectedMetadata2 = new SortedDictionary(StringComparer.Ordinal) @@ -506,9 +506,9 @@ public void Execute_SetsFirstForGenerator_UsesCorrectExtension() { "OutputPath", outputPath2 }, { "SerializedMetadata", - $"Identity={identity12}|FirstForGenerator=true|" + - $"CodeGenerator={codeGenerator2}|OutputPath={outputPath2}|Namespace={@namespace}|" + - $"OriginalItemSpec={identity12}|ClassName={className12}" + $"Identity={identity12}|CodeGenerator={codeGenerator2}|" + + $"OriginalItemSpec={identity12}|FirstForGenerator=true|" + + $"OutputPath={outputPath2}|ClassName={className12}|Namespace={@namespace}" }, }; var expectedMetadata3 = new SortedDictionary(StringComparer.Ordinal) @@ -521,9 +521,9 @@ public void Execute_SetsFirstForGenerator_UsesCorrectExtension() { "OutputPath", outputPath3 }, { "SerializedMetadata", - $"Identity={identity3}|FirstForGenerator=false|" + - $"CodeGenerator={codeGenerator13}|OutputPath={outputPath3}|Namespace={@namespace}|" + - $"OriginalItemSpec={identity3}|ClassName={className3}" + $"Identity={identity3}|CodeGenerator={codeGenerator13}|" + + $"OriginalItemSpec={identity3}|FirstForGenerator=false|" + + $"OutputPath={outputPath3}|ClassName={className3}|Namespace={@namespace}" }, }; From 1af0a05c6abeccaf69698682e59fbb2c487ed2f1 Mon Sep 17 00:00:00 2001 From: William Godbe Date: Fri, 2 Apr 2021 16:08:49 -0700 Subject: [PATCH 6/6] Update MetadataSerializerTest.cs --- .../test/MetadataSerializerTest.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Tools/Extensions.ApiDescription.Client/test/MetadataSerializerTest.cs b/src/Tools/Extensions.ApiDescription.Client/test/MetadataSerializerTest.cs index 47d8303cfbc2..adc889ccacc9 100644 --- a/src/Tools/Extensions.ApiDescription.Client/test/MetadataSerializerTest.cs +++ b/src/Tools/Extensions.ApiDescription.Client/test/MetadataSerializerTest.cs @@ -185,10 +185,10 @@ public void SerializeMetadata_ReturnsExpectedString() }; var input = new TaskItem(identity, metadata); - var expectedResult = $"Identity={identity}|FirstForGenerator=true|" + - "Options=|CodeGenerator=NSwagCSharp|" + - "OutputPath=C:\\dd\\dnx\\AspNetCore\\artifacts\\obj\\ConsoleClient\\azureMonitorClient.cs|" + - "Namespace=ConsoleClient|OriginalItemSpec=../files/azureMonitor.json|ClassName=azureMonitorClient"; + var expectedResult = $"Identity={identity}|ClassName=azureMonitorClient|" + + "CodeGenerator=NSwagCSharp|FirstForGenerator=true|Namespace=ConsoleClient|" + + "Options=|OriginalItemSpec=../files/azureMonitor.json|" + + "OutputPath=C:\\dd\\dnx\\AspNetCore\\artifacts\\obj\\ConsoleClient\\azureMonitorClient.cs"; // Act var result = MetadataSerializer.SerializeMetadata(input);