Skip to content

Commit

Permalink
Merge branch 'v3' into refactorProgramClass
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsfoni authored Dec 14, 2023
2 parents fc76c9b + 291333d commit 75d2384
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Ubuntu22.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ RUN apt-get install -y --no-install-recommends wget=2.0.1
RUN apt-get install -y --no-install-recommends apt-transport-https=2.5.6
RUN curl -o ./packages-microsoft-prod.deb https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb
RUN dpkg -i packages-microsoft-prod.deb
RUN apt-get install -y --no-install-recommends dotnet-sdk-7.0=7.0
RUN apt-get install -y --no-install-recommends dotnet-sdk-8.0=8.0
RUN rm -rf /var/lib/apt/lists/*
8 changes: 6 additions & 2 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
7.x
8.x
- name: Build
run: dotnet build /WarnAsError

Expand All @@ -43,11 +43,15 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
framework: ['net6.0','net7.0']
framework: ['net6.0','net7.0', 'net8.0']
timeout-minutes: 30

steps:
- uses: actions/checkout@v4
- name: Setup dotnet 8
uses: actions/[email protected]
with:
dotnet-version: '8.x'
- name: Setup dotnet 7
uses: actions/setup-dotnet@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ jobs:
uses: actions/[email protected]
with:
dotnet-version: |
7.x
8.x
# The tests should have already been run during the PR workflow, so this is really just a sanity check
- name: Tests
run: dotnet test --framework net7.0
run: dotnet test --framework net8.0

# Build and package everything, including the Docker image
- name: Package release
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ SBOM/
.nuget/
.opencode-server/
TestResults/
/CycloneDX/Properties/launchSettings.json
CycloneDX/Properties/launchSettings.json
1 change: 1 addition & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ tasks:
"$DOTNET_ROOT/dotnet-install.sh" --channel 2.1 --install-dir "$DOTNET_ROOT"
"$DOTNET_ROOT/dotnet-install.sh" --channel 6.0 --install-dir "$DOTNET_ROOT"
"$DOTNET_ROOT/dotnet-install.sh" --channel 7.0 --install-dir "$DOTNET_ROOT"
"$DOTNET_ROOT/dotnet-install.sh" --channel 8.0 --install-dir "$DOTNET_ROOT"
dotnet tool install --global dotnet-reportgenerator-globaltool
dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion CycloneDX.Tests/CycloneDX.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<IsTestProject>true</IsTestProject>
<IsPackable>false</IsPackable>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion CycloneDX/CycloneDX.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<ToolCommandName>dotnet-CycloneDX</ToolCommandName>
<_SkipUpgradeNetAnalyzersNuGetWarning>true</_SkipUpgradeNetAnalyzersNuGetWarning>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition="'$(OsEnvironment )'=='windows'">
Expand Down
17 changes: 17 additions & 0 deletions CycloneDX/Services/ProjectAssetsFileService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,23 @@ public HashSet<NugetPackage> GetNugetPackages(string projectFilePath, string pro
runtimePackages.Add(package);
}

var allDependencies = runtimePackages.SelectMany(y => y.Dependencies.Keys).Distinct();
var allPackages = runtimePackages.Select(p => p.Name);
var packagesNotInAllPackages = allDependencies.Except(allPackages);

// Check if there is an "unresolved" dependency on NetStandard
if (packagesNotInAllPackages.Any(p => p == "NETStandard.Library"))
{
// If a project library has targets .net standard it actually doesn't resolve this dependency
// instead it is expected to find the Standard-Libraries on the target system
// => the libraries not being part of the resulting application and thus should not be included in
// the sbom anyways
foreach (var item in runtimePackages)
{
item.Dependencies.Remove("NETStandard.Library");
}
}

ResolveDependencyVersionRanges(runtimePackages);

packages.UnionWith(runtimePackages);
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:7.0
FROM mcr.microsoft.com/dotnet/sdk:8.0

ARG VERSION
COPY ./nupkgs /tmp/nupkgs/
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The CycloneDX module for .NET creates a valid CycloneDX bill-of-material documen
This module runs on
* .NET 6.0
* .NET 7.0
* .NET 8.0

This module no longer runs on

Expand Down
2 changes: 1 addition & 1 deletion semver.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.9.0
2.10.0

0 comments on commit 75d2384

Please sign in to comment.