From 5695f1fd6eb8361a1dc217be25abf23b8147e965 Mon Sep 17 00:00:00 2001 From: Bradley Grainger Date: Wed, 10 Jul 2024 20:37:29 -0700 Subject: [PATCH] Enable auditing for package vulnerabilities. This will make it more difficult to ship a Faithlife.Build package that has transitive dependencies on vulnerable packages, which improves the experience for consumers. The changes to Build.csproj are temporary until an updated package can be published. --- Directory.Build.props | 3 +++ Directory.Packages.props | 6 ++++-- src/Faithlife.Build/DotNetClassicTool.cs | 2 +- src/Faithlife.Build/Faithlife.Build.csproj | 2 ++ tools/Build/Build.csproj | 2 ++ 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 294ebbd..de76f4a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -31,6 +31,9 @@ true true true + true + all + low diff --git a/Directory.Packages.props b/Directory.Packages.props index b35c3a3..9c03ffe 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -9,11 +9,13 @@ - - + + + + diff --git a/src/Faithlife.Build/DotNetClassicTool.cs b/src/Faithlife.Build/DotNetClassicTool.cs index 3997801..5e57eef 100644 --- a/src/Faithlife.Build/DotNetClassicTool.cs +++ b/src/Faithlife.Build/DotNetClassicTool.cs @@ -72,7 +72,7 @@ public static DotNetClassicTool CreateFrom(string projectPath, string packageNam var bestMatch = VersionRange.Parse(packageVersion).FindBestMatch(packageDirectories) ?? throw new BuildException($"Found restored NuGet package folder but no version is a best match: {packageFullPath}"); - var packageBestMatchPath = Path.Combine(packagesPath, packageName.ToLowerInvariant(), bestMatch.OriginalVersion); + var packageBestMatchPath = Path.Combine(packagesPath, packageName.ToLowerInvariant(), bestMatch.OriginalVersion ?? bestMatch.ToString()); if (!Directory.Exists(packageBestMatchPath)) throw new BuildException($"Missing restored NuGet package that was a best match: {packageBestMatchPath}"); diff --git a/src/Faithlife.Build/Faithlife.Build.csproj b/src/Faithlife.Build/Faithlife.Build.csproj index e51b254..c54b4d0 100644 --- a/src/Faithlife.Build/Faithlife.Build.csproj +++ b/src/Faithlife.Build/Faithlife.Build.csproj @@ -16,8 +16,10 @@ + + diff --git a/tools/Build/Build.csproj b/tools/Build/Build.csproj index 94c9978..59ffe85 100644 --- a/tools/Build/Build.csproj +++ b/tools/Build/Build.csproj @@ -7,6 +7,8 @@ + +