From 88384b7701f7202254e49e59baaf58e18d3a0a27 Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Thu, 9 Dec 2021 15:27:07 -0800 Subject: [PATCH] Target .NET Core 3.1 Changes include: - Update `global.json` to require at least .NET Core 3.1.300 (this version specifically is required for centrally managing NuGet packages - Update GitHub Actions to install .NET Core 3.1 - Update `README.md` to reflect the new requirements - Fully qualify a constructor in `PodComponent` - Add `morelinq` dependency to get `DistinctBy` Closes #18 --- .github/workflows/build-release.yml | 3 +-- .github/workflows/build.yml | 3 +-- .github/workflows/codeql-analysis.yml | 3 +-- .github/workflows/gen-docs.yml | 3 +-- .github/workflows/publish-release-snapshot.yml | 3 +-- .github/workflows/test-linux.yml | 3 +-- .github/workflows/verify-snapshot.yml | 3 +-- Directory.Build.props | 2 +- Directory.Packages.props | 1 + README.md | 3 +-- global.json | 3 +-- .../TypedComponent/PodComponent.cs | 2 +- .../Microsoft.ComponentDetection.Detectors.csproj | 1 + .../linux/LinuxScanner.cs | 1 + 14 files changed, 14 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index cd6ae8644..f0f8db774 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -26,8 +26,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.x - include-prerelease: true + dotnet-version: 3.1.x - name: dotnet restore run: dotnet restore diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2e0adf852..037676678 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,8 +20,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.x - include-prerelease: true + dotnet-version: 3.1.x - name: dotnet restore run: dotnet restore diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 0ec31c4aa..7956bc739 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -62,8 +62,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.x - include-prerelease: true + dotnet-version: 3.1.x - name: dotnet restore run: dotnet restore diff --git a/.github/workflows/gen-docs.yml b/.github/workflows/gen-docs.yml index 82d88a66e..a4a9b031e 100644 --- a/.github/workflows/gen-docs.yml +++ b/.github/workflows/gen-docs.yml @@ -18,8 +18,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.x - include-prerelease: true + dotnet-version: 3.1.x - name: Generate docs run: | diff --git a/.github/workflows/publish-release-snapshot.yml b/.github/workflows/publish-release-snapshot.yml index b628452f0..3fb6b6013 100644 --- a/.github/workflows/publish-release-snapshot.yml +++ b/.github/workflows/publish-release-snapshot.yml @@ -22,8 +22,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.x - include-prerelease: true + dotnet-version: 3.1.x - name: dotnet restore run: dotnet restore diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 9d74bc0b6..bf7f77afe 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -18,8 +18,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.x - include-prerelease: true + dotnet-version: 3.1.x - name: dotnet restore run: dotnet restore diff --git a/.github/workflows/verify-snapshot.yml b/.github/workflows/verify-snapshot.yml index f0143a613..56cf5289e 100644 --- a/.github/workflows/verify-snapshot.yml +++ b/.github/workflows/verify-snapshot.yml @@ -22,8 +22,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.x - include-prerelease: true + dotnet-version: 3.1.x - name: dotnet restore run: dotnet restore diff --git a/Directory.Build.props b/Directory.Build.props index a2c1a16b2..352dc82de 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - net6.0 + netcoreapp3.1 latest true true diff --git a/Directory.Packages.props b/Directory.Packages.props index 6049817f2..b396006e5 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -19,6 +19,7 @@ + diff --git a/README.md b/README.md index 4a62fae4f..406f1ac0e 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,7 @@ Component Detection is built with extensibility in mind! Please see our [CONTRIB # Building and running Component Detection -DotNet Core SDK 6.0.0-rc2 is currently in use, you can install it from https://dotnet.microsoft.com/download/dotnet/6.0 -We also use node and npm, you can install them from https://nodejs.org/en/download/ +.NET Core 3.1 is currently in use, you can install it from https://dotnet.microsoft.com/download/dotnet/3.1 The below commands mirror what we do to setup our CI environments: diff --git a/global.json b/global.json index d43ba408d..564cda4b7 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,6 @@ { "sdk": { - "version": "6.0.100-rc.2.21505.57", - "allowPrerelease": true, + "version": "3.1.300", "rollForward": "latestMinor" } } diff --git a/src/Microsoft.ComponentDetection.Contracts/TypedComponent/PodComponent.cs b/src/Microsoft.ComponentDetection.Contracts/TypedComponent/PodComponent.cs index a657fdf4d..ee958473c 100644 --- a/src/Microsoft.ComponentDetection.Contracts/TypedComponent/PodComponent.cs +++ b/src/Microsoft.ComponentDetection.Contracts/TypedComponent/PodComponent.cs @@ -37,7 +37,7 @@ public override PackageURL PackageUrl qualifiers.Add("repository_url", SpecRepo); } - return new ("cocoapods", null, Name, Version, qualifiers, null); + return new PackageURL("cocoapods", null, Name, Version, qualifiers, null); } } } diff --git a/src/Microsoft.ComponentDetection.Detectors/Microsoft.ComponentDetection.Detectors.csproj b/src/Microsoft.ComponentDetection.Detectors/Microsoft.ComponentDetection.Detectors.csproj index 911be7eea..1a27aefcf 100644 --- a/src/Microsoft.ComponentDetection.Detectors/Microsoft.ComponentDetection.Detectors.csproj +++ b/src/Microsoft.ComponentDetection.Detectors/Microsoft.ComponentDetection.Detectors.csproj @@ -2,6 +2,7 @@ + diff --git a/src/Microsoft.ComponentDetection.Detectors/linux/LinuxScanner.cs b/src/Microsoft.ComponentDetection.Detectors/linux/LinuxScanner.cs index 45b3c03ad..8d0544419 100644 --- a/src/Microsoft.ComponentDetection.Detectors/linux/LinuxScanner.cs +++ b/src/Microsoft.ComponentDetection.Detectors/linux/LinuxScanner.cs @@ -9,6 +9,7 @@ using Microsoft.ComponentDetection.Contracts.BcdeModels; using Microsoft.ComponentDetection.Contracts.TypedComponent; using Microsoft.ComponentDetection.Detectors.Linux.Contracts; +using MoreLinq.Extensions; using Newtonsoft.Json; namespace Microsoft.ComponentDetection.Detectors.Linux