From 1eefa997e3f80101775e0bb7d4b7c970191b6ae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20G=C3=B6tz?= Date: Tue, 6 Feb 2024 16:00:03 +0100 Subject: [PATCH 1/6] #Issue 847 - Fix runtime dependencies if developer dependencies are excluded. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tibor Götz --- CycloneDX.Tests/CycloneDX.Tests.csproj | 6 + .../FunctionalTests/ExcludeDevDepenceny.cs | 27 +- ...ainedDependency.csproj.project.assets.json | 911 ++++++++++++++++++ .../FineGrainedDependency.csproj.xml | 21 + CycloneDX.Tests/ProgramTests.cs | 4 +- .../ProjectAssetsFileServiceTests.cs | 17 +- CycloneDX.Tests/ProjectFileServiceTests.cs | 20 +- CycloneDX.Tests/ValidationTests.cs | 2 +- .../Interfaces/IProjectAssetsFileService.cs | 2 +- CycloneDX/Interfaces/IProjectFileService.cs | 4 +- CycloneDX/Interfaces/ISolutionFileService.cs | 2 +- CycloneDX/Runner.cs | 6 +- .../Services/ProjectAssetsFileService.cs | 78 +- CycloneDX/Services/ProjectFileService.cs | 10 +- CycloneDX/Services/SolutionFileService.cs | 4 +- 15 files changed, 1064 insertions(+), 50 deletions(-) create mode 100644 CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/FineGrainedDependency.csproj.project.assets.json create mode 100644 CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/FineGrainedDependency.csproj.xml diff --git a/CycloneDX.Tests/CycloneDX.Tests.csproj b/CycloneDX.Tests/CycloneDX.Tests.csproj index ff51c778..a6ff1369 100644 --- a/CycloneDX.Tests/CycloneDX.Tests.csproj +++ b/CycloneDX.Tests/CycloneDX.Tests.csproj @@ -60,6 +60,12 @@ Always + + Always + + + Always + Always diff --git a/CycloneDX.Tests/FunctionalTests/ExcludeDevDepenceny.cs b/CycloneDX.Tests/FunctionalTests/ExcludeDevDepenceny.cs index b09bfba3..d45bd067 100644 --- a/CycloneDX.Tests/FunctionalTests/ExcludeDevDepenceny.cs +++ b/CycloneDX.Tests/FunctionalTests/ExcludeDevDepenceny.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Linq.Expressions; -using System.Text; using System.Threading.Tasks; using CycloneDX.Models; using Xunit; @@ -42,8 +37,26 @@ public async Task DevDependenciesAreExcludedWithExcludeDevDependencies() Assert.True(bom.Components.Count == 0); Assert.True(bom.Dependencies.Count == 1); // only the meta component - - + } + + [Fact] + public async Task DevDependenciesAreExcludedIfNoRuntimepartRemainsWithExcludeDevDependencies() + { + var assetsJson = File.ReadAllText(Path.Combine("FunctionalTests", "Issue847-FineGrainedDependencies", "FineGrainedDependency.csproj.project.assets.json")); + var options = new RunOptions + { + excludeDev = true + }; + var bom = await FunctionalTestHelper.Test(assetsJson, options); + + Assert.Equal(10, bom.Dependencies.Count); + Assert.Equal(9, bom.Components.Count); + + options.excludeDev = false; + bom = await FunctionalTestHelper.Test(assetsJson, options); + + Assert.Equal(17, bom.Dependencies.Count); + Assert.Equal(16, bom.Components.Count); } } } diff --git a/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/FineGrainedDependency.csproj.project.assets.json b/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/FineGrainedDependency.csproj.project.assets.json new file mode 100644 index 00000000..e6d23002 --- /dev/null +++ b/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/FineGrainedDependency.csproj.project.assets.json @@ -0,0 +1,911 @@ +{ + "version": 3, + "targets": { + "net8.0": { + "Google.Protobuf/3.25.2": { + "type": "package", + "compile": { + "lib/net5.0/Google.Protobuf.dll": { + "related": ".pdb;.xml" + } + }, + "runtime": { + "lib/net5.0/Google.Protobuf.dll": { + "related": ".pdb;.xml" + } + } + }, + "log4net/2.0.15": { + "type": "package", + "dependencies": { + "System.Configuration.ConfigurationManager": "4.5.0" + }, + "compile": { + "lib/netstandard2.0/log4net.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/log4net.dll": { + "related": ".xml" + } + } + }, + "Microsoft.Extensions.DependencyInjection/8.0.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0" + }, + "compile": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.0": { + "type": "package", + "compile": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "Microsoft.Extensions.Logging/8.0.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.DependencyInjection": "8.0.0", + "Microsoft.Extensions.Logging.Abstractions": "8.0.0", + "Microsoft.Extensions.Options": "8.0.0" + }, + "compile": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0" + }, + "compile": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "Microsoft.Extensions.Options/8.0.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", + "Microsoft.Extensions.Primitives": "8.0.0" + }, + "compile": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "Microsoft.Extensions.Primitives/8.0.0": { + "type": "package", + "compile": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "Microsoft.NETCore.Platforms/2.0.0": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "compile": { + "lib/net6.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "related": ".xml" + } + } + }, + "Serilog/3.1.1": { + "type": "package", + "compile": { + "lib/net7.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net7.0/Serilog.dll": { + "related": ".xml" + } + } + }, + "System.Configuration.ConfigurationManager/4.5.0": { + "type": "package", + "dependencies": { + "System.Security.Cryptography.ProtectedData": "4.5.0", + "System.Security.Permissions": "4.5.0" + }, + "compile": { + "ref/netstandard2.0/System.Configuration.ConfigurationManager.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Configuration.ConfigurationManager.dll": {} + } + }, + "System.Security.AccessControl/4.5.0": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "2.0.0", + "System.Security.Principal.Windows": "4.5.0" + }, + "compile": { + "ref/netstandard2.0/System.Security.AccessControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Security.AccessControl.dll": {} + }, + "runtimeTargets": { + "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "type": "package", + "compile": { + "ref/netstandard2.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": {} + }, + "runtimeTargets": { + "runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "System.Security.Permissions/4.5.0": { + "type": "package", + "dependencies": { + "System.Security.AccessControl": "4.5.0" + }, + "compile": { + "ref/netstandard2.0/System.Security.Permissions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Security.Permissions.dll": {} + } + }, + "System.Security.Principal.Windows/4.5.0": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "2.0.0" + }, + "compile": { + "ref/netstandard2.0/System.Security.Principal.Windows.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Security.Principal.Windows.dll": {} + }, + "runtimeTargets": { + "runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.dll": { + "assetType": "runtime", + "rid": "unix" + }, + "runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.dll": { + "assetType": "runtime", + "rid": "win" + } + } + } + } + }, + "libraries": { + "Google.Protobuf/3.25.2": { + "sha512": "g/xIIeLhR77bl4ajGGbPYRmZf5acJlCRaSBqUnU8+2aQYREnZnv+UccRNndHof4mWO1ORS0b5i6on40VOjBpsg==", + "type": "package", + "path": "google.protobuf/3.25.2", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "google.protobuf.3.25.2.nupkg.sha512", + "google.protobuf.nuspec", + "lib/net45/Google.Protobuf.dll", + "lib/net45/Google.Protobuf.pdb", + "lib/net45/Google.Protobuf.xml", + "lib/net5.0/Google.Protobuf.dll", + "lib/net5.0/Google.Protobuf.pdb", + "lib/net5.0/Google.Protobuf.xml", + "lib/netstandard1.1/Google.Protobuf.dll", + "lib/netstandard1.1/Google.Protobuf.pdb", + "lib/netstandard1.1/Google.Protobuf.xml", + "lib/netstandard2.0/Google.Protobuf.dll", + "lib/netstandard2.0/Google.Protobuf.pdb", + "lib/netstandard2.0/Google.Protobuf.xml" + ] + }, + "log4net/2.0.15": { + "sha512": "GahnO9ZgFka+xYcFwAfIFjW+k86P2nxFoaEpH6t3v4hiGj7tv2ksVZphxCVIHmJxoySS0HeU3dgCW+bSCcfD0A==", + "type": "package", + "path": "log4net/2.0.15", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net20/log4net.dll", + "lib/net20/log4net.xml", + "lib/net35/log4net.dll", + "lib/net35/log4net.xml", + "lib/net40-client/log4net.dll", + "lib/net40-client/log4net.xml", + "lib/net40/log4net.dll", + "lib/net40/log4net.xml", + "lib/net45/log4net.dll", + "lib/net45/log4net.xml", + "lib/netstandard1.3/log4net.dll", + "lib/netstandard1.3/log4net.xml", + "lib/netstandard2.0/log4net.dll", + "lib/netstandard2.0/log4net.xml", + "log4net.2.0.15.nupkg.sha512", + "log4net.nuspec", + "package-icon.png" + ] + }, + "Microsoft.Extensions.DependencyInjection/8.0.0": { + "sha512": "V8S3bsm50ig6JSyrbcJJ8bW2b9QLGouz+G1miK3UTaOWmMtFwNNNzUf4AleyDWUmTrWMLNnFSLEQtxmxgNQnNQ==", + "type": "package", + "path": "microsoft.extensions.dependencyinjection/8.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/Microsoft.Extensions.DependencyInjection.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.DependencyInjection.targets", + "lib/net462/Microsoft.Extensions.DependencyInjection.dll", + "lib/net462/Microsoft.Extensions.DependencyInjection.xml", + "lib/net6.0/Microsoft.Extensions.DependencyInjection.dll", + "lib/net6.0/Microsoft.Extensions.DependencyInjection.xml", + "lib/net7.0/Microsoft.Extensions.DependencyInjection.dll", + "lib/net7.0/Microsoft.Extensions.DependencyInjection.xml", + "lib/net8.0/Microsoft.Extensions.DependencyInjection.dll", + "lib/net8.0/Microsoft.Extensions.DependencyInjection.xml", + "lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.dll", + "lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.xml", + "lib/netstandard2.1/Microsoft.Extensions.DependencyInjection.dll", + "lib/netstandard2.1/Microsoft.Extensions.DependencyInjection.xml", + "microsoft.extensions.dependencyinjection.8.0.0.nupkg.sha512", + "microsoft.extensions.dependencyinjection.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.0": { + "sha512": "cjWrLkJXK0rs4zofsK4bSdg+jhDLTaxrkXu4gS6Y7MAlCvRyNNgwY/lJi5RDlQOnSZweHqoyvgvbdvQsRIW+hg==", + "type": "package", + "path": "microsoft.extensions.dependencyinjection.abstractions/8.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/Microsoft.Extensions.DependencyInjection.Abstractions.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.DependencyInjection.Abstractions.targets", + "lib/net462/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net462/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/net7.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net7.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/netstandard2.1/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/netstandard2.1/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "microsoft.extensions.dependencyinjection.abstractions.8.0.0.nupkg.sha512", + "microsoft.extensions.dependencyinjection.abstractions.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Logging/8.0.0": { + "sha512": "tvRkov9tAJ3xP51LCv3FJ2zINmv1P8Hi8lhhtcKGqM+ImiTCC84uOPEI4z8Cdq2C3o9e+Aa0Gw0rmrsJD77W+w==", + "type": "package", + "path": "microsoft.extensions.logging/8.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/Microsoft.Extensions.Logging.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.Logging.targets", + "lib/net462/Microsoft.Extensions.Logging.dll", + "lib/net462/Microsoft.Extensions.Logging.xml", + "lib/net6.0/Microsoft.Extensions.Logging.dll", + "lib/net6.0/Microsoft.Extensions.Logging.xml", + "lib/net7.0/Microsoft.Extensions.Logging.dll", + "lib/net7.0/Microsoft.Extensions.Logging.xml", + "lib/net8.0/Microsoft.Extensions.Logging.dll", + "lib/net8.0/Microsoft.Extensions.Logging.xml", + "lib/netstandard2.0/Microsoft.Extensions.Logging.dll", + "lib/netstandard2.0/Microsoft.Extensions.Logging.xml", + "lib/netstandard2.1/Microsoft.Extensions.Logging.dll", + "lib/netstandard2.1/Microsoft.Extensions.Logging.xml", + "microsoft.extensions.logging.8.0.0.nupkg.sha512", + "microsoft.extensions.logging.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.0": { + "sha512": "arDBqTgFCyS0EvRV7O3MZturChstm50OJ0y9bDJvAcmEPJm0FFpFyjU/JLYyStNGGey081DvnQYlncNX5SJJGA==", + "type": "package", + "path": "microsoft.extensions.logging.abstractions/8.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "analyzers/dotnet/roslyn3.11/cs/Microsoft.Extensions.Logging.Generators.dll", + "analyzers/dotnet/roslyn3.11/cs/cs/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/de/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/es/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/fr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/it/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ja/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ko/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/pl/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/pt-BR/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ru/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/tr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/zh-Hans/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/zh-Hant/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/Microsoft.Extensions.Logging.Generators.dll", + "analyzers/dotnet/roslyn4.0/cs/cs/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/de/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/es/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/fr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/it/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ja/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ko/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/pl/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/pt-BR/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ru/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/tr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/zh-Hans/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/zh-Hant/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/Microsoft.Extensions.Logging.Generators.dll", + "analyzers/dotnet/roslyn4.4/cs/cs/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/de/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/es/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/fr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/it/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ja/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ko/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/pl/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/pt-BR/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ru/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/tr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/zh-Hans/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/zh-Hant/Microsoft.Extensions.Logging.Generators.resources.dll", + "buildTransitive/net461/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/net462/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/net6.0/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.targets", + "lib/net462/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net462/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/net6.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net6.0/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/net7.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net7.0/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.xml", + "microsoft.extensions.logging.abstractions.8.0.0.nupkg.sha512", + "microsoft.extensions.logging.abstractions.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Options/8.0.0": { + "sha512": "JOVOfqpnqlVLUzINQ2fox8evY2SKLYJ3BV8QDe/Jyp21u1T7r45x/R/5QdteURMR5r01GxeJSBBUOCOyaNXA3g==", + "type": "package", + "path": "microsoft.extensions.options/8.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "analyzers/dotnet/roslyn4.4/cs/Microsoft.Extensions.Options.SourceGeneration.dll", + "analyzers/dotnet/roslyn4.4/cs/cs/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/de/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/es/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/fr/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/it/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ja/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ko/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/pl/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/pt-BR/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ru/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/tr/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/zh-Hans/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/zh-Hant/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "buildTransitive/net461/Microsoft.Extensions.Options.targets", + "buildTransitive/net462/Microsoft.Extensions.Options.targets", + "buildTransitive/net6.0/Microsoft.Extensions.Options.targets", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.Options.targets", + "buildTransitive/netstandard2.0/Microsoft.Extensions.Options.targets", + "lib/net462/Microsoft.Extensions.Options.dll", + "lib/net462/Microsoft.Extensions.Options.xml", + "lib/net6.0/Microsoft.Extensions.Options.dll", + "lib/net6.0/Microsoft.Extensions.Options.xml", + "lib/net7.0/Microsoft.Extensions.Options.dll", + "lib/net7.0/Microsoft.Extensions.Options.xml", + "lib/net8.0/Microsoft.Extensions.Options.dll", + "lib/net8.0/Microsoft.Extensions.Options.xml", + "lib/netstandard2.0/Microsoft.Extensions.Options.dll", + "lib/netstandard2.0/Microsoft.Extensions.Options.xml", + "lib/netstandard2.1/Microsoft.Extensions.Options.dll", + "lib/netstandard2.1/Microsoft.Extensions.Options.xml", + "microsoft.extensions.options.8.0.0.nupkg.sha512", + "microsoft.extensions.options.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Primitives/8.0.0": { + "sha512": "bXJEZrW9ny8vjMF1JV253WeLhpEVzFo1lyaZu1vQ4ZxWUlVvknZ/+ftFgVheLubb4eZPSwwxBeqS1JkCOjxd8g==", + "type": "package", + "path": "microsoft.extensions.primitives/8.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/Microsoft.Extensions.Primitives.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.Primitives.targets", + "lib/net462/Microsoft.Extensions.Primitives.dll", + "lib/net462/Microsoft.Extensions.Primitives.xml", + "lib/net6.0/Microsoft.Extensions.Primitives.dll", + "lib/net6.0/Microsoft.Extensions.Primitives.xml", + "lib/net7.0/Microsoft.Extensions.Primitives.dll", + "lib/net7.0/Microsoft.Extensions.Primitives.xml", + "lib/net8.0/Microsoft.Extensions.Primitives.dll", + "lib/net8.0/Microsoft.Extensions.Primitives.xml", + "lib/netstandard2.0/Microsoft.Extensions.Primitives.dll", + "lib/netstandard2.0/Microsoft.Extensions.Primitives.xml", + "microsoft.extensions.primitives.8.0.0.nupkg.sha512", + "microsoft.extensions.primitives.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.NETCore.Platforms/2.0.0": { + "sha512": "VdLJOCXhZaEMY7Hm2GKiULmn7IEPFE4XC5LPSfBVCUIA8YLZVh846gtfBJalsPQF2PlzdD7ecX7DZEulJ402ZQ==", + "type": "package", + "path": "microsoft.netcore.platforms/2.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/netstandard1.0/_._", + "microsoft.netcore.platforms.2.0.0.nupkg.sha512", + "microsoft.netcore.platforms.nuspec", + "runtime.json", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "Newtonsoft.Json/13.0.3": { + "sha512": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "type": "package", + "path": "newtonsoft.json/13.0.3", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.md", + "README.md", + "lib/net20/Newtonsoft.Json.dll", + "lib/net20/Newtonsoft.Json.xml", + "lib/net35/Newtonsoft.Json.dll", + "lib/net35/Newtonsoft.Json.xml", + "lib/net40/Newtonsoft.Json.dll", + "lib/net40/Newtonsoft.Json.xml", + "lib/net45/Newtonsoft.Json.dll", + "lib/net45/Newtonsoft.Json.xml", + "lib/net6.0/Newtonsoft.Json.dll", + "lib/net6.0/Newtonsoft.Json.xml", + "lib/netstandard1.0/Newtonsoft.Json.dll", + "lib/netstandard1.0/Newtonsoft.Json.xml", + "lib/netstandard1.3/Newtonsoft.Json.dll", + "lib/netstandard1.3/Newtonsoft.Json.xml", + "lib/netstandard2.0/Newtonsoft.Json.dll", + "lib/netstandard2.0/Newtonsoft.Json.xml", + "newtonsoft.json.13.0.3.nupkg.sha512", + "newtonsoft.json.nuspec", + "packageIcon.png" + ] + }, + "Serilog/3.1.1": { + "sha512": "P6G4/4Kt9bT635bhuwdXlJ2SCqqn2nhh4gqFqQueCOr9bK/e7W9ll/IoX1Ter948cV2Z/5+5v8pAfJYUISY03A==", + "type": "package", + "path": "serilog/3.1.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "icon.png", + "lib/net462/Serilog.dll", + "lib/net462/Serilog.xml", + "lib/net471/Serilog.dll", + "lib/net471/Serilog.xml", + "lib/net5.0/Serilog.dll", + "lib/net5.0/Serilog.xml", + "lib/net6.0/Serilog.dll", + "lib/net6.0/Serilog.xml", + "lib/net7.0/Serilog.dll", + "lib/net7.0/Serilog.xml", + "lib/netstandard2.0/Serilog.dll", + "lib/netstandard2.0/Serilog.xml", + "lib/netstandard2.1/Serilog.dll", + "lib/netstandard2.1/Serilog.xml", + "serilog.3.1.1.nupkg.sha512", + "serilog.nuspec" + ] + }, + "System.Configuration.ConfigurationManager/4.5.0": { + "sha512": "UIFvaFfuKhLr9u5tWMxmVoDPkFeD+Qv8gUuap4aZgVGYSYMdERck4OhLN/2gulAc0nYTEigWXSJNNWshrmxnng==", + "type": "package", + "path": "system.configuration.configurationmanager/4.5.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/System.Configuration.ConfigurationManager.dll", + "lib/netstandard2.0/System.Configuration.ConfigurationManager.dll", + "ref/net461/System.Configuration.ConfigurationManager.dll", + "ref/net461/System.Configuration.ConfigurationManager.xml", + "ref/netstandard2.0/System.Configuration.ConfigurationManager.dll", + "ref/netstandard2.0/System.Configuration.ConfigurationManager.xml", + "system.configuration.configurationmanager.4.5.0.nupkg.sha512", + "system.configuration.configurationmanager.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Security.AccessControl/4.5.0": { + "sha512": "vW8Eoq0TMyz5vAG/6ce483x/CP83fgm4SJe5P8Tb1tZaobcvPrbMEL7rhH1DRdrYbbb6F0vq3OlzmK0Pkwks5A==", + "type": "package", + "path": "system.security.accesscontrol/4.5.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net46/System.Security.AccessControl.dll", + "lib/net461/System.Security.AccessControl.dll", + "lib/netstandard1.3/System.Security.AccessControl.dll", + "lib/netstandard2.0/System.Security.AccessControl.dll", + "lib/uap10.0.16299/_._", + "ref/net46/System.Security.AccessControl.dll", + "ref/net461/System.Security.AccessControl.dll", + "ref/net461/System.Security.AccessControl.xml", + "ref/netstandard1.3/System.Security.AccessControl.dll", + "ref/netstandard1.3/System.Security.AccessControl.xml", + "ref/netstandard1.3/de/System.Security.AccessControl.xml", + "ref/netstandard1.3/es/System.Security.AccessControl.xml", + "ref/netstandard1.3/fr/System.Security.AccessControl.xml", + "ref/netstandard1.3/it/System.Security.AccessControl.xml", + "ref/netstandard1.3/ja/System.Security.AccessControl.xml", + "ref/netstandard1.3/ko/System.Security.AccessControl.xml", + "ref/netstandard1.3/ru/System.Security.AccessControl.xml", + "ref/netstandard1.3/zh-hans/System.Security.AccessControl.xml", + "ref/netstandard1.3/zh-hant/System.Security.AccessControl.xml", + "ref/netstandard2.0/System.Security.AccessControl.dll", + "ref/netstandard2.0/System.Security.AccessControl.xml", + "ref/uap10.0.16299/_._", + "runtimes/win/lib/net46/System.Security.AccessControl.dll", + "runtimes/win/lib/net461/System.Security.AccessControl.dll", + "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll", + "runtimes/win/lib/netstandard1.3/System.Security.AccessControl.dll", + "runtimes/win/lib/uap10.0.16299/_._", + "system.security.accesscontrol.4.5.0.nupkg.sha512", + "system.security.accesscontrol.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "sha512": "wLBKzFnDCxP12VL9ANydSYhk59fC4cvOr9ypYQLPnAj48NQIhqnjdD2yhP8yEKyBJEjERWS9DisKL7rX5eU25Q==", + "type": "package", + "path": "system.security.cryptography.protecteddata/4.5.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.Security.Cryptography.ProtectedData.dll", + "lib/net461/System.Security.Cryptography.ProtectedData.dll", + "lib/netstandard1.3/System.Security.Cryptography.ProtectedData.dll", + "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/System.Security.Cryptography.ProtectedData.dll", + "ref/net461/System.Security.Cryptography.ProtectedData.dll", + "ref/net461/System.Security.Cryptography.ProtectedData.xml", + "ref/netstandard1.3/System.Security.Cryptography.ProtectedData.dll", + "ref/netstandard2.0/System.Security.Cryptography.ProtectedData.dll", + "ref/netstandard2.0/System.Security.Cryptography.ProtectedData.xml", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._", + "runtimes/win/lib/net46/System.Security.Cryptography.ProtectedData.dll", + "runtimes/win/lib/net461/System.Security.Cryptography.ProtectedData.dll", + "runtimes/win/lib/netstandard1.3/System.Security.Cryptography.ProtectedData.dll", + "runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll", + "system.security.cryptography.protecteddata.4.5.0.nupkg.sha512", + "system.security.cryptography.protecteddata.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Security.Permissions/4.5.0": { + "sha512": "9gdyuARhUR7H+p5CjyUB/zPk7/Xut3wUSP8NJQB6iZr8L3XUXTMdoLeVAg9N4rqF8oIpE7MpdqHdDHQ7XgJe0g==", + "type": "package", + "path": "system.security.permissions/4.5.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/System.Security.Permissions.dll", + "lib/netstandard2.0/System.Security.Permissions.dll", + "ref/net461/System.Security.Permissions.dll", + "ref/net461/System.Security.Permissions.xml", + "ref/netstandard2.0/System.Security.Permissions.dll", + "ref/netstandard2.0/System.Security.Permissions.xml", + "system.security.permissions.4.5.0.nupkg.sha512", + "system.security.permissions.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Security.Principal.Windows/4.5.0": { + "sha512": "U77HfRXlZlOeIXd//Yoj6Jnk8AXlbeisf1oq1os+hxOGVnuG+lGSfGqTwTZBoORFF6j/0q7HXIl8cqwQ9aUGqQ==", + "type": "package", + "path": "system.security.principal.windows/4.5.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net46/System.Security.Principal.Windows.dll", + "lib/net461/System.Security.Principal.Windows.dll", + "lib/netstandard1.3/System.Security.Principal.Windows.dll", + "lib/netstandard2.0/System.Security.Principal.Windows.dll", + "lib/uap10.0.16299/_._", + "ref/net46/System.Security.Principal.Windows.dll", + "ref/net461/System.Security.Principal.Windows.dll", + "ref/net461/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/System.Security.Principal.Windows.dll", + "ref/netstandard1.3/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/de/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/es/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/fr/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/it/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ja/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ko/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ru/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/zh-hans/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/zh-hant/System.Security.Principal.Windows.xml", + "ref/netstandard2.0/System.Security.Principal.Windows.dll", + "ref/netstandard2.0/System.Security.Principal.Windows.xml", + "ref/uap10.0.16299/_._", + "runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.dll", + "runtimes/win/lib/net46/System.Security.Principal.Windows.dll", + "runtimes/win/lib/net461/System.Security.Principal.Windows.dll", + "runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.dll", + "runtimes/win/lib/netstandard1.3/System.Security.Principal.Windows.dll", + "runtimes/win/lib/uap10.0.16299/_._", + "system.security.principal.windows.4.5.0.nupkg.sha512", + "system.security.principal.windows.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + } + }, + "projectFileDependencyGroups": { + "net8.0": [ + "Google.Protobuf >= 3.25.2", + "Microsoft.Extensions.Logging >= 8.0.0", + "Newtonsoft.Json >= 13.0.3", + "Serilog >= 3.1.1", + "log4net >= 2.0.15" + ] + }, + "packageFolders": { + "C:\\Users\\z001rxhc.AD005\\.nuget\\packages\\": {}, + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\del\\FineGrainedDependency\\FineGrainedDependency\\FineGrainedDependency.csproj", + "projectName": "FineGrainedDependency", + "projectPath": "C:\\del\\FineGrainedDependency\\FineGrainedDependency\\FineGrainedDependency.csproj", + "packagesPath": "C:\\Users\\z001rxhc.AD005\\.nuget\\packages\\", + "outputPath": "C:\\del\\FineGrainedDependency\\FineGrainedDependency\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\del\\FineGrainedDependency\\NuGet.Config", + "C:\\Users\\z001rxhc.AD005\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net8.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "dependencies": { + "Google.Protobuf": { + "suppressParent": "Build, Analyzers", + "target": "Package", + "version": "[3.25.2, )" + }, + "Microsoft.Extensions.Logging": { + "include": "None", + "target": "Package", + "version": "[8.0.0, )" + }, + "Newtonsoft.Json": { + "include": "Runtime", + "target": "Package", + "version": "[13.0.3, )" + }, + "Serilog": { + "include": "Runtime", + "suppressParent": "All", + "target": "Package", + "version": "[3.1.1, )" + }, + "log4net": { + "target": "Package", + "version": "[2.0.15, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.101/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/FineGrainedDependency.csproj.xml b/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/FineGrainedDependency.csproj.xml new file mode 100644 index 00000000..099a769a --- /dev/null +++ b/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/FineGrainedDependency.csproj.xml @@ -0,0 +1,21 @@ + + + + net8.0 + exe + + + + + + + + + + + + + + + + diff --git a/CycloneDX.Tests/ProgramTests.cs b/CycloneDX.Tests/ProgramTests.cs index 7817fffd..f598aee6 100755 --- a/CycloneDX.Tests/ProgramTests.cs +++ b/CycloneDX.Tests/ProgramTests.cs @@ -47,7 +47,7 @@ public async Task CallingCycloneDX_CreatesOutputDirectory() }); var mockSolutionFileService = new Mock(); mockSolutionFileService - .Setup(s => s.GetSolutionDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.GetSolutionDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .ReturnsAsync(new HashSet()); Runner runner = new Runner(fileSystem: mockFileSystem, null, null, null, null, null, solutionFileService: mockSolutionFileService.Object, null); @@ -72,7 +72,7 @@ public async Task CallingCycloneDX_WithOutputFilename_CreatesOutputFilename() }); var mockSolutionFileService = new Mock(); mockSolutionFileService - .Setup(s => s.GetSolutionDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.GetSolutionDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .ReturnsAsync(new HashSet()); Runner runner = new Runner(fileSystem: mockFileSystem, null, null, null, null, null, solutionFileService: mockSolutionFileService.Object, null); diff --git a/CycloneDX.Tests/ProjectAssetsFileServiceTests.cs b/CycloneDX.Tests/ProjectAssetsFileServiceTests.cs index b5758721..b04c233a 100644 --- a/CycloneDX.Tests/ProjectAssetsFileServiceTests.cs +++ b/CycloneDX.Tests/ProjectAssetsFileServiceTests.cs @@ -17,19 +17,18 @@ using System; using System.Collections.Generic; -using Xunit; +using System.IO; using System.IO.Abstractions.TestingHelpers; using CycloneDX.Interfaces; -using XFS = System.IO.Abstractions.TestingHelpers.MockUnixSupport; -using Moq; using CycloneDX.Models; using CycloneDX.Services; +using Moq; using NuGet.LibraryModel; -using NuGet.ProjectModel; using NuGet.Packaging.Core; +using NuGet.ProjectModel; using NuGet.Versioning; -using System.IO; -using NuGet.Packaging.Signing; +using Xunit; +using XFS = System.IO.Abstractions.TestingHelpers.MockUnixSupport; namespace CycloneDX.Tests { @@ -237,7 +236,7 @@ public void GetDotnetDependencys_PackageAsTopLevelAndTransitive(string framework }); var projectAssetsFileService = new ProjectAssetsFileService(mockFileSystem, () => mockAssetReader.Object); - var packages = projectAssetsFileService.GetDotnetDependencys(XFS.Path(@"c:\SolutionPath\Project1\Project1.csproj"), XFS.Path(@"c:\SolutionPath\Project1\obj\project.assets.json"), false); + var packages = projectAssetsFileService.GetDotnetDependencys(XFS.Path(@"c:\SolutionPath\Project1\Project1.csproj"), XFS.Path(@"c:\SolutionPath\Project1\obj\project.assets.json"), false, false); var sortedPackages = new List(packages); sortedPackages.Sort(); @@ -397,7 +396,7 @@ public void GetDotnetDependencys_MissingResolvedPackageVersion(string framework, }); var projectAssetsFileService = new ProjectAssetsFileService(mockFileSystem, () => mockAssetReader.Object); - var packages = projectAssetsFileService.GetDotnetDependencys(XFS.Path(@"c:\SolutionPath\Project1\Project1.csproj"), XFS.Path(@"c:\SolutionPath\Project1\obj\project.assets.json"), false); + var packages = projectAssetsFileService.GetDotnetDependencys(XFS.Path(@"c:\SolutionPath\Project1\Project1.csproj"), XFS.Path(@"c:\SolutionPath\Project1\obj\project.assets.json"), false, false); var sortedPackages = new List(packages); sortedPackages.Sort(); @@ -531,7 +530,7 @@ public void GetDotnetDependencys_MissingDependencies(string framework, int frame }); var projectAssetsFileService = new ProjectAssetsFileService(mockFileSystem, () => mockAssetReader.Object); - var packages = projectAssetsFileService.GetDotnetDependencys(XFS.Path(@"c:\SolutionPath\Project1\Project1.csproj"), XFS.Path(@"c:\SolutionPath\Project1\obj\project.assets.json"), false); + var packages = projectAssetsFileService.GetDotnetDependencys(XFS.Path(@"c:\SolutionPath\Project1\Project1.csproj"), XFS.Path(@"c:\SolutionPath\Project1\obj\project.assets.json"), false, false); var sortedPackages = new List(packages); sortedPackages.Sort(); diff --git a/CycloneDX.Tests/ProjectFileServiceTests.cs b/CycloneDX.Tests/ProjectFileServiceTests.cs index 255c2dd5..9d24e85c 100755 --- a/CycloneDX.Tests/ProjectFileServiceTests.cs +++ b/CycloneDX.Tests/ProjectFileServiceTests.cs @@ -82,7 +82,7 @@ public async Task GetProjectDotnetDependencys_WithProjectAssetsFile_ReturnsDotne var mockPackageFileService = new Mock(); var mockProjectAssetsFileService = new Mock(); mockProjectAssetsFileService - .Setup(s => s.GetDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.GetDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .Returns(new HashSet { new DotnetDependency { Name = "Package", Version = "1.2.3" }, @@ -93,7 +93,7 @@ public async Task GetProjectDotnetDependencys_WithProjectAssetsFile_ReturnsDotne mockPackageFileService.Object, mockProjectAssetsFileService.Object); - var packages = await projectFileService.GetProjectDotnetDependencysAsync(XFS.Path(@"c:\Project\Project.csproj"), "", false, "", "").ConfigureAwait(true); + var packages = await projectFileService.GetProjectDotnetDependencysAsync(XFS.Path(@"c:\Project\Project.csproj"), "", false, false, "", "").ConfigureAwait(true); Assert.Collection(packages, item => { @@ -117,7 +117,7 @@ public async Task GetProjectDotnetDependencys_WithProjectAssetsFileWithoutRestor var mockPackageFileService = new Mock(); var mockProjectAssetsFileService = new Mock(); mockProjectAssetsFileService - .Setup(s => s.GetDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.GetDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .Returns(new HashSet { new DotnetDependency { Name = "Package", Version = "1.2.3" }, @@ -129,7 +129,7 @@ public async Task GetProjectDotnetDependencys_WithProjectAssetsFileWithoutRestor mockProjectAssetsFileService.Object); projectFileService.DisablePackageRestore = true; - var packages = await projectFileService.GetProjectDotnetDependencysAsync(XFS.Path(@"c:\Project\Project.csproj"), "", false, "", "").ConfigureAwait(true); + var packages = await projectFileService.GetProjectDotnetDependencysAsync(XFS.Path(@"c:\Project\Project.csproj"), "", false, false, "", "").ConfigureAwait(true); Assert.Collection(packages, item => { @@ -153,7 +153,7 @@ public async Task GetProjectDotnetDependencys_WithProjectAssetsFile_ReturnsMulti var mockPackageFileService = new Mock(); var mockProjectAssetsFileService = new Mock(); mockProjectAssetsFileService - .Setup(s => s.GetDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.GetDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .Returns(new HashSet { new DotnetDependency { Name = "Package1", Version = "1.2.3" }, @@ -166,7 +166,7 @@ public async Task GetProjectDotnetDependencys_WithProjectAssetsFile_ReturnsMulti mockPackageFileService.Object, mockProjectAssetsFileService.Object); - var packages = await projectFileService.GetProjectDotnetDependencysAsync(XFS.Path(@"c:\Project\Project.csproj"), "", false, "", "").ConfigureAwait(true); + var packages = await projectFileService.GetProjectDotnetDependencysAsync(XFS.Path(@"c:\Project\Project.csproj"), "", false, false, "", "").ConfigureAwait(true); var sortedPackages = new List(packages); sortedPackages.Sort(); @@ -199,7 +199,7 @@ public async Task GetProjectDotnetDependencys_WithPackagesConfig_ReturnsDotnetDe ); var mockProjectAssetsFileService = new Mock(); mockProjectAssetsFileService - .Setup(s => s.GetDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.GetDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .Returns(new HashSet()); var projectFileService = new ProjectFileService( mockFileSystem, @@ -207,7 +207,7 @@ public async Task GetProjectDotnetDependencys_WithPackagesConfig_ReturnsDotnetDe mockPackageFileService.Object, mockProjectAssetsFileService.Object); - var packages = await projectFileService.GetProjectDotnetDependencysAsync(XFS.Path(@"c:\Project\Project.csproj"), "", false, "", "").ConfigureAwait(true); + var packages = await projectFileService.GetProjectDotnetDependencysAsync(XFS.Path(@"c:\Project\Project.csproj"), "", false, false, "", "").ConfigureAwait(true); Assert.Collection(packages, item => { @@ -241,7 +241,7 @@ public async Task GetProjectDotnetDependencys_WithPackagesConfig_ReturnsMultiple ); var mockProjectAssetsFileService = new Mock(); mockProjectAssetsFileService - .Setup(s => s.GetDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.GetDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .Returns(new HashSet()); var projectFileService = new ProjectFileService( mockFileSystem, @@ -249,7 +249,7 @@ public async Task GetProjectDotnetDependencys_WithPackagesConfig_ReturnsMultiple mockPackageFileService.Object, mockProjectAssetsFileService.Object); - var packages = await projectFileService.GetProjectDotnetDependencysAsync(XFS.Path(@"c:\Project\Project.csproj"), "", false, "", "").ConfigureAwait(true); + var packages = await projectFileService.GetProjectDotnetDependencysAsync(XFS.Path(@"c:\Project\Project.csproj"), "", false, false, "", "").ConfigureAwait(true); var sortedPackages = new List(packages); sortedPackages.Sort(); diff --git a/CycloneDX.Tests/ValidationTests.cs b/CycloneDX.Tests/ValidationTests.cs index 6c73693e..ed1a3e97 100644 --- a/CycloneDX.Tests/ValidationTests.cs +++ b/CycloneDX.Tests/ValidationTests.cs @@ -38,7 +38,7 @@ public async Task Validation(string fileFormat, bool disableGitHubLicenses) var mockProjectFileService = new Mock(); mockProjectFileService.Setup(mock => - mock.GetProjectDotnetDependencysAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()) + mock.GetProjectDotnetDependencysAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()) ).ReturnsAsync(packages); Runner runner = new Runner(fileSystem: mockFileSystem, null, null, null, null, projectFileService: mockProjectFileService.Object, solutionFileService: null, null); diff --git a/CycloneDX/Interfaces/IProjectAssetsFileService.cs b/CycloneDX/Interfaces/IProjectAssetsFileService.cs index cc300ae8..53155de2 100644 --- a/CycloneDX/Interfaces/IProjectAssetsFileService.cs +++ b/CycloneDX/Interfaces/IProjectAssetsFileService.cs @@ -22,6 +22,6 @@ namespace CycloneDX.Interfaces { public interface IProjectAssetsFileService { - HashSet GetDotnetDependencys(string projectFilePath, string projectAssetsFilePath, bool IsTestProject); + HashSet GetDotnetDependencys(string projectFilePath, string projectAssetsFilePath, bool IsTestProject, bool excludeDevDependencies); } } diff --git a/CycloneDX/Interfaces/IProjectFileService.cs b/CycloneDX/Interfaces/IProjectFileService.cs index 7a6728c2..8265efa8 100755 --- a/CycloneDX/Interfaces/IProjectFileService.cs +++ b/CycloneDX/Interfaces/IProjectFileService.cs @@ -24,9 +24,9 @@ namespace CycloneDX.Interfaces public interface IProjectFileService { bool DisablePackageRestore { get; set; } - Task> GetProjectDotnetDependencysAsync(string projectFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, string framework, string runtime); + Task> GetProjectDotnetDependencysAsync(string projectFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, bool excludeDevDependencies, string framework, string runtime); Task> GetProjectReferencesAsync(string projectFilePath); - Task> RecursivelyGetProjectDotnetDependencysAsync(string projectFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, string framework, string runtime); + Task> RecursivelyGetProjectDotnetDependencysAsync(string projectFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, bool excludeDevDependencies, string framework, string runtime); Task> RecursivelyGetProjectReferencesAsync(string projectFilePath); Component GetComponent(DotnetDependency dotnetDependency); bool IsTestProject(string projectFilePath); diff --git a/CycloneDX/Interfaces/ISolutionFileService.cs b/CycloneDX/Interfaces/ISolutionFileService.cs index 8c9f1849..c31b7e77 100755 --- a/CycloneDX/Interfaces/ISolutionFileService.cs +++ b/CycloneDX/Interfaces/ISolutionFileService.cs @@ -24,6 +24,6 @@ namespace CycloneDX.Interfaces public interface ISolutionFileService { Task> GetSolutionProjectReferencesAsync(string solutionFilePath); - Task> GetSolutionDotnetDependencys(string solutionFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, string framework, string runtime); + Task> GetSolutionDotnetDependencys(string solutionFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, bool excludeDevDependencies, string framework, string runtime); } } diff --git a/CycloneDX/Runner.cs b/CycloneDX/Runner.cs index eaef36be..98042afe 100644 --- a/CycloneDX/Runner.cs +++ b/CycloneDX/Runner.cs @@ -164,17 +164,17 @@ public async Task HandleCommandAsync(RunOptions options) { if (SolutionOrProjectFile.ToLowerInvariant().EndsWith(".sln", StringComparison.OrdinalIgnoreCase)) { - packages = await solutionFileService.GetSolutionDotnetDependencys(fullSolutionOrProjectFilePath, baseIntermediateOutputPath, excludetestprojects, framework, runtime).ConfigureAwait(false); + packages = await solutionFileService.GetSolutionDotnetDependencys(fullSolutionOrProjectFilePath, baseIntermediateOutputPath, excludetestprojects, excludeDev, framework, runtime).ConfigureAwait(false); topLevelComponent.Name = fileSystem.Path.GetFileNameWithoutExtension(SolutionOrProjectFile); } else if (Utils.IsSupportedProjectType(SolutionOrProjectFile) && scanProjectReferences) { - packages = await projectFileService.RecursivelyGetProjectDotnetDependencysAsync(fullSolutionOrProjectFilePath, baseIntermediateOutputPath, excludetestprojects, framework, runtime).ConfigureAwait(false); + packages = await projectFileService.RecursivelyGetProjectDotnetDependencysAsync(fullSolutionOrProjectFilePath, baseIntermediateOutputPath, excludetestprojects, excludeDev, framework, runtime).ConfigureAwait(false); topLevelComponent.Name = fileSystem.Path.GetFileNameWithoutExtension(SolutionOrProjectFile); } else if (Utils.IsSupportedProjectType(SolutionOrProjectFile)) { - packages = await projectFileService.GetProjectDotnetDependencysAsync(fullSolutionOrProjectFilePath, baseIntermediateOutputPath, excludetestprojects, framework, runtime).ConfigureAwait(false); + packages = await projectFileService.GetProjectDotnetDependencysAsync(fullSolutionOrProjectFilePath, baseIntermediateOutputPath, excludetestprojects, excludeDev, framework, runtime).ConfigureAwait(false); topLevelComponent.Name = fileSystem.Path.GetFileNameWithoutExtension(SolutionOrProjectFile); } else if (this.fileSystem.Path.GetFileName(SolutionOrProjectFile).ToLowerInvariant().Equals("packages.config", StringComparison.OrdinalIgnoreCase)) diff --git a/CycloneDX/Services/ProjectAssetsFileService.cs b/CycloneDX/Services/ProjectAssetsFileService.cs index 9748cab7..0cb6cc9f 100644 --- a/CycloneDX/Services/ProjectAssetsFileService.cs +++ b/CycloneDX/Services/ProjectAssetsFileService.cs @@ -39,7 +39,7 @@ public ProjectAssetsFileService(IFileSystem fileSystem, Func a _assetFileReaderFactory = assetFileReaderFactory; } - public HashSet GetDotnetDependencys(string projectFilePath, string projectAssetsFilePath, bool isTestProject) + public HashSet GetDotnetDependencys(string projectFilePath, string projectAssetsFilePath, bool isTestProject, bool excludeDevDependencies) { var packages = new HashSet(); @@ -52,7 +52,8 @@ public HashSet GetDotnetDependencys(string projectFilePath, st foreach (var targetRuntime in assetsFile.Targets) { - var runtimePackages = new HashSet(); + var runtimePackages = new HashSet(); + var targetFramework = assetsFile.PackageSpec.GetTargetFramework(targetRuntime.TargetFramework); var dependencies = targetFramework.Dependencies; var directDependencies = assetsFile.ProjectFileDependencyGroups @@ -83,7 +84,7 @@ public HashSet GetDotnetDependencys(string projectFilePath, st }; // is this a test project dependency or only a development dependency - if ( isTestProject) + if (isTestProject) { package.Scope = Component.ComponentScope.Excluded; } @@ -97,7 +98,22 @@ public HashSet GetDotnetDependencys(string projectFilePath, st var allDependencies = runtimePackages.SelectMany(y => y.Dependencies.Keys).Distinct(); var allPackages = runtimePackages.Select(p => p.Name); - var packagesNotInAllPackages = allDependencies.Except(allPackages); + var packagesNotInAllPackages = allDependencies.Except(allPackages); + + if (excludeDevDependencies) + { + var realRuntimePackages = new HashSet(); + foreach (DotnetDependency dd in runtimePackages) + { + if (!dd.IsDirectReference) + { + continue; + } + + ResolvedRuntimeDependencies(dd, runtimePackages, realRuntimePackages); + } + runtimePackages = realRuntimePackages; + } // Check if there is an "unresolved" dependency on NetStandard if (packagesNotInAllPackages.Any(p => p == "NETStandard.Library")) @@ -125,9 +141,28 @@ public bool SetIsDirectReference(LibraryDependency dependency) return dependency?.ReferenceType == LibraryDependencyReferenceType.Direct; } public bool SetIsDevDependency(LibraryDependency dependency) - { - return dependency != null && dependency.SuppressParent != LibraryIncludeFlagUtils.DefaultSuppressParent; + { + return dependency != null && !HasRuntimeParts(dependency); } + + private static void ResolvedRuntimeDependencies(DotnetDependency dotnetDependency, HashSet allpackages, HashSet collectedDependencies) + { + if (dotnetDependency.IsDevDependency) + { + return; + } + + if (!collectedDependencies.Contains(dotnetDependency)) + { + collectedDependencies.Add(dotnetDependency); + } + + foreach (KeyValuePair child in dotnetDependency.Dependencies) + { + DotnetDependency childDependency = allpackages.First(p => string.Equals(p.Name, child.Key, StringComparison.OrdinalIgnoreCase)); + ResolvedRuntimeDependencies(childDependency, allpackages, collectedDependencies); + } + } /// /// Updates all dependencies with version ranges to the version it was resolved to. @@ -155,6 +190,35 @@ private static void ResolveDependencyVersionRanges(HashSet run } } } - } + } + + private static bool HasRuntimeParts(LibraryDependency dependency) + { + if (dependency == null) + { + return false; + } + + //all runtime parts are excluded + if (runtimePartFlags.All(f => dependency.SuppressParent.HasFlag(f))) + { + return false; + } + + //none of the runtimes are includede + if (!runtimePartFlags.Any(f => dependency.IncludeType.HasFlag(f))) + { + return false; + } + + return true; + } + + private static readonly HashSet runtimePartFlags = new HashSet() + { + LibraryIncludeFlags.Runtime, + LibraryIncludeFlags.Native, + LibraryIncludeFlags.ContentFiles + }; } } diff --git a/CycloneDX/Services/ProjectFileService.cs b/CycloneDX/Services/ProjectFileService.cs index 27570877..58c3d1f7 100755 --- a/CycloneDX/Services/ProjectFileService.cs +++ b/CycloneDX/Services/ProjectFileService.cs @@ -148,7 +148,7 @@ static internal string GetProjectProperty(string projectFilePath, string baseInt /// /// /// - public async Task> GetProjectDotnetDependencysAsync(string projectFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, string framework, string runtime) + public async Task> GetProjectDotnetDependencysAsync(string projectFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, bool excludeDevDependencies, string framework, string runtime) { if (!_fileSystem.File.Exists(projectFilePath)) { @@ -189,7 +189,7 @@ public async Task> GetProjectDotnetDependencysAsync(st { Console.WriteLine($"File not found: \"{assetsFilename}\", \"{projectFilePath}\" "); } - var packages = _projectAssetsFileService.GetDotnetDependencys(projectFilePath, assetsFilename, isTestProject); + var packages = _projectAssetsFileService.GetDotnetDependencys(projectFilePath, assetsFilename, isTestProject, excludeDevDependencies); // if there are no project file package references look for a packages.config @@ -212,9 +212,9 @@ public async Task> GetProjectDotnetDependencysAsync(st /// /// /// - public async Task> RecursivelyGetProjectDotnetDependencysAsync(string projectFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, string framework, string runtime) + public async Task> RecursivelyGetProjectDotnetDependencysAsync(string projectFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, bool excludeDevDependencies, string framework, string runtime) { - var dotnetDependencys = await GetProjectDotnetDependencysAsync(projectFilePath, baseIntermediateOutputPath, excludeTestProjects, framework, runtime).ConfigureAwait(false); + var dotnetDependencys = await GetProjectDotnetDependencysAsync(projectFilePath, baseIntermediateOutputPath, excludeTestProjects, excludeDevDependencies, framework, runtime).ConfigureAwait(false); foreach (var item in dotnetDependencys) { item.IsDirectReference = true; @@ -230,7 +230,7 @@ public async Task> RecursivelyGetProjectDotnetDependen foreach (var project in projectReferences) { - var projectDotnetDependencys = await GetProjectDotnetDependencysAsync(project.Path, baseIntermediateOutputPath, excludeTestProjects, framework, runtime).ConfigureAwait(false); + var projectDotnetDependencys = await GetProjectDotnetDependencysAsync(project.Path, baseIntermediateOutputPath, excludeTestProjects, excludeDevDependencies, framework, runtime).ConfigureAwait(false); //Add dependencies for dependency graph foreach (var dependency in projectDotnetDependencys) diff --git a/CycloneDX/Services/SolutionFileService.cs b/CycloneDX/Services/SolutionFileService.cs index bddb211e..bf0eded2 100755 --- a/CycloneDX/Services/SolutionFileService.cs +++ b/CycloneDX/Services/SolutionFileService.cs @@ -82,7 +82,7 @@ public async Task> GetSolutionProjectReferencesAsync(string solu /// /// /// - public async Task> GetSolutionDotnetDependencys(string solutionFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, string framework, string runtime) + public async Task> GetSolutionDotnetDependencys(string solutionFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, bool excludeDevDependencies, string framework, string runtime) { if (!_fileSystem.File.Exists(solutionFilePath)) { @@ -113,7 +113,7 @@ public async Task> GetSolutionDotnetDependencys(string foreach (var projectFilePath in projectQuery) { Console.WriteLine(); - var projectPackages = await _projectFileService.GetProjectDotnetDependencysAsync(projectFilePath, baseIntermediateOutputPath, excludeTestProjects, framework, runtime).ConfigureAwait(false); + var projectPackages = await _projectFileService.GetProjectDotnetDependencysAsync(projectFilePath, baseIntermediateOutputPath, excludeTestProjects, excludeDevDependencies, framework, runtime).ConfigureAwait(false); directReferencePackages.UnionWith(projectPackages.Where(p => p.IsDirectReference)); packages.UnionWith(projectPackages); } From bdb3f182bb55928cf40fa68668737c54bfed48d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20G=C3=B6tz?= Date: Tue, 6 Feb 2024 16:09:09 +0100 Subject: [PATCH 2/6] Fixed "Remove these redundant parentheses." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tibor Götz --- CycloneDX/Services/ProjectAssetsFileService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CycloneDX/Services/ProjectAssetsFileService.cs b/CycloneDX/Services/ProjectAssetsFileService.cs index 0cb6cc9f..14902228 100644 --- a/CycloneDX/Services/ProjectAssetsFileService.cs +++ b/CycloneDX/Services/ProjectAssetsFileService.cs @@ -214,7 +214,7 @@ private static bool HasRuntimeParts(LibraryDependency dependency) return true; } - private static readonly HashSet runtimePartFlags = new HashSet() + private static readonly HashSet runtimePartFlags = new HashSet { LibraryIncludeFlags.Runtime, LibraryIncludeFlags.Native, From 1dbf940d6f787b4fff1c0c7ab7fe4146cea72c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20G=C3=B6tz?= Date: Wed, 7 Feb 2024 01:45:03 +0100 Subject: [PATCH 3/6] Only mark dotnet dependencies to be dev dependency instead of forcibly remove them. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tibor Götz --- CycloneDX.Tests/ProgramTests.cs | 4 +- .../ProjectAssetsFileServiceTests.cs | 6 +-- CycloneDX.Tests/ProjectFileServiceTests.cs | 20 +++++----- CycloneDX.Tests/ValidationTests.cs | 2 +- .../Interfaces/IProjectAssetsFileService.cs | 2 +- CycloneDX/Interfaces/IProjectFileService.cs | 4 +- CycloneDX/Interfaces/ISolutionFileService.cs | 2 +- CycloneDX/Runner.cs | 6 +-- .../Services/ProjectAssetsFileService.cs | 39 ++++++++++--------- CycloneDX/Services/ProjectFileService.cs | 10 ++--- CycloneDX/Services/SolutionFileService.cs | 4 +- 11 files changed, 51 insertions(+), 48 deletions(-) diff --git a/CycloneDX.Tests/ProgramTests.cs b/CycloneDX.Tests/ProgramTests.cs index f598aee6..7817fffd 100755 --- a/CycloneDX.Tests/ProgramTests.cs +++ b/CycloneDX.Tests/ProgramTests.cs @@ -47,7 +47,7 @@ public async Task CallingCycloneDX_CreatesOutputDirectory() }); var mockSolutionFileService = new Mock(); mockSolutionFileService - .Setup(s => s.GetSolutionDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.GetSolutionDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .ReturnsAsync(new HashSet()); Runner runner = new Runner(fileSystem: mockFileSystem, null, null, null, null, null, solutionFileService: mockSolutionFileService.Object, null); @@ -72,7 +72,7 @@ public async Task CallingCycloneDX_WithOutputFilename_CreatesOutputFilename() }); var mockSolutionFileService = new Mock(); mockSolutionFileService - .Setup(s => s.GetSolutionDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.GetSolutionDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .ReturnsAsync(new HashSet()); Runner runner = new Runner(fileSystem: mockFileSystem, null, null, null, null, null, solutionFileService: mockSolutionFileService.Object, null); diff --git a/CycloneDX.Tests/ProjectAssetsFileServiceTests.cs b/CycloneDX.Tests/ProjectAssetsFileServiceTests.cs index b04c233a..9ab439d5 100644 --- a/CycloneDX.Tests/ProjectAssetsFileServiceTests.cs +++ b/CycloneDX.Tests/ProjectAssetsFileServiceTests.cs @@ -236,7 +236,7 @@ public void GetDotnetDependencys_PackageAsTopLevelAndTransitive(string framework }); var projectAssetsFileService = new ProjectAssetsFileService(mockFileSystem, () => mockAssetReader.Object); - var packages = projectAssetsFileService.GetDotnetDependencys(XFS.Path(@"c:\SolutionPath\Project1\Project1.csproj"), XFS.Path(@"c:\SolutionPath\Project1\obj\project.assets.json"), false, false); + var packages = projectAssetsFileService.GetDotnetDependencys(XFS.Path(@"c:\SolutionPath\Project1\Project1.csproj"), XFS.Path(@"c:\SolutionPath\Project1\obj\project.assets.json"), false); var sortedPackages = new List(packages); sortedPackages.Sort(); @@ -396,7 +396,7 @@ public void GetDotnetDependencys_MissingResolvedPackageVersion(string framework, }); var projectAssetsFileService = new ProjectAssetsFileService(mockFileSystem, () => mockAssetReader.Object); - var packages = projectAssetsFileService.GetDotnetDependencys(XFS.Path(@"c:\SolutionPath\Project1\Project1.csproj"), XFS.Path(@"c:\SolutionPath\Project1\obj\project.assets.json"), false, false); + var packages = projectAssetsFileService.GetDotnetDependencys(XFS.Path(@"c:\SolutionPath\Project1\Project1.csproj"), XFS.Path(@"c:\SolutionPath\Project1\obj\project.assets.json"), false); var sortedPackages = new List(packages); sortedPackages.Sort(); @@ -530,7 +530,7 @@ public void GetDotnetDependencys_MissingDependencies(string framework, int frame }); var projectAssetsFileService = new ProjectAssetsFileService(mockFileSystem, () => mockAssetReader.Object); - var packages = projectAssetsFileService.GetDotnetDependencys(XFS.Path(@"c:\SolutionPath\Project1\Project1.csproj"), XFS.Path(@"c:\SolutionPath\Project1\obj\project.assets.json"), false, false); + var packages = projectAssetsFileService.GetDotnetDependencys(XFS.Path(@"c:\SolutionPath\Project1\Project1.csproj"), XFS.Path(@"c:\SolutionPath\Project1\obj\project.assets.json"), false); var sortedPackages = new List(packages); sortedPackages.Sort(); diff --git a/CycloneDX.Tests/ProjectFileServiceTests.cs b/CycloneDX.Tests/ProjectFileServiceTests.cs index 9d24e85c..255c2dd5 100755 --- a/CycloneDX.Tests/ProjectFileServiceTests.cs +++ b/CycloneDX.Tests/ProjectFileServiceTests.cs @@ -82,7 +82,7 @@ public async Task GetProjectDotnetDependencys_WithProjectAssetsFile_ReturnsDotne var mockPackageFileService = new Mock(); var mockProjectAssetsFileService = new Mock(); mockProjectAssetsFileService - .Setup(s => s.GetDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.GetDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny())) .Returns(new HashSet { new DotnetDependency { Name = "Package", Version = "1.2.3" }, @@ -93,7 +93,7 @@ public async Task GetProjectDotnetDependencys_WithProjectAssetsFile_ReturnsDotne mockPackageFileService.Object, mockProjectAssetsFileService.Object); - var packages = await projectFileService.GetProjectDotnetDependencysAsync(XFS.Path(@"c:\Project\Project.csproj"), "", false, false, "", "").ConfigureAwait(true); + var packages = await projectFileService.GetProjectDotnetDependencysAsync(XFS.Path(@"c:\Project\Project.csproj"), "", false, "", "").ConfigureAwait(true); Assert.Collection(packages, item => { @@ -117,7 +117,7 @@ public async Task GetProjectDotnetDependencys_WithProjectAssetsFileWithoutRestor var mockPackageFileService = new Mock(); var mockProjectAssetsFileService = new Mock(); mockProjectAssetsFileService - .Setup(s => s.GetDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.GetDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny())) .Returns(new HashSet { new DotnetDependency { Name = "Package", Version = "1.2.3" }, @@ -129,7 +129,7 @@ public async Task GetProjectDotnetDependencys_WithProjectAssetsFileWithoutRestor mockProjectAssetsFileService.Object); projectFileService.DisablePackageRestore = true; - var packages = await projectFileService.GetProjectDotnetDependencysAsync(XFS.Path(@"c:\Project\Project.csproj"), "", false, false, "", "").ConfigureAwait(true); + var packages = await projectFileService.GetProjectDotnetDependencysAsync(XFS.Path(@"c:\Project\Project.csproj"), "", false, "", "").ConfigureAwait(true); Assert.Collection(packages, item => { @@ -153,7 +153,7 @@ public async Task GetProjectDotnetDependencys_WithProjectAssetsFile_ReturnsMulti var mockPackageFileService = new Mock(); var mockProjectAssetsFileService = new Mock(); mockProjectAssetsFileService - .Setup(s => s.GetDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.GetDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny())) .Returns(new HashSet { new DotnetDependency { Name = "Package1", Version = "1.2.3" }, @@ -166,7 +166,7 @@ public async Task GetProjectDotnetDependencys_WithProjectAssetsFile_ReturnsMulti mockPackageFileService.Object, mockProjectAssetsFileService.Object); - var packages = await projectFileService.GetProjectDotnetDependencysAsync(XFS.Path(@"c:\Project\Project.csproj"), "", false, false, "", "").ConfigureAwait(true); + var packages = await projectFileService.GetProjectDotnetDependencysAsync(XFS.Path(@"c:\Project\Project.csproj"), "", false, "", "").ConfigureAwait(true); var sortedPackages = new List(packages); sortedPackages.Sort(); @@ -199,7 +199,7 @@ public async Task GetProjectDotnetDependencys_WithPackagesConfig_ReturnsDotnetDe ); var mockProjectAssetsFileService = new Mock(); mockProjectAssetsFileService - .Setup(s => s.GetDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.GetDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny())) .Returns(new HashSet()); var projectFileService = new ProjectFileService( mockFileSystem, @@ -207,7 +207,7 @@ public async Task GetProjectDotnetDependencys_WithPackagesConfig_ReturnsDotnetDe mockPackageFileService.Object, mockProjectAssetsFileService.Object); - var packages = await projectFileService.GetProjectDotnetDependencysAsync(XFS.Path(@"c:\Project\Project.csproj"), "", false, false, "", "").ConfigureAwait(true); + var packages = await projectFileService.GetProjectDotnetDependencysAsync(XFS.Path(@"c:\Project\Project.csproj"), "", false, "", "").ConfigureAwait(true); Assert.Collection(packages, item => { @@ -241,7 +241,7 @@ public async Task GetProjectDotnetDependencys_WithPackagesConfig_ReturnsMultiple ); var mockProjectAssetsFileService = new Mock(); mockProjectAssetsFileService - .Setup(s => s.GetDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.GetDotnetDependencys(It.IsAny(), It.IsAny(), It.IsAny())) .Returns(new HashSet()); var projectFileService = new ProjectFileService( mockFileSystem, @@ -249,7 +249,7 @@ public async Task GetProjectDotnetDependencys_WithPackagesConfig_ReturnsMultiple mockPackageFileService.Object, mockProjectAssetsFileService.Object); - var packages = await projectFileService.GetProjectDotnetDependencysAsync(XFS.Path(@"c:\Project\Project.csproj"), "", false, false, "", "").ConfigureAwait(true); + var packages = await projectFileService.GetProjectDotnetDependencysAsync(XFS.Path(@"c:\Project\Project.csproj"), "", false, "", "").ConfigureAwait(true); var sortedPackages = new List(packages); sortedPackages.Sort(); diff --git a/CycloneDX.Tests/ValidationTests.cs b/CycloneDX.Tests/ValidationTests.cs index ed1a3e97..6c73693e 100644 --- a/CycloneDX.Tests/ValidationTests.cs +++ b/CycloneDX.Tests/ValidationTests.cs @@ -38,7 +38,7 @@ public async Task Validation(string fileFormat, bool disableGitHubLicenses) var mockProjectFileService = new Mock(); mockProjectFileService.Setup(mock => - mock.GetProjectDotnetDependencysAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()) + mock.GetProjectDotnetDependencysAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()) ).ReturnsAsync(packages); Runner runner = new Runner(fileSystem: mockFileSystem, null, null, null, null, projectFileService: mockProjectFileService.Object, solutionFileService: null, null); diff --git a/CycloneDX/Interfaces/IProjectAssetsFileService.cs b/CycloneDX/Interfaces/IProjectAssetsFileService.cs index 53155de2..cc300ae8 100644 --- a/CycloneDX/Interfaces/IProjectAssetsFileService.cs +++ b/CycloneDX/Interfaces/IProjectAssetsFileService.cs @@ -22,6 +22,6 @@ namespace CycloneDX.Interfaces { public interface IProjectAssetsFileService { - HashSet GetDotnetDependencys(string projectFilePath, string projectAssetsFilePath, bool IsTestProject, bool excludeDevDependencies); + HashSet GetDotnetDependencys(string projectFilePath, string projectAssetsFilePath, bool IsTestProject); } } diff --git a/CycloneDX/Interfaces/IProjectFileService.cs b/CycloneDX/Interfaces/IProjectFileService.cs index 8265efa8..7a6728c2 100755 --- a/CycloneDX/Interfaces/IProjectFileService.cs +++ b/CycloneDX/Interfaces/IProjectFileService.cs @@ -24,9 +24,9 @@ namespace CycloneDX.Interfaces public interface IProjectFileService { bool DisablePackageRestore { get; set; } - Task> GetProjectDotnetDependencysAsync(string projectFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, bool excludeDevDependencies, string framework, string runtime); + Task> GetProjectDotnetDependencysAsync(string projectFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, string framework, string runtime); Task> GetProjectReferencesAsync(string projectFilePath); - Task> RecursivelyGetProjectDotnetDependencysAsync(string projectFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, bool excludeDevDependencies, string framework, string runtime); + Task> RecursivelyGetProjectDotnetDependencysAsync(string projectFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, string framework, string runtime); Task> RecursivelyGetProjectReferencesAsync(string projectFilePath); Component GetComponent(DotnetDependency dotnetDependency); bool IsTestProject(string projectFilePath); diff --git a/CycloneDX/Interfaces/ISolutionFileService.cs b/CycloneDX/Interfaces/ISolutionFileService.cs index c31b7e77..8c9f1849 100755 --- a/CycloneDX/Interfaces/ISolutionFileService.cs +++ b/CycloneDX/Interfaces/ISolutionFileService.cs @@ -24,6 +24,6 @@ namespace CycloneDX.Interfaces public interface ISolutionFileService { Task> GetSolutionProjectReferencesAsync(string solutionFilePath); - Task> GetSolutionDotnetDependencys(string solutionFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, bool excludeDevDependencies, string framework, string runtime); + Task> GetSolutionDotnetDependencys(string solutionFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, string framework, string runtime); } } diff --git a/CycloneDX/Runner.cs b/CycloneDX/Runner.cs index 98042afe..eaef36be 100644 --- a/CycloneDX/Runner.cs +++ b/CycloneDX/Runner.cs @@ -164,17 +164,17 @@ public async Task HandleCommandAsync(RunOptions options) { if (SolutionOrProjectFile.ToLowerInvariant().EndsWith(".sln", StringComparison.OrdinalIgnoreCase)) { - packages = await solutionFileService.GetSolutionDotnetDependencys(fullSolutionOrProjectFilePath, baseIntermediateOutputPath, excludetestprojects, excludeDev, framework, runtime).ConfigureAwait(false); + packages = await solutionFileService.GetSolutionDotnetDependencys(fullSolutionOrProjectFilePath, baseIntermediateOutputPath, excludetestprojects, framework, runtime).ConfigureAwait(false); topLevelComponent.Name = fileSystem.Path.GetFileNameWithoutExtension(SolutionOrProjectFile); } else if (Utils.IsSupportedProjectType(SolutionOrProjectFile) && scanProjectReferences) { - packages = await projectFileService.RecursivelyGetProjectDotnetDependencysAsync(fullSolutionOrProjectFilePath, baseIntermediateOutputPath, excludetestprojects, excludeDev, framework, runtime).ConfigureAwait(false); + packages = await projectFileService.RecursivelyGetProjectDotnetDependencysAsync(fullSolutionOrProjectFilePath, baseIntermediateOutputPath, excludetestprojects, framework, runtime).ConfigureAwait(false); topLevelComponent.Name = fileSystem.Path.GetFileNameWithoutExtension(SolutionOrProjectFile); } else if (Utils.IsSupportedProjectType(SolutionOrProjectFile)) { - packages = await projectFileService.GetProjectDotnetDependencysAsync(fullSolutionOrProjectFilePath, baseIntermediateOutputPath, excludetestprojects, excludeDev, framework, runtime).ConfigureAwait(false); + packages = await projectFileService.GetProjectDotnetDependencysAsync(fullSolutionOrProjectFilePath, baseIntermediateOutputPath, excludetestprojects, framework, runtime).ConfigureAwait(false); topLevelComponent.Name = fileSystem.Path.GetFileNameWithoutExtension(SolutionOrProjectFile); } else if (this.fileSystem.Path.GetFileName(SolutionOrProjectFile).ToLowerInvariant().Equals("packages.config", StringComparison.OrdinalIgnoreCase)) diff --git a/CycloneDX/Services/ProjectAssetsFileService.cs b/CycloneDX/Services/ProjectAssetsFileService.cs index 14902228..5f634ee1 100644 --- a/CycloneDX/Services/ProjectAssetsFileService.cs +++ b/CycloneDX/Services/ProjectAssetsFileService.cs @@ -17,14 +17,14 @@ using System; using System.Collections.Generic; +using System.IO; using System.IO.Abstractions; -using CycloneDX.Models; using System.Linq; using CycloneDX.Interfaces; -using NuGet.Versioning; +using CycloneDX.Models; using NuGet.LibraryModel; using NuGet.ProjectModel; -using System.IO; +using NuGet.Versioning; namespace CycloneDX.Services { @@ -39,7 +39,7 @@ public ProjectAssetsFileService(IFileSystem fileSystem, Func a _assetFileReaderFactory = assetFileReaderFactory; } - public HashSet GetDotnetDependencys(string projectFilePath, string projectAssetsFilePath, bool isTestProject, bool excludeDevDependencies) + public HashSet GetDotnetDependencys(string projectFilePath, string projectAssetsFilePath, bool isTestProject) { var packages = new HashSet(); @@ -100,21 +100,21 @@ public HashSet GetDotnetDependencys(string projectFilePath, st var allPackages = runtimePackages.Select(p => p.Name); var packagesNotInAllPackages = allDependencies.Except(allPackages); - if (excludeDevDependencies) + var realRuntimePackages = new HashSet(); + foreach (DotnetDependency dd in runtimePackages) { - var realRuntimePackages = new HashSet(); - foreach (DotnetDependency dd in runtimePackages) + if (!dd.IsDirectReference) { - if (!dd.IsDirectReference) - { - continue; - } - - ResolvedRuntimeDependencies(dd, runtimePackages, realRuntimePackages); + continue; } - runtimePackages = realRuntimePackages; - } - + + ResolvedRuntimeDependencies(dd, runtimePackages, realRuntimePackages); + } + foreach (DotnetDependency dd in runtimePackages.Except(realRuntimePackages)) + { + dd.IsDevDependency = true; + } + // Check if there is an "unresolved" dependency on NetStandard if (packagesNotInAllPackages.Any(p => p == "NETStandard.Library")) { @@ -159,8 +159,11 @@ private static void ResolvedRuntimeDependencies(DotnetDependency dotnetDependenc foreach (KeyValuePair child in dotnetDependency.Dependencies) { - DotnetDependency childDependency = allpackages.First(p => string.Equals(p.Name, child.Key, StringComparison.OrdinalIgnoreCase)); - ResolvedRuntimeDependencies(childDependency, allpackages, collectedDependencies); + DotnetDependency childDependency = allpackages.FirstOrDefault(p => string.Equals(p.Name, child.Key, StringComparison.OrdinalIgnoreCase)); + if (childDependency != null) + { + ResolvedRuntimeDependencies(childDependency, allpackages, collectedDependencies); + } } } diff --git a/CycloneDX/Services/ProjectFileService.cs b/CycloneDX/Services/ProjectFileService.cs index 58c3d1f7..27570877 100755 --- a/CycloneDX/Services/ProjectFileService.cs +++ b/CycloneDX/Services/ProjectFileService.cs @@ -148,7 +148,7 @@ static internal string GetProjectProperty(string projectFilePath, string baseInt /// /// /// - public async Task> GetProjectDotnetDependencysAsync(string projectFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, bool excludeDevDependencies, string framework, string runtime) + public async Task> GetProjectDotnetDependencysAsync(string projectFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, string framework, string runtime) { if (!_fileSystem.File.Exists(projectFilePath)) { @@ -189,7 +189,7 @@ public async Task> GetProjectDotnetDependencysAsync(st { Console.WriteLine($"File not found: \"{assetsFilename}\", \"{projectFilePath}\" "); } - var packages = _projectAssetsFileService.GetDotnetDependencys(projectFilePath, assetsFilename, isTestProject, excludeDevDependencies); + var packages = _projectAssetsFileService.GetDotnetDependencys(projectFilePath, assetsFilename, isTestProject); // if there are no project file package references look for a packages.config @@ -212,9 +212,9 @@ public async Task> GetProjectDotnetDependencysAsync(st /// /// /// - public async Task> RecursivelyGetProjectDotnetDependencysAsync(string projectFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, bool excludeDevDependencies, string framework, string runtime) + public async Task> RecursivelyGetProjectDotnetDependencysAsync(string projectFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, string framework, string runtime) { - var dotnetDependencys = await GetProjectDotnetDependencysAsync(projectFilePath, baseIntermediateOutputPath, excludeTestProjects, excludeDevDependencies, framework, runtime).ConfigureAwait(false); + var dotnetDependencys = await GetProjectDotnetDependencysAsync(projectFilePath, baseIntermediateOutputPath, excludeTestProjects, framework, runtime).ConfigureAwait(false); foreach (var item in dotnetDependencys) { item.IsDirectReference = true; @@ -230,7 +230,7 @@ public async Task> RecursivelyGetProjectDotnetDependen foreach (var project in projectReferences) { - var projectDotnetDependencys = await GetProjectDotnetDependencysAsync(project.Path, baseIntermediateOutputPath, excludeTestProjects, excludeDevDependencies, framework, runtime).ConfigureAwait(false); + var projectDotnetDependencys = await GetProjectDotnetDependencysAsync(project.Path, baseIntermediateOutputPath, excludeTestProjects, framework, runtime).ConfigureAwait(false); //Add dependencies for dependency graph foreach (var dependency in projectDotnetDependencys) diff --git a/CycloneDX/Services/SolutionFileService.cs b/CycloneDX/Services/SolutionFileService.cs index bf0eded2..bddb211e 100755 --- a/CycloneDX/Services/SolutionFileService.cs +++ b/CycloneDX/Services/SolutionFileService.cs @@ -82,7 +82,7 @@ public async Task> GetSolutionProjectReferencesAsync(string solu /// /// /// - public async Task> GetSolutionDotnetDependencys(string solutionFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, bool excludeDevDependencies, string framework, string runtime) + public async Task> GetSolutionDotnetDependencys(string solutionFilePath, string baseIntermediateOutputPath, bool excludeTestProjects, string framework, string runtime) { if (!_fileSystem.File.Exists(solutionFilePath)) { @@ -113,7 +113,7 @@ public async Task> GetSolutionDotnetDependencys(string foreach (var projectFilePath in projectQuery) { Console.WriteLine(); - var projectPackages = await _projectFileService.GetProjectDotnetDependencysAsync(projectFilePath, baseIntermediateOutputPath, excludeTestProjects, excludeDevDependencies, framework, runtime).ConfigureAwait(false); + var projectPackages = await _projectFileService.GetProjectDotnetDependencysAsync(projectFilePath, baseIntermediateOutputPath, excludeTestProjects, framework, runtime).ConfigureAwait(false); directReferencePackages.UnionWith(projectPackages.Where(p => p.IsDirectReference)); packages.UnionWith(projectPackages); } From 50098cf5182cd0392bb6ef73329a629ac86de701 Mon Sep 17 00:00:00 2001 From: MTsfoni Date: Sun, 11 Feb 2024 23:38:23 +0100 Subject: [PATCH 4/6] Adding test case with transitive dev-dependencies to better represent the problem with privatAssets. Signed-off-by: MTsfoni --- CycloneDX.Tests/CycloneDX.Tests.csproj | 6 + .../FineGrainedDependency.csproj.xml | 3 + .../Issue847FineGrainedDevDependencies.cs | 97 ++ ...ainedDependency.csproj.project.assets.json | 911 ++++++++++++++++++ .../ReferingFineGrainedDependency.csproj.xml | 15 + 5 files changed, 1032 insertions(+) create mode 100644 CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/Issue847FineGrainedDevDependencies.cs create mode 100644 CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/ReferingFineGrainedDependency.csproj.project.assets.json create mode 100644 CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/ReferingFineGrainedDependency.csproj.xml diff --git a/CycloneDX.Tests/CycloneDX.Tests.csproj b/CycloneDX.Tests/CycloneDX.Tests.csproj index a6ff1369..a39fea2d 100644 --- a/CycloneDX.Tests/CycloneDX.Tests.csproj +++ b/CycloneDX.Tests/CycloneDX.Tests.csproj @@ -60,6 +60,12 @@ Always + + Always + + + Always + Always diff --git a/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/FineGrainedDependency.csproj.xml b/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/FineGrainedDependency.csproj.xml index 099a769a..e96599f4 100644 --- a/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/FineGrainedDependency.csproj.xml +++ b/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/FineGrainedDependency.csproj.xml @@ -1,3 +1,6 @@ + diff --git a/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/Issue847FineGrainedDevDependencies.cs b/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/Issue847FineGrainedDevDependencies.cs new file mode 100644 index 00000000..5cdfca5a --- /dev/null +++ b/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/Issue847FineGrainedDevDependencies.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.IO.Abstractions; +using System.IO.Abstractions.TestingHelpers; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CycloneDX.Models; +using Xunit; + +namespace CycloneDX.Tests.FunctionalTests +{ + public class Issue847FineGrainedDevDependencies + { + readonly string testFileFolder = "Issue847-FineGrainedDependencies"; + readonly string fineGrainedProject = "c:/project2/project2.csproj"; + readonly string referingFineGrainedProjectProject = "c:/project1/project1.csproj"; + + private MockFileSystem getMockFS() + { + return new MockFileSystem(new Dictionary + { + { + MockUnixSupport.Path("c:/project1/obj/project.assets.json"), + new MockFileData( + File.ReadAllText(Path.Combine("FunctionalTests", testFileFolder, "ReferingFineGrainedDependency.csproj.project.assets.json"))) + },{ + MockUnixSupport.Path("c:/project2/obj/project.assets.json"), + new MockFileData( + File.ReadAllText(Path.Combine("FunctionalTests", testFileFolder, "FineGrainedDependency.csproj.project.assets.json"))) + },{ + MockUnixSupport.Path(referingFineGrainedProjectProject), + new MockFileData( + File.ReadAllText(Path.Combine("FunctionalTests", testFileFolder, "ReferingFineGrainedDependency.csproj.xml"))) + },{ + MockUnixSupport.Path(fineGrainedProject), + new MockFileData( + File.ReadAllText(Path.Combine("FunctionalTests", testFileFolder, "FineGrainedDependency.csproj.xml"))) + } + }); + } + + [Fact] + public async Task DevDependenciesAreIncludedWhenOptionNotSet() + { + var options = new RunOptions + { + excludeDev = false, + SolutionOrProjectFile = fineGrainedProject + }; + var bom = await FunctionalTestHelper.Test(options, getMockFS()); + + Assert.Contains(bom.Components, c => string.Compare(c.Name, "Google.Protobuf", true) == 0); + Assert.Contains(bom.Components, c => string.Compare(c.Name, "log4net", true) == 0); + Assert.Contains(bom.Components, c => string.Compare(c.Name, "Newtonsoft.Json", true) == 0); + Assert.Contains(bom.Components, c => string.Compare(c.Name, "Serilog", true) == 0); + Assert.Contains(bom.Components, c => string.Compare(c.Name, "Microsoft.Extensions.Logging", true) == 0); + } + + [Fact] + public async Task DevDependenciesAreExcluded() + { + var options = new RunOptions + { + excludeDev = true, + SolutionOrProjectFile = fineGrainedProject + }; + var bom = await FunctionalTestHelper.Test(options, getMockFS()); + + Assert.Contains(bom.Components, c => string.Compare(c.Name, "Google.Protobuf", true) == 0); + Assert.Contains(bom.Components, c => string.Compare(c.Name, "log4net", true) == 0); + Assert.Contains(bom.Components, c => string.Compare(c.Name, "Newtonsoft.Json", true) == 0); + Assert.Contains(bom.Components, c => string.Compare(c.Name, "Serilog", true) == 0); + Assert.DoesNotContain(bom.Components, c => string.Compare(c.Name, "Microsoft.Extensions.Logging", true) == 0); + } + + [Fact] + public async Task TransitiveDevDependenciesAreExcluded() + { + var options = new RunOptions + { + excludeDev = true, + SolutionOrProjectFile = referingFineGrainedProjectProject + }; + var bom = await FunctionalTestHelper.Test(options, getMockFS()); + + Assert.Contains(bom.Components, c => string.Compare(c.Name, "Google.Protobuf", true) == 0); + Assert.Contains(bom.Components, c => string.Compare(c.Name, "log4net", true) == 0); + Assert.Contains(bom.Components, c => string.Compare(c.Name, "Newtonsoft.Json", true) == 0); + Assert.DoesNotContain(bom.Components, c => string.Compare(c.Name, "Serilog", true) == 0); + Assert.DoesNotContain(bom.Components, c => string.Compare(c.Name, "Microsoft.Extensions.Logging", true) == 0); + } + + } +} diff --git a/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/ReferingFineGrainedDependency.csproj.project.assets.json b/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/ReferingFineGrainedDependency.csproj.project.assets.json new file mode 100644 index 00000000..3e1d3492 --- /dev/null +++ b/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/ReferingFineGrainedDependency.csproj.project.assets.json @@ -0,0 +1,911 @@ +{ + "version": 3, + "targets": { + "net8.0": { + "Google.Protobuf/3.25.2": { + "type": "package", + "compile": { + "lib/net5.0/Google.Protobuf.dll": { + "related": ".pdb;.xml" + } + }, + "runtime": { + "lib/net5.0/Google.Protobuf.dll": { + "related": ".pdb;.xml" + } + } + }, + "log4net/2.0.15": { + "type": "package", + "dependencies": { + "System.Configuration.ConfigurationManager": "4.5.0" + }, + "compile": { + "lib/netstandard2.0/log4net.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/log4net.dll": { + "related": ".xml" + } + } + }, + "Microsoft.Extensions.DependencyInjection/8.0.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0" + }, + "compile": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.0": { + "type": "package", + "compile": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "Microsoft.Extensions.Logging/8.0.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.DependencyInjection": "8.0.0", + "Microsoft.Extensions.Logging.Abstractions": "8.0.0", + "Microsoft.Extensions.Options": "8.0.0" + }, + "compile": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0" + }, + "compile": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "Microsoft.Extensions.Options/8.0.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", + "Microsoft.Extensions.Primitives": "8.0.0" + }, + "compile": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "Microsoft.Extensions.Primitives/8.0.0": { + "type": "package", + "compile": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net6.0/_._": {} + } + }, + "Microsoft.NETCore.Platforms/2.0.0": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "compile": { + "lib/net6.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "related": ".xml" + } + } + }, + "Serilog/3.1.1": { + "type": "package", + "compile": { + "lib/net7.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net7.0/Serilog.dll": { + "related": ".xml" + } + } + }, + "System.Configuration.ConfigurationManager/4.5.0": { + "type": "package", + "dependencies": { + "System.Security.Cryptography.ProtectedData": "4.5.0", + "System.Security.Permissions": "4.5.0" + }, + "compile": { + "ref/netstandard2.0/System.Configuration.ConfigurationManager.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Configuration.ConfigurationManager.dll": {} + } + }, + "System.Security.AccessControl/4.5.0": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "2.0.0", + "System.Security.Principal.Windows": "4.5.0" + }, + "compile": { + "ref/netstandard2.0/System.Security.AccessControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Security.AccessControl.dll": {} + }, + "runtimeTargets": { + "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "type": "package", + "compile": { + "ref/netstandard2.0/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": {} + }, + "runtimeTargets": { + "runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "System.Security.Permissions/4.5.0": { + "type": "package", + "dependencies": { + "System.Security.AccessControl": "4.5.0" + }, + "compile": { + "ref/netstandard2.0/System.Security.Permissions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Security.Permissions.dll": {} + } + }, + "System.Security.Principal.Windows/4.5.0": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "2.0.0" + }, + "compile": { + "ref/netstandard2.0/System.Security.Principal.Windows.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Security.Principal.Windows.dll": {} + }, + "runtimeTargets": { + "runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.dll": { + "assetType": "runtime", + "rid": "unix" + }, + "runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.dll": { + "assetType": "runtime", + "rid": "win" + } + } + } + } + }, + "libraries": { + "Google.Protobuf/3.25.2": { + "sha512": "g/xIIeLhR77bl4ajGGbPYRmZf5acJlCRaSBqUnU8+2aQYREnZnv+UccRNndHof4mWO1ORS0b5i6on40VOjBpsg==", + "type": "package", + "path": "google.protobuf/3.25.2", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "google.protobuf.3.25.2.nupkg.sha512", + "google.protobuf.nuspec", + "lib/net45/Google.Protobuf.dll", + "lib/net45/Google.Protobuf.pdb", + "lib/net45/Google.Protobuf.xml", + "lib/net5.0/Google.Protobuf.dll", + "lib/net5.0/Google.Protobuf.pdb", + "lib/net5.0/Google.Protobuf.xml", + "lib/netstandard1.1/Google.Protobuf.dll", + "lib/netstandard1.1/Google.Protobuf.pdb", + "lib/netstandard1.1/Google.Protobuf.xml", + "lib/netstandard2.0/Google.Protobuf.dll", + "lib/netstandard2.0/Google.Protobuf.pdb", + "lib/netstandard2.0/Google.Protobuf.xml" + ] + }, + "log4net/2.0.15": { + "sha512": "GahnO9ZgFka+xYcFwAfIFjW+k86P2nxFoaEpH6t3v4hiGj7tv2ksVZphxCVIHmJxoySS0HeU3dgCW+bSCcfD0A==", + "type": "package", + "path": "log4net/2.0.15", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net20/log4net.dll", + "lib/net20/log4net.xml", + "lib/net35/log4net.dll", + "lib/net35/log4net.xml", + "lib/net40-client/log4net.dll", + "lib/net40-client/log4net.xml", + "lib/net40/log4net.dll", + "lib/net40/log4net.xml", + "lib/net45/log4net.dll", + "lib/net45/log4net.xml", + "lib/netstandard1.3/log4net.dll", + "lib/netstandard1.3/log4net.xml", + "lib/netstandard2.0/log4net.dll", + "lib/netstandard2.0/log4net.xml", + "log4net.2.0.15.nupkg.sha512", + "log4net.nuspec", + "package-icon.png" + ] + }, + "Microsoft.Extensions.DependencyInjection/8.0.0": { + "sha512": "V8S3bsm50ig6JSyrbcJJ8bW2b9QLGouz+G1miK3UTaOWmMtFwNNNzUf4AleyDWUmTrWMLNnFSLEQtxmxgNQnNQ==", + "type": "package", + "path": "microsoft.extensions.dependencyinjection/8.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/Microsoft.Extensions.DependencyInjection.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.DependencyInjection.targets", + "lib/net462/Microsoft.Extensions.DependencyInjection.dll", + "lib/net462/Microsoft.Extensions.DependencyInjection.xml", + "lib/net6.0/Microsoft.Extensions.DependencyInjection.dll", + "lib/net6.0/Microsoft.Extensions.DependencyInjection.xml", + "lib/net7.0/Microsoft.Extensions.DependencyInjection.dll", + "lib/net7.0/Microsoft.Extensions.DependencyInjection.xml", + "lib/net8.0/Microsoft.Extensions.DependencyInjection.dll", + "lib/net8.0/Microsoft.Extensions.DependencyInjection.xml", + "lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.dll", + "lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.xml", + "lib/netstandard2.1/Microsoft.Extensions.DependencyInjection.dll", + "lib/netstandard2.1/Microsoft.Extensions.DependencyInjection.xml", + "microsoft.extensions.dependencyinjection.8.0.0.nupkg.sha512", + "microsoft.extensions.dependencyinjection.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.0": { + "sha512": "cjWrLkJXK0rs4zofsK4bSdg+jhDLTaxrkXu4gS6Y7MAlCvRyNNgwY/lJi5RDlQOnSZweHqoyvgvbdvQsRIW+hg==", + "type": "package", + "path": "microsoft.extensions.dependencyinjection.abstractions/8.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/Microsoft.Extensions.DependencyInjection.Abstractions.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.DependencyInjection.Abstractions.targets", + "lib/net462/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net462/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/net7.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net7.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "lib/netstandard2.1/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "lib/netstandard2.1/Microsoft.Extensions.DependencyInjection.Abstractions.xml", + "microsoft.extensions.dependencyinjection.abstractions.8.0.0.nupkg.sha512", + "microsoft.extensions.dependencyinjection.abstractions.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Logging/8.0.0": { + "sha512": "tvRkov9tAJ3xP51LCv3FJ2zINmv1P8Hi8lhhtcKGqM+ImiTCC84uOPEI4z8Cdq2C3o9e+Aa0Gw0rmrsJD77W+w==", + "type": "package", + "path": "microsoft.extensions.logging/8.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/Microsoft.Extensions.Logging.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.Logging.targets", + "lib/net462/Microsoft.Extensions.Logging.dll", + "lib/net462/Microsoft.Extensions.Logging.xml", + "lib/net6.0/Microsoft.Extensions.Logging.dll", + "lib/net6.0/Microsoft.Extensions.Logging.xml", + "lib/net7.0/Microsoft.Extensions.Logging.dll", + "lib/net7.0/Microsoft.Extensions.Logging.xml", + "lib/net8.0/Microsoft.Extensions.Logging.dll", + "lib/net8.0/Microsoft.Extensions.Logging.xml", + "lib/netstandard2.0/Microsoft.Extensions.Logging.dll", + "lib/netstandard2.0/Microsoft.Extensions.Logging.xml", + "lib/netstandard2.1/Microsoft.Extensions.Logging.dll", + "lib/netstandard2.1/Microsoft.Extensions.Logging.xml", + "microsoft.extensions.logging.8.0.0.nupkg.sha512", + "microsoft.extensions.logging.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Logging.Abstractions/8.0.0": { + "sha512": "arDBqTgFCyS0EvRV7O3MZturChstm50OJ0y9bDJvAcmEPJm0FFpFyjU/JLYyStNGGey081DvnQYlncNX5SJJGA==", + "type": "package", + "path": "microsoft.extensions.logging.abstractions/8.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "analyzers/dotnet/roslyn3.11/cs/Microsoft.Extensions.Logging.Generators.dll", + "analyzers/dotnet/roslyn3.11/cs/cs/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/de/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/es/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/fr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/it/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ja/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ko/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/pl/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/pt-BR/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ru/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/tr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/zh-Hans/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/zh-Hant/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/Microsoft.Extensions.Logging.Generators.dll", + "analyzers/dotnet/roslyn4.0/cs/cs/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/de/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/es/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/fr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/it/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ja/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ko/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/pl/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/pt-BR/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ru/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/tr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/zh-Hans/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/zh-Hant/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/Microsoft.Extensions.Logging.Generators.dll", + "analyzers/dotnet/roslyn4.4/cs/cs/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/de/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/es/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/fr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/it/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ja/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ko/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/pl/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/pt-BR/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ru/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/tr/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/zh-Hans/Microsoft.Extensions.Logging.Generators.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/zh-Hant/Microsoft.Extensions.Logging.Generators.resources.dll", + "buildTransitive/net461/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/net462/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/net6.0/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.Logging.Abstractions.targets", + "buildTransitive/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.targets", + "lib/net462/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net462/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/net6.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net6.0/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/net7.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net7.0/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.xml", + "lib/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.xml", + "microsoft.extensions.logging.abstractions.8.0.0.nupkg.sha512", + "microsoft.extensions.logging.abstractions.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Options/8.0.0": { + "sha512": "JOVOfqpnqlVLUzINQ2fox8evY2SKLYJ3BV8QDe/Jyp21u1T7r45x/R/5QdteURMR5r01GxeJSBBUOCOyaNXA3g==", + "type": "package", + "path": "microsoft.extensions.options/8.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "analyzers/dotnet/roslyn4.4/cs/Microsoft.Extensions.Options.SourceGeneration.dll", + "analyzers/dotnet/roslyn4.4/cs/cs/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/de/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/es/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/fr/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/it/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ja/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ko/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/pl/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/pt-BR/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ru/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/tr/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/zh-Hans/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/zh-Hant/Microsoft.Extensions.Options.SourceGeneration.resources.dll", + "buildTransitive/net461/Microsoft.Extensions.Options.targets", + "buildTransitive/net462/Microsoft.Extensions.Options.targets", + "buildTransitive/net6.0/Microsoft.Extensions.Options.targets", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.Options.targets", + "buildTransitive/netstandard2.0/Microsoft.Extensions.Options.targets", + "lib/net462/Microsoft.Extensions.Options.dll", + "lib/net462/Microsoft.Extensions.Options.xml", + "lib/net6.0/Microsoft.Extensions.Options.dll", + "lib/net6.0/Microsoft.Extensions.Options.xml", + "lib/net7.0/Microsoft.Extensions.Options.dll", + "lib/net7.0/Microsoft.Extensions.Options.xml", + "lib/net8.0/Microsoft.Extensions.Options.dll", + "lib/net8.0/Microsoft.Extensions.Options.xml", + "lib/netstandard2.0/Microsoft.Extensions.Options.dll", + "lib/netstandard2.0/Microsoft.Extensions.Options.xml", + "lib/netstandard2.1/Microsoft.Extensions.Options.dll", + "lib/netstandard2.1/Microsoft.Extensions.Options.xml", + "microsoft.extensions.options.8.0.0.nupkg.sha512", + "microsoft.extensions.options.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Extensions.Primitives/8.0.0": { + "sha512": "bXJEZrW9ny8vjMF1JV253WeLhpEVzFo1lyaZu1vQ4ZxWUlVvknZ/+ftFgVheLubb4eZPSwwxBeqS1JkCOjxd8g==", + "type": "package", + "path": "microsoft.extensions.primitives/8.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/Microsoft.Extensions.Primitives.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/Microsoft.Extensions.Primitives.targets", + "lib/net462/Microsoft.Extensions.Primitives.dll", + "lib/net462/Microsoft.Extensions.Primitives.xml", + "lib/net6.0/Microsoft.Extensions.Primitives.dll", + "lib/net6.0/Microsoft.Extensions.Primitives.xml", + "lib/net7.0/Microsoft.Extensions.Primitives.dll", + "lib/net7.0/Microsoft.Extensions.Primitives.xml", + "lib/net8.0/Microsoft.Extensions.Primitives.dll", + "lib/net8.0/Microsoft.Extensions.Primitives.xml", + "lib/netstandard2.0/Microsoft.Extensions.Primitives.dll", + "lib/netstandard2.0/Microsoft.Extensions.Primitives.xml", + "microsoft.extensions.primitives.8.0.0.nupkg.sha512", + "microsoft.extensions.primitives.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.NETCore.Platforms/2.0.0": { + "sha512": "VdLJOCXhZaEMY7Hm2GKiULmn7IEPFE4XC5LPSfBVCUIA8YLZVh846gtfBJalsPQF2PlzdD7ecX7DZEulJ402ZQ==", + "type": "package", + "path": "microsoft.netcore.platforms/2.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/netstandard1.0/_._", + "microsoft.netcore.platforms.2.0.0.nupkg.sha512", + "microsoft.netcore.platforms.nuspec", + "runtime.json", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "Newtonsoft.Json/13.0.3": { + "sha512": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "type": "package", + "path": "newtonsoft.json/13.0.3", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.md", + "README.md", + "lib/net20/Newtonsoft.Json.dll", + "lib/net20/Newtonsoft.Json.xml", + "lib/net35/Newtonsoft.Json.dll", + "lib/net35/Newtonsoft.Json.xml", + "lib/net40/Newtonsoft.Json.dll", + "lib/net40/Newtonsoft.Json.xml", + "lib/net45/Newtonsoft.Json.dll", + "lib/net45/Newtonsoft.Json.xml", + "lib/net6.0/Newtonsoft.Json.dll", + "lib/net6.0/Newtonsoft.Json.xml", + "lib/netstandard1.0/Newtonsoft.Json.dll", + "lib/netstandard1.0/Newtonsoft.Json.xml", + "lib/netstandard1.3/Newtonsoft.Json.dll", + "lib/netstandard1.3/Newtonsoft.Json.xml", + "lib/netstandard2.0/Newtonsoft.Json.dll", + "lib/netstandard2.0/Newtonsoft.Json.xml", + "newtonsoft.json.13.0.3.nupkg.sha512", + "newtonsoft.json.nuspec", + "packageIcon.png" + ] + }, + "Serilog/3.1.1": { + "sha512": "P6G4/4Kt9bT635bhuwdXlJ2SCqqn2nhh4gqFqQueCOr9bK/e7W9ll/IoX1Ter948cV2Z/5+5v8pAfJYUISY03A==", + "type": "package", + "path": "serilog/3.1.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "README.md", + "icon.png", + "lib/net462/Serilog.dll", + "lib/net462/Serilog.xml", + "lib/net471/Serilog.dll", + "lib/net471/Serilog.xml", + "lib/net5.0/Serilog.dll", + "lib/net5.0/Serilog.xml", + "lib/net6.0/Serilog.dll", + "lib/net6.0/Serilog.xml", + "lib/net7.0/Serilog.dll", + "lib/net7.0/Serilog.xml", + "lib/netstandard2.0/Serilog.dll", + "lib/netstandard2.0/Serilog.xml", + "lib/netstandard2.1/Serilog.dll", + "lib/netstandard2.1/Serilog.xml", + "serilog.3.1.1.nupkg.sha512", + "serilog.nuspec" + ] + }, + "System.Configuration.ConfigurationManager/4.5.0": { + "sha512": "UIFvaFfuKhLr9u5tWMxmVoDPkFeD+Qv8gUuap4aZgVGYSYMdERck4OhLN/2gulAc0nYTEigWXSJNNWshrmxnng==", + "type": "package", + "path": "system.configuration.configurationmanager/4.5.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/System.Configuration.ConfigurationManager.dll", + "lib/netstandard2.0/System.Configuration.ConfigurationManager.dll", + "ref/net461/System.Configuration.ConfigurationManager.dll", + "ref/net461/System.Configuration.ConfigurationManager.xml", + "ref/netstandard2.0/System.Configuration.ConfigurationManager.dll", + "ref/netstandard2.0/System.Configuration.ConfigurationManager.xml", + "system.configuration.configurationmanager.4.5.0.nupkg.sha512", + "system.configuration.configurationmanager.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Security.AccessControl/4.5.0": { + "sha512": "vW8Eoq0TMyz5vAG/6ce483x/CP83fgm4SJe5P8Tb1tZaobcvPrbMEL7rhH1DRdrYbbb6F0vq3OlzmK0Pkwks5A==", + "type": "package", + "path": "system.security.accesscontrol/4.5.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net46/System.Security.AccessControl.dll", + "lib/net461/System.Security.AccessControl.dll", + "lib/netstandard1.3/System.Security.AccessControl.dll", + "lib/netstandard2.0/System.Security.AccessControl.dll", + "lib/uap10.0.16299/_._", + "ref/net46/System.Security.AccessControl.dll", + "ref/net461/System.Security.AccessControl.dll", + "ref/net461/System.Security.AccessControl.xml", + "ref/netstandard1.3/System.Security.AccessControl.dll", + "ref/netstandard1.3/System.Security.AccessControl.xml", + "ref/netstandard1.3/de/System.Security.AccessControl.xml", + "ref/netstandard1.3/es/System.Security.AccessControl.xml", + "ref/netstandard1.3/fr/System.Security.AccessControl.xml", + "ref/netstandard1.3/it/System.Security.AccessControl.xml", + "ref/netstandard1.3/ja/System.Security.AccessControl.xml", + "ref/netstandard1.3/ko/System.Security.AccessControl.xml", + "ref/netstandard1.3/ru/System.Security.AccessControl.xml", + "ref/netstandard1.3/zh-hans/System.Security.AccessControl.xml", + "ref/netstandard1.3/zh-hant/System.Security.AccessControl.xml", + "ref/netstandard2.0/System.Security.AccessControl.dll", + "ref/netstandard2.0/System.Security.AccessControl.xml", + "ref/uap10.0.16299/_._", + "runtimes/win/lib/net46/System.Security.AccessControl.dll", + "runtimes/win/lib/net461/System.Security.AccessControl.dll", + "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll", + "runtimes/win/lib/netstandard1.3/System.Security.AccessControl.dll", + "runtimes/win/lib/uap10.0.16299/_._", + "system.security.accesscontrol.4.5.0.nupkg.sha512", + "system.security.accesscontrol.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "sha512": "wLBKzFnDCxP12VL9ANydSYhk59fC4cvOr9ypYQLPnAj48NQIhqnjdD2yhP8yEKyBJEjERWS9DisKL7rX5eU25Q==", + "type": "package", + "path": "system.security.cryptography.protecteddata/4.5.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.Security.Cryptography.ProtectedData.dll", + "lib/net461/System.Security.Cryptography.ProtectedData.dll", + "lib/netstandard1.3/System.Security.Cryptography.ProtectedData.dll", + "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/System.Security.Cryptography.ProtectedData.dll", + "ref/net461/System.Security.Cryptography.ProtectedData.dll", + "ref/net461/System.Security.Cryptography.ProtectedData.xml", + "ref/netstandard1.3/System.Security.Cryptography.ProtectedData.dll", + "ref/netstandard2.0/System.Security.Cryptography.ProtectedData.dll", + "ref/netstandard2.0/System.Security.Cryptography.ProtectedData.xml", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._", + "runtimes/win/lib/net46/System.Security.Cryptography.ProtectedData.dll", + "runtimes/win/lib/net461/System.Security.Cryptography.ProtectedData.dll", + "runtimes/win/lib/netstandard1.3/System.Security.Cryptography.ProtectedData.dll", + "runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll", + "system.security.cryptography.protecteddata.4.5.0.nupkg.sha512", + "system.security.cryptography.protecteddata.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Security.Permissions/4.5.0": { + "sha512": "9gdyuARhUR7H+p5CjyUB/zPk7/Xut3wUSP8NJQB6iZr8L3XUXTMdoLeVAg9N4rqF8oIpE7MpdqHdDHQ7XgJe0g==", + "type": "package", + "path": "system.security.permissions/4.5.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/System.Security.Permissions.dll", + "lib/netstandard2.0/System.Security.Permissions.dll", + "ref/net461/System.Security.Permissions.dll", + "ref/net461/System.Security.Permissions.xml", + "ref/netstandard2.0/System.Security.Permissions.dll", + "ref/netstandard2.0/System.Security.Permissions.xml", + "system.security.permissions.4.5.0.nupkg.sha512", + "system.security.permissions.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Security.Principal.Windows/4.5.0": { + "sha512": "U77HfRXlZlOeIXd//Yoj6Jnk8AXlbeisf1oq1os+hxOGVnuG+lGSfGqTwTZBoORFF6j/0q7HXIl8cqwQ9aUGqQ==", + "type": "package", + "path": "system.security.principal.windows/4.5.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net46/System.Security.Principal.Windows.dll", + "lib/net461/System.Security.Principal.Windows.dll", + "lib/netstandard1.3/System.Security.Principal.Windows.dll", + "lib/netstandard2.0/System.Security.Principal.Windows.dll", + "lib/uap10.0.16299/_._", + "ref/net46/System.Security.Principal.Windows.dll", + "ref/net461/System.Security.Principal.Windows.dll", + "ref/net461/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/System.Security.Principal.Windows.dll", + "ref/netstandard1.3/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/de/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/es/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/fr/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/it/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ja/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ko/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ru/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/zh-hans/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/zh-hant/System.Security.Principal.Windows.xml", + "ref/netstandard2.0/System.Security.Principal.Windows.dll", + "ref/netstandard2.0/System.Security.Principal.Windows.xml", + "ref/uap10.0.16299/_._", + "runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.dll", + "runtimes/win/lib/net46/System.Security.Principal.Windows.dll", + "runtimes/win/lib/net461/System.Security.Principal.Windows.dll", + "runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.dll", + "runtimes/win/lib/netstandard1.3/System.Security.Principal.Windows.dll", + "runtimes/win/lib/uap10.0.16299/_._", + "system.security.principal.windows.4.5.0.nupkg.sha512", + "system.security.principal.windows.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + } + }, + "projectFileDependencyGroups": { + "net8.0": [ + "Google.Protobuf >= 3.25.2", + "Microsoft.Extensions.Logging >= 8.0.0", + "Newtonsoft.Json >= 13.0.3", + "Serilog >= 3.1.1", + "log4net >= 2.0.15" + ] + }, + "packageFolders": { + "C:\\Users\\user\\.nuget\\packages\\": {}, + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "E:\\src\\CycloneDX-847\\ConsoleApp1\\ConsoleApp1\\ConsoleApp1.csproj", + "projectName": "ConsoleApp1", + "projectPath": "E:\\src\\CycloneDX-847\\ConsoleApp1\\ConsoleApp1\\ConsoleApp1.csproj", + "packagesPath": "C:\\Users\\user\\.nuget\\packages\\", + "outputPath": "E:\\src\\CycloneDX-847\\ConsoleApp1\\ConsoleApp1\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\user\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net8.0" + ], + "sources": { + "C:\\Program Files\\dotnet\\library-packs": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "dependencies": { + "Google.Protobuf": { + "suppressParent": "Build, Analyzers", + "target": "Package", + "version": "[3.25.2, )" + }, + "Microsoft.Extensions.Logging": { + "include": "None", + "target": "Package", + "version": "[8.0.0, )" + }, + "Newtonsoft.Json": { + "include": "Runtime", + "target": "Package", + "version": "[13.0.3, )" + }, + "Serilog": { + "include": "Runtime", + "suppressParent": "All", + "target": "Package", + "version": "[3.1.1, )" + }, + "log4net": { + "target": "Package", + "version": "[2.0.15, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.101/PortableRuntimeIdentifierGraph.json" + } + } + } +} diff --git a/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/ReferingFineGrainedDependency.csproj.xml b/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/ReferingFineGrainedDependency.csproj.xml new file mode 100644 index 00000000..1fabad6d --- /dev/null +++ b/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/ReferingFineGrainedDependency.csproj.xml @@ -0,0 +1,15 @@ + + + + + Exe + net8.0 + + + + + + + From 98669c94d371805ecdb8c83e6a3b7ce2fad5924b Mon Sep 17 00:00:00 2001 From: MTsfoni Date: Sun, 11 Feb 2024 23:40:58 +0100 Subject: [PATCH 5/6] fix: As always I forgot about the linux paths Signed-off-by: MTsfoni --- .../Issue847FineGrainedDevDependencies.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/Issue847FineGrainedDevDependencies.cs b/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/Issue847FineGrainedDevDependencies.cs index 5cdfca5a..a1e916df 100644 --- a/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/Issue847FineGrainedDevDependencies.cs +++ b/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/Issue847FineGrainedDevDependencies.cs @@ -48,7 +48,7 @@ public async Task DevDependenciesAreIncludedWhenOptionNotSet() var options = new RunOptions { excludeDev = false, - SolutionOrProjectFile = fineGrainedProject + SolutionOrProjectFile = MockUnixSupport.Path(fineGrainedProject) }; var bom = await FunctionalTestHelper.Test(options, getMockFS()); @@ -65,7 +65,7 @@ public async Task DevDependenciesAreExcluded() var options = new RunOptions { excludeDev = true, - SolutionOrProjectFile = fineGrainedProject + SolutionOrProjectFile = MockUnixSupport.Path(fineGrainedProject) }; var bom = await FunctionalTestHelper.Test(options, getMockFS()); @@ -82,7 +82,7 @@ public async Task TransitiveDevDependenciesAreExcluded() var options = new RunOptions { excludeDev = true, - SolutionOrProjectFile = referingFineGrainedProjectProject + SolutionOrProjectFile = MockUnixSupport.Path(referingFineGrainedProjectProject) }; var bom = await FunctionalTestHelper.Test(options, getMockFS()); From eb6b3cf958728e9e894dc3240a3440cbabb48ac5 Mon Sep 17 00:00:00 2001 From: MTsfoni Date: Sun, 11 Feb 2024 23:47:04 +0100 Subject: [PATCH 6/6] Correct spelling referRing Signed-off-by: MTsfoni --- CycloneDX.Tests/CycloneDX.Tests.csproj | 4 ++-- .../Issue847FineGrainedDevDependencies.cs | 10 +++++----- ...ngFineGrainedDependency.csproj.project.assets.json} | 0 ...j.xml => ReferringFineGrainedDependency.csproj.xml} | 0 4 files changed, 7 insertions(+), 7 deletions(-) rename CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/{ReferingFineGrainedDependency.csproj.project.assets.json => ReferringFineGrainedDependency.csproj.project.assets.json} (100%) rename CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/{ReferingFineGrainedDependency.csproj.xml => ReferringFineGrainedDependency.csproj.xml} (100%) diff --git a/CycloneDX.Tests/CycloneDX.Tests.csproj b/CycloneDX.Tests/CycloneDX.Tests.csproj index a39fea2d..6e2d1f31 100644 --- a/CycloneDX.Tests/CycloneDX.Tests.csproj +++ b/CycloneDX.Tests/CycloneDX.Tests.csproj @@ -60,10 +60,10 @@ Always - + Always - + Always diff --git a/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/Issue847FineGrainedDevDependencies.cs b/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/Issue847FineGrainedDevDependencies.cs index a1e916df..ee4355a3 100644 --- a/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/Issue847FineGrainedDevDependencies.cs +++ b/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/Issue847FineGrainedDevDependencies.cs @@ -16,7 +16,7 @@ public class Issue847FineGrainedDevDependencies { readonly string testFileFolder = "Issue847-FineGrainedDependencies"; readonly string fineGrainedProject = "c:/project2/project2.csproj"; - readonly string referingFineGrainedProjectProject = "c:/project1/project1.csproj"; + readonly string referringFineGrainedProjectProject = "c:/project1/project1.csproj"; private MockFileSystem getMockFS() { @@ -25,15 +25,15 @@ private MockFileSystem getMockFS() { MockUnixSupport.Path("c:/project1/obj/project.assets.json"), new MockFileData( - File.ReadAllText(Path.Combine("FunctionalTests", testFileFolder, "ReferingFineGrainedDependency.csproj.project.assets.json"))) + File.ReadAllText(Path.Combine("FunctionalTests", testFileFolder, "ReferringFineGrainedDependency.csproj.project.assets.json"))) },{ MockUnixSupport.Path("c:/project2/obj/project.assets.json"), new MockFileData( File.ReadAllText(Path.Combine("FunctionalTests", testFileFolder, "FineGrainedDependency.csproj.project.assets.json"))) },{ - MockUnixSupport.Path(referingFineGrainedProjectProject), + MockUnixSupport.Path(referringFineGrainedProjectProject), new MockFileData( - File.ReadAllText(Path.Combine("FunctionalTests", testFileFolder, "ReferingFineGrainedDependency.csproj.xml"))) + File.ReadAllText(Path.Combine("FunctionalTests", testFileFolder, "ReferringFineGrainedDependency.csproj.xml"))) },{ MockUnixSupport.Path(fineGrainedProject), new MockFileData( @@ -82,7 +82,7 @@ public async Task TransitiveDevDependenciesAreExcluded() var options = new RunOptions { excludeDev = true, - SolutionOrProjectFile = MockUnixSupport.Path(referingFineGrainedProjectProject) + SolutionOrProjectFile = MockUnixSupport.Path(referringFineGrainedProjectProject) }; var bom = await FunctionalTestHelper.Test(options, getMockFS()); diff --git a/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/ReferingFineGrainedDependency.csproj.project.assets.json b/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/ReferringFineGrainedDependency.csproj.project.assets.json similarity index 100% rename from CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/ReferingFineGrainedDependency.csproj.project.assets.json rename to CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/ReferringFineGrainedDependency.csproj.project.assets.json diff --git a/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/ReferingFineGrainedDependency.csproj.xml b/CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/ReferringFineGrainedDependency.csproj.xml similarity index 100% rename from CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/ReferingFineGrainedDependency.csproj.xml rename to CycloneDX.Tests/FunctionalTests/Issue847-FineGrainedDependencies/ReferringFineGrainedDependency.csproj.xml