From 8a4b53a822b646ce729e824fd29f2048a24cbfd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Sharma?= Date: Sun, 9 Dec 2018 17:37:30 -0800 Subject: [PATCH] Migrate to ASP.NET Core 2.2 and .NET Core SDK v2.2.100 (#149) --- .azure/pipelines/ci-official.yml | 5 +++ Dockerfile | 4 +- src/BaGet.Azure/BaGet.Azure.csproj | 2 +- src/BaGet.Core/BaGet.Core.csproj | 4 +- .../BaGet.Tools.AzureSearchImporter.csproj | 10 ++--- src/BaGet.UI/package-lock.json | 38 +++++++++++++------ src/BaGet/BaGet.csproj | 17 +++++---- .../Extensions/ServiceCollectionExtensions.cs | 6 ++- .../BaGet.Core.Tests/BaGet.Core.Tests.csproj | 11 ++++-- .../BaGet.Protocol.Tests.csproj | 11 ++++-- tests/BaGet.Tests/BaGet.Tests.csproj | 18 ++++++--- 11 files changed, 82 insertions(+), 44 deletions(-) diff --git a/.azure/pipelines/ci-official.yml b/.azure/pipelines/ci-official.yml index 6c242ed0..b17beac5 100644 --- a/.azure/pipelines/ci-official.yml +++ b/.azure/pipelines/ci-official.yml @@ -18,6 +18,11 @@ jobs: pool: vmImage: vs2017-win2016 steps: + - task: DotNetCoreInstaller@0 + displayName: 'Use .NET Core SDK 2.2.100' + inputs: + version: 2.2.100 + - task: DotNetCoreCLI@2 displayName: Install versioning tool inputs: diff --git a/Dockerfile b/Dockerfile index a8ce521f..fae8efba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base +FROM microsoft/dotnet:2.2-aspnetcore-runtime AS base WORKDIR /app EXPOSE 80 -FROM microsoft/dotnet:2.1-sdk AS build +FROM microsoft/dotnet:2.2-sdk AS build WORKDIR /src COPY /src . RUN dotnet restore BaGet diff --git a/src/BaGet.Azure/BaGet.Azure.csproj b/src/BaGet.Azure/BaGet.Azure.csproj index 803e06b4..f91f6e9c 100644 --- a/src/BaGet.Azure/BaGet.Azure.csproj +++ b/src/BaGet.Azure/BaGet.Azure.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/BaGet.Core/BaGet.Core.csproj b/src/BaGet.Core/BaGet.Core.csproj index 482912f8..4c441de7 100644 --- a/src/BaGet.Core/BaGet.Core.csproj +++ b/src/BaGet.Core/BaGet.Core.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/src/BaGet.Tools.AzureSearchImporter/BaGet.Tools.AzureSearchImporter.csproj b/src/BaGet.Tools.AzureSearchImporter/BaGet.Tools.AzureSearchImporter.csproj index cb6b83cf..15801d35 100644 --- a/src/BaGet.Tools.AzureSearchImporter/BaGet.Tools.AzureSearchImporter.csproj +++ b/src/BaGet.Tools.AzureSearchImporter/BaGet.Tools.AzureSearchImporter.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + netcoreapp2.2 false @@ -16,10 +16,10 @@ - - - - + + + + diff --git a/src/BaGet.UI/package-lock.json b/src/BaGet.UI/package-lock.json index ae7ce1cf..4169c684 100644 --- a/src/BaGet.UI/package-lock.json +++ b/src/BaGet.UI/package-lock.json @@ -3657,11 +3657,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3674,15 +3676,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -3785,7 +3790,8 @@ }, "inherits": { "version": "2.0.3", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -3795,6 +3801,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -3807,17 +3814,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -3834,6 +3844,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -3906,7 +3917,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -3916,6 +3928,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -4021,6 +4034,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -4757,7 +4771,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } } } @@ -10477,8 +10491,8 @@ "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz", "integrity": "sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==", "requires": { - "ajv": "6.5.5", - "ajv-keywords": "3.2.0" + "ajv": "^6.1.0", + "ajv-keywords": "^3.1.0" } }, "uglify-es": { @@ -10486,8 +10500,8 @@ "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", "requires": { - "commander": "2.13.0", - "source-map": "0.6.1" + "commander": "~2.13.0", + "source-map": "~0.6.1" } } } diff --git a/src/BaGet/BaGet.csproj b/src/BaGet/BaGet.csproj index be959660..ecfadf8a 100644 --- a/src/BaGet/BaGet.csproj +++ b/src/BaGet/BaGet.csproj @@ -1,20 +1,23 @@  - netcoreapp2.1 + netcoreapp2.2 ..\BaGet.UI\ $(DefaultItemExcludes);$(SpaRoot)node_modules\** + + + + - - - - - - + + + + + diff --git a/src/BaGet/Extensions/ServiceCollectionExtensions.cs b/src/BaGet/Extensions/ServiceCollectionExtensions.cs index 017e3d04..a135eb54 100644 --- a/src/BaGet/Extensions/ServiceCollectionExtensions.cs +++ b/src/BaGet/Extensions/ServiceCollectionExtensions.cs @@ -18,6 +18,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Cors.Infrastructure; using Microsoft.AspNetCore.HttpOverrides; +using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -113,7 +114,10 @@ public static IServiceCollection ConfigureAzure( public static IServiceCollection ConfigureHttpServices(this IServiceCollection services) { - services.AddMvc(); + services + .AddMvc() + .SetCompatibilityVersion(CompatibilityVersion.Version_2_2); + services.AddCors(); services.AddSingleton, ConfigureCorsOptions>(); diff --git a/tests/BaGet.Core.Tests/BaGet.Core.Tests.csproj b/tests/BaGet.Core.Tests/BaGet.Core.Tests.csproj index 6c683d37..118b67b1 100644 --- a/tests/BaGet.Core.Tests/BaGet.Core.Tests.csproj +++ b/tests/BaGet.Core.Tests/BaGet.Core.Tests.csproj @@ -1,17 +1,20 @@  - netcoreapp2.1 + netcoreapp2.2 7.1 false - + - - + + + all + runtime; build; native; contentfiles; analyzers + diff --git a/tests/BaGet.Protocol.Tests/BaGet.Protocol.Tests.csproj b/tests/BaGet.Protocol.Tests/BaGet.Protocol.Tests.csproj index f4dfe5e0..e8afc5e4 100644 --- a/tests/BaGet.Protocol.Tests/BaGet.Protocol.Tests.csproj +++ b/tests/BaGet.Protocol.Tests/BaGet.Protocol.Tests.csproj @@ -1,17 +1,20 @@  - netcoreapp2.1 + netcoreapp2.2 7.1 false - + - - + + + all + runtime; build; native; contentfiles; analyzers + diff --git a/tests/BaGet.Tests/BaGet.Tests.csproj b/tests/BaGet.Tests/BaGet.Tests.csproj index a905e1d5..db6eaf1e 100644 --- a/tests/BaGet.Tests/BaGet.Tests.csproj +++ b/tests/BaGet.Tests/BaGet.Tests.csproj @@ -1,20 +1,26 @@  - netcoreapp2.1 + netcoreapp2.2 7.1 false + + + + - - - - - + + + + + all + runtime; build; native; contentfiles; analyzers +