From 911c932156242546540f87b6f4a1ffc65ab1cfca Mon Sep 17 00:00:00 2001 From: joncloud Date: Sat, 1 Aug 2020 19:22:29 -0700 Subject: [PATCH 1/6] Upgrades to .NET 5.0 --- README.md | 2 +- azure-pipelines.yml | 6 ++++++ global.json | 5 +++++ src/https/https.csproj | 4 ++-- tests/https.Tests/https.Tests.csproj | 6 +++--- 5 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 global.json diff --git a/README.md b/README.md index 239220c..9c8d3de 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Released under the MIT License. See the [LICENSE][] File for further details. ## Installation Install `https` as a global .NET tool using ```bash -dotnet tool install --global https --version 0.2.0-* +dotnet tool install --global https --version 0.3.0-* ``` ## Usage diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1fd91f2..eda07a8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -11,6 +11,12 @@ variables: shouldPublish: $[eq(variables['Build.SourceBranch'], 'refs/heads/publish')] steps: +- task: UseDotNet@2 + displayName: Use .NET (global.json) + inputs: + packageType: 'sdk' + useGlobalJson: true + - task: DotNetCoreCLI@2 displayName: Pack https condition: eq(variables.shouldPublish, true) diff --git a/global.json b/global.json new file mode 100644 index 0000000..f4ee6c0 --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "5.*" + } +} \ No newline at end of file diff --git a/src/https/https.csproj b/src/https/https.csproj index 6dc70ac..92a7b2d 100644 --- a/src/https/https.csproj +++ b/src/https/https.csproj @@ -2,12 +2,12 @@ Exe - netcoreapp3.1 + net5.0 preview - 0.2.0 + 0.3.0 diff --git a/tests/https.Tests/https.Tests.csproj b/tests/https.Tests/https.Tests.csproj index 261f038..a1d99d5 100644 --- a/tests/https.Tests/https.Tests.csproj +++ b/tests/https.Tests/https.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net5.0 false Https.Tests preview @@ -17,8 +17,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all From 00b3da149bb3cd7574cf6e94fed187a124a8e7b5 Mon Sep 17 00:00:00 2001 From: joncloud Date: Sat, 1 Aug 2020 19:25:53 -0700 Subject: [PATCH 2/6] Sets static version --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index f4ee6c0..2a023e8 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "5.*" + "version": "5.0.100-preview.7.20366.6" } } \ No newline at end of file From e9d330d7cfc8cf86fc7197def8688a130444da99 Mon Sep 17 00:00:00 2001 From: joncloud Date: Tue, 10 Nov 2020 09:07:09 -0800 Subject: [PATCH 3/6] Bumps to stable --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 2a023e8..1be13b5 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "5.0.100-preview.7.20366.6" + "version": "5.0.0" } } \ No newline at end of file From 2ef9db9da73bb3779f99bcfa6ff2d10811757b00 Mon Sep 17 00:00:00 2001 From: joncloud Date: Tue, 10 Nov 2020 09:09:10 -0800 Subject: [PATCH 4/6] Upgrades to stable versions --- tests/https.Tests/https.Tests.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/https.Tests/https.Tests.csproj b/tests/https.Tests/https.Tests.csproj index a1d99d5..d94fd49 100644 --- a/tests/https.Tests/https.Tests.csproj +++ b/tests/https.Tests/https.Tests.csproj @@ -17,8 +17,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all From 52c3c92b5e6a7d782f94d1ad7f744bacda80f779 Mon Sep 17 00:00:00 2001 From: joncloud Date: Tue, 10 Nov 2020 09:10:20 -0800 Subject: [PATCH 5/6] Corrected version number --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 1be13b5..2cb2ac9 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "5.0.0" + "version": "5.0.100" } } \ No newline at end of file From 9f2dfa25767ab61b05ac5fa468327824e44e5e3c Mon Sep 17 00:00:00 2001 From: joncloud Date: Tue, 10 Nov 2020 09:23:51 -0800 Subject: [PATCH 6/6] Fixes tests to share WebHostFixture --- tests/https.Tests/CertificateTests.cs | 3 ++- tests/https.Tests/ContentTypeTests.cs | 3 ++- tests/https.Tests/RedirectTests.cs | 3 ++- tests/https.Tests/WebHostFixture.cs | 4 ++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/https.Tests/CertificateTests.cs b/tests/https.Tests/CertificateTests.cs index 966c0bd..0b79c26 100644 --- a/tests/https.Tests/CertificateTests.cs +++ b/tests/https.Tests/CertificateTests.cs @@ -4,7 +4,8 @@ namespace Https.Tests { - public class CertificateTests : IClassFixture + [Collection(nameof(WebHostFixture))] + public class CertificateTests { readonly WebHostFixture _fixture; public CertificateTests(WebHostFixture fixture) => diff --git a/tests/https.Tests/ContentTypeTests.cs b/tests/https.Tests/ContentTypeTests.cs index 906d3e1..e2d2488 100644 --- a/tests/https.Tests/ContentTypeTests.cs +++ b/tests/https.Tests/ContentTypeTests.cs @@ -5,7 +5,8 @@ namespace Https.Tests { - public class ContentTypeTests : IClassFixture + [Collection(nameof(WebHostFixture))] + public class ContentTypeTests { readonly WebHostFixture _fixture; public ContentTypeTests(WebHostFixture fixture) => diff --git a/tests/https.Tests/RedirectTests.cs b/tests/https.Tests/RedirectTests.cs index ad5d005..98959e0 100644 --- a/tests/https.Tests/RedirectTests.cs +++ b/tests/https.Tests/RedirectTests.cs @@ -3,7 +3,8 @@ namespace Https.Tests { - public class RedirectTests : IClassFixture + [Collection(nameof(WebHostFixture))] + public class RedirectTests { readonly WebHostFixture _fixture; public RedirectTests(WebHostFixture fixture) => diff --git a/tests/https.Tests/WebHostFixture.cs b/tests/https.Tests/WebHostFixture.cs index 067690d..6954139 100644 --- a/tests/https.Tests/WebHostFixture.cs +++ b/tests/https.Tests/WebHostFixture.cs @@ -3,9 +3,13 @@ using System; using System.Threading; using System.Threading.Tasks; +using Xunit; namespace Https.Tests { + [CollectionDefinition(nameof(WebHostFixture))] + public class WebHostCollection : ICollectionFixture { } + public class WebHostFixture : IDisposable { readonly IWebHost _webHost;