From a2c0410e39a05bf646d1a042ec2284af37847b1b Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Thu, 17 Aug 2017 16:15:42 -0700 Subject: [PATCH] Use PackageLineup to manage package versions --- appveyor.yml => .appveyor.yml | 0 Directory.Build.props | 14 +++++++++++ Directory.Build.targets | 14 +++++++++++ JsonPatch.sln | 25 ++++++++++++++++++- build/common.props | 24 ------------------ build/dependencies.props | 14 ----------- build/repo.props | 6 +++++ src/Directory.Build.props | 7 ++++++ .../Microsoft.AspNetCore.JsonPatch.csproj | 7 +++--- test/Directory.Build.props | 11 ++++++++ .../DictionaryAdapterTest.cs | 14 +++++------ ...Microsoft.AspNetCore.JsonPatch.Test.csproj | 9 ++----- .../ObjectAdapterTests.cs | 8 +++--- 13 files changed, 92 insertions(+), 61 deletions(-) rename appveyor.yml => .appveyor.yml (100%) create mode 100644 Directory.Build.props create mode 100644 Directory.Build.targets delete mode 100644 build/common.props delete mode 100644 build/dependencies.props create mode 100644 build/repo.props create mode 100644 src/Directory.Build.props create mode 100644 test/Directory.Build.props diff --git a/appveyor.yml b/.appveyor.yml similarity index 100% rename from appveyor.yml rename to .appveyor.yml diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000000..57d9ef7e6a --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,14 @@ + + + + + Microsoft ASP.NET Core + https://github.com/aspnet/JsonPatch + git + $(MSBuildThisFileDirectory)build\Key.snk + true + true + $(VersionSuffix)-$(BuildNumber) + true + + diff --git a/Directory.Build.targets b/Directory.Build.targets new file mode 100644 index 0000000000..9989b1046b --- /dev/null +++ b/Directory.Build.targets @@ -0,0 +1,14 @@ + + + + <_BootstrapperFile Condition=" $([MSBuild]::IsOSUnixLike()) ">build.sh + <_BootstrapperFile Condition="! $([MSBuild]::IsOSUnixLike()) ">build.cmd + <_BootstrapperError> + Package references have not been pinned. Run './$(_BootstrapperFile) /t:Pin'. + Also, you can run './$(_BootstrapperFile) /t:Restore' which will pin *and* restore packages. '$(_BootstrapperFile)' can be found in '$(MSBuildThisFileDirectory)'. + + + + + + diff --git a/JsonPatch.sln b/JsonPatch.sln index b75721a487..87b48a8ea1 100644 --- a/JsonPatch.sln +++ b/JsonPatch.sln @@ -1,10 +1,16 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26222.1 +VisualStudioVersion = 15.0.26815.3 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{430B59ED-F960-4D3A-8FFE-3370008E168D}" + ProjectSection(SolutionItems) = preProject + src\Directory.Build.props = src\Directory.Build.props + EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{36CD6341-AB44-44EB-B3AA-BF98C89FECDD}" + ProjectSection(SolutionItems) = preProject + test\Directory.Build.props = test\Directory.Build.props + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.JsonPatch", "src\Microsoft.AspNetCore.JsonPatch\Microsoft.AspNetCore.JsonPatch.csproj", "{4D55F4D8-633B-462F-A5B1-FEB84BD2D534}" EndProject @@ -12,7 +18,21 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.JsonPa EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C430C499-382D-47BD-B351-CF8F89C08CD2}" ProjectSection(SolutionItems) = preProject + .appveyor.yml = .appveyor.yml + .gitattributes = .gitattributes + .gitignore = .gitignore + .travis.yml = .travis.yml + build.cmd = build.cmd + build.ps1 = build.ps1 + build.sh = build.sh + CONTRIBUTING.md = CONTRIBUTING.md + Directory.Build.props = Directory.Build.props + Directory.Build.targets = Directory.Build.targets + LICENSE.txt = LICENSE.txt NuGet.config = NuGet.config + NuGetPackageVerifier.json = NuGetPackageVerifier.json + README.md = README.md + version.xml = version.xml EndProjectSection EndProject Global @@ -37,4 +57,7 @@ Global {4D55F4D8-633B-462F-A5B1-FEB84BD2D534} = {430B59ED-F960-4D3A-8FFE-3370008E168D} {81C20848-E063-4E12-AC40-0B55A532C16C} = {36CD6341-AB44-44EB-B3AA-BF98C89FECDD} EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {9FFA3EB9-8740-4434-BC8C-F3D595161B59} + EndGlobalSection EndGlobal diff --git a/build/common.props b/build/common.props deleted file mode 100644 index b749c350f1..0000000000 --- a/build/common.props +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - Microsoft ASP.NET Core - https://github.com/aspnet/JsonPatch - git - $(MSBuildThisFileDirectory)Key.snk - true - true - $(VersionSuffix)-$(BuildNumber) - true - - - - - - - - - - - diff --git a/build/dependencies.props b/build/dependencies.props deleted file mode 100644 index f2fb071ace..0000000000 --- a/build/dependencies.props +++ /dev/null @@ -1,14 +0,0 @@ - - - 2.1.0-* - 4.4.0-* - 2.1.1-* - 10.0.1 - 4.7.49 - 2.0.0-* - 2.0.0-* - 2.0.0-* - 15.3.0-* - 2.3.0-beta2-* - - diff --git a/build/repo.props b/build/repo.props new file mode 100644 index 0000000000..c5d91e8a2c --- /dev/null +++ b/build/repo.props @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 0000000000..5236edee58 --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/Microsoft.AspNetCore.JsonPatch/Microsoft.AspNetCore.JsonPatch.csproj b/src/Microsoft.AspNetCore.JsonPatch/Microsoft.AspNetCore.JsonPatch.csproj index e9732e8621..a364de22ef 100644 --- a/src/Microsoft.AspNetCore.JsonPatch/Microsoft.AspNetCore.JsonPatch.csproj +++ b/src/Microsoft.AspNetCore.JsonPatch/Microsoft.AspNetCore.JsonPatch.csproj @@ -1,5 +1,4 @@ - ASP.NET Core support for JSON PATCH. @@ -10,9 +9,9 @@ - - - + + + diff --git a/test/Directory.Build.props b/test/Directory.Build.props new file mode 100644 index 0000000000..31ed7dd07c --- /dev/null +++ b/test/Directory.Build.props @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/test/Microsoft.AspNetCore.JsonPatch.Test/DictionaryAdapterTest.cs b/test/Microsoft.AspNetCore.JsonPatch.Test/DictionaryAdapterTest.cs index 6a88bd6cc7..bc50b872a2 100644 --- a/test/Microsoft.AspNetCore.JsonPatch.Test/DictionaryAdapterTest.cs +++ b/test/Microsoft.AspNetCore.JsonPatch.Test/DictionaryAdapterTest.cs @@ -28,7 +28,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Internal // Assert Assert.True(addStatus); Assert.True(string.IsNullOrEmpty(message), "Expected no error message"); - Assert.Equal(1, dictionary.Count); + Assert.Single(dictionary); Assert.Equal("James", dictionary[nameKey]); } @@ -48,7 +48,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Internal // Assert Assert.True(addStatus); Assert.True(string.IsNullOrEmpty(message), "Expected no error message"); - Assert.Equal(1, dictionary.Count); + Assert.Single(dictionary); Assert.Equal("James", dictionary[nameKey]); // Act @@ -77,7 +77,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Internal // Assert Assert.True(addStatus); Assert.True(string.IsNullOrEmpty(message), "Expected no error message"); - Assert.Equal(1, dictionary.Count); + Assert.Single(dictionary); Assert.Equal("James", dictionary[nameKey]); // Act @@ -107,7 +107,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Internal // Assert Assert.True(replaceStatus); Assert.True(string.IsNullOrEmpty(message), "Expected no error message"); - Assert.Equal(1, dictionary.Count); + Assert.Single(dictionary); Assert.Equal("James", dictionary[nameKey]); } @@ -129,7 +129,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Internal Assert.Equal( string.Format("The target location specified by path segment '{0}' was not found.", nameKey), message); - Assert.Equal(0, dictionary.Count); + Assert.Empty(dictionary); } [Fact] @@ -150,7 +150,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Internal Assert.Equal( string.Format("The target location specified by path segment '{0}' was not found.", nameKey), message); - Assert.Equal(0, dictionary.Count); + Assert.Empty(dictionary); } [Fact] @@ -170,7 +170,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Internal //Assert Assert.True(removeStatus); Assert.True(string.IsNullOrEmpty(message), "Expected no error message"); - Assert.Equal(0, dictionary.Count); + Assert.Empty(dictionary); } } } diff --git a/test/Microsoft.AspNetCore.JsonPatch.Test/Microsoft.AspNetCore.JsonPatch.Test.csproj b/test/Microsoft.AspNetCore.JsonPatch.Test/Microsoft.AspNetCore.JsonPatch.Test.csproj index f5b8c8268a..2e4f68b538 100644 --- a/test/Microsoft.AspNetCore.JsonPatch.Test/Microsoft.AspNetCore.JsonPatch.Test.csproj +++ b/test/Microsoft.AspNetCore.JsonPatch.Test/Microsoft.AspNetCore.JsonPatch.Test.csproj @@ -1,7 +1,5 @@  - - netcoreapp2.0;net461 netcoreapp2.0 @@ -12,11 +10,8 @@ - - - - - + + diff --git a/test/Microsoft.AspNetCore.JsonPatch.Test/ObjectAdapterTests.cs b/test/Microsoft.AspNetCore.JsonPatch.Test/ObjectAdapterTests.cs index 56b25d22be..34a8c97b67 100644 --- a/test/Microsoft.AspNetCore.JsonPatch.Test/ObjectAdapterTests.cs +++ b/test/Microsoft.AspNetCore.JsonPatch.Test/ObjectAdapterTests.cs @@ -720,8 +720,8 @@ namespace Microsoft.AspNetCore.JsonPatch.Adapters var serialized = JsonConvert.SerializeObject(patchDoc); // Assert - Assert.False(serialized.Contains("operations")); - Assert.False(serialized.Contains("Operations")); + Assert.DoesNotContain("operations", serialized); + Assert.DoesNotContain("Operations", serialized); } [Fact] @@ -2061,7 +2061,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Adapters patchDoc.ApplyTo(model); // Assert - Assert.Equal(1, model.Count); + Assert.Single(model); Assert.Equal(expected, model["WA"]); } @@ -2080,7 +2080,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Adapters deserialized.ApplyTo(model); // Assert - Assert.Equal(1, model.Count); + Assert.Single(model); Assert.Equal(expected, model["WA"]); }