Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to .NET 8 #418

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
dotnet-version: '6.0'
dotnet-version: '8.0'

- name: Build
run: dotnet build /WarnAsError
Expand All @@ -31,20 +31,20 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
runtime: [linux-x64, linux-musl-x64, linux-arm, linux-arm64, win-x64, win-x86, win-arm, win-arm64, osx-x64, osx-arm64]
runtime: [linux-x64, linux-musl-x64, linux-arm, linux-arm64, win-x64, win-x86, win-arm64, osx-x64, osx-arm64]
timeout-minutes: 30
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
dotnet-version: '6.0'
dotnet-version: '8.0'

- name: Build
run: dotnet build src/cyclonedx/cyclonedx.csproj -r ${{ matrix.runtime }}

# Fail if there are any failed tests
#
# We support .NET 6.0 on Windows, Mac and Linux.
# We support .NET 8.0 on Windows, Mac and Linux.
#
# To check for failing tests locally run `dotnet test`.
test:
Expand All @@ -61,7 +61,7 @@ jobs:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
dotnet-version: '6.0'
dotnet-version: '8.0'

- name: SnapshooterHotfixSymlinkLinux
if: matrix.os == 'ubuntu-latest'
Expand All @@ -75,4 +75,4 @@ jobs:
- name: Tests
run: |
dotnet restore
dotnet test --framework net6.0
dotnet test --framework net8.0
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
dotnet-version: '6.0'
dotnet-version: '8.0'
- name: SnapshooterHotfixSymlinkLinux
run: sudo ln -s "$GITHUB_WORKSPACE" /_
shell: bash
Expand All @@ -54,7 +54,7 @@ jobs:
REPO=cyclonedx/cyclonedx-cli
dotnet build --configuration Release
mkdir bin
for runtime in linux-x64 linux-musl-x64 linux-arm linux-arm64 win-x64 win-x86 win-arm win-arm64 osx-x64
for runtime in linux-x64 linux-musl-x64 linux-arm linux-arm64 win-x64 win-x86 win-arm64 osx-x64
do
dotnet publish src/cyclonedx/cyclonedx.csproj -r $runtime --configuration Release /p:Version=$VERSION --self-contained true /p:PublishSingleFile=true /p:IncludeNativeLibrariesInSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true --output bin/$runtime
done
Expand Down Expand Up @@ -181,7 +181,7 @@ jobs:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
dotnet-version: '6.0'
dotnet-version: '8.0'

- name: Create binary
run: |
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ Officially supported builds are available for these platforms:
Community supported builds are available for these platforms:

- Windows x86 (win-x86)
- Windows ARM (win-arm)
- Windows ARM x64 (win-arm64)
- Linux ARM (linux-arm)
- Linux ARM x64 (linux-arm64)
Expand Down Expand Up @@ -388,7 +387,7 @@ Permission to modify and redistribute is granted under the terms of the Apache 2
Pull requests are welcome. But please read the
[CycloneDX contributing guidelines](https://github.com/CycloneDX/.github/blob/master/CONTRIBUTING.md) first.

To build and test the solution locally you should have .NET 6
To build and test the solution locally you should have .NET 8
installed. Standard commands like `dotnet build` and `dotnet test` work.

It is generally expected that pull requests will include relevant tests.
Expand Down
2 changes: 1 addition & 1 deletion src/cyclonedx/Commands/KeyGenCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ internal static void Configure(RootCommand rootCommand)
public static async Task<int> KeyGen(KeyGenCommandOptions options)
{
Console.WriteLine("Generating new public/private key pair...");
using (RSA rsa = new RSACryptoServiceProvider(2048))
using (var rsa = new RSACryptoServiceProvider(2048))
{
var publicKeyFilename = string.IsNullOrEmpty(options.PublicKeyFile) ? "public.key" : options.PublicKeyFile;
Console.WriteLine($"Saving public key to {publicKeyFilename}");
Expand Down
6 changes: 3 additions & 3 deletions src/cyclonedx/Serialization/CsvSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static string Serialize(Bom bom)
csv.WriteField("SwidTextEncoding");
csv.WriteField("SwidTextContent");
csv.WriteField("SwidUrl");
var hashAlgorithms = Enum.GetValues(typeof(Hash.HashAlgorithm)).Cast<Hash.HashAlgorithm>();
var hashAlgorithms = Enum.GetValues(typeof(Hash.HashAlgorithm)).Cast<Hash.HashAlgorithm>().ToList();
foreach (var hashAlgorithm in hashAlgorithms)
{
if (hashAlgorithm != Hash.HashAlgorithm.Null)
Expand Down Expand Up @@ -221,7 +221,7 @@ public static Bom Deserialize(string csv)
if (!string.IsNullOrEmpty(hash.Content)) hashes.Add(hash);
}
}
if (hashes.Any()) component.Hashes = hashes;
if (hashes.Count != 0) component.Hashes = hashes;

var componentLicenses = new List<LicenseChoice>();
var licenseExpressions = csvReader.GetField("LicenseExpressions")?.Split(',');
Expand Down Expand Up @@ -261,7 +261,7 @@ public static Bom Deserialize(string csv)
}
});
}
if (componentLicenses.Any()) component.Licenses = componentLicenses;
if (componentLicenses.Count != 0) component.Licenses = componentLicenses;

bom.Components.Add(component);
}
Expand Down
4 changes: 2 additions & 2 deletions src/cyclonedx/cyclonedx.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<!-- <PublishTrimmed>true</PublishTrimmed>-->
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
<RuntimeIdentifiers>linux-x64;linux-musl-x64;linux-arm;linux-arm64;win-x64;win-x86;win-arm;win-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers>linux-x64;linux-musl-x64;linux-arm;linux-arm64;win-x64;win-x86;win-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
</PropertyGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion tests/cyclonedx.tests/cyclonedx.tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<!-- <AnalysisMode>AllEnabledByDefault</AnalysisMode> -->
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Loading