diff --git a/Directory.Build.props b/Directory.Build.props index 1552f37..460b2f4 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,12 +1,12 @@ - 5.18.1 + 5.19.0 11.0 enable enable true - $(NoWarn);1591;1998;NU5105 + $(NoWarn);1591;1998 embedded Faithlife FaithlifeBuild @@ -34,11 +34,7 @@ - + - - $(NoWarn);NU5104 - - diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 622a04a..4abc040 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,5 +1,10 @@ # Release Notes +## 5.19.0 + +* Allow global JetBrains tool to be used. (`dotnet tool update --global jetbrains.resharper.globaltools`) +* Drop support for `format` target. (The `dotnet-format` tool is no longer being updated. Just use `dotnet format` directly.) + ## 5.18.1 * Update dependencies to fix [CVE-2023-29337](https://github.com/advisories/GHSA-6qmf-mmc7-6c2p). diff --git a/src/Faithlife.Build/DotNetBuild.cs b/src/Faithlife.Build/DotNetBuild.cs index 27ad7e8..37249cf 100644 --- a/src/Faithlife.Build/DotNetBuild.cs +++ b/src/Faithlife.Build/DotNetBuild.cs @@ -621,32 +621,30 @@ Credentials ProvideDocsCredentials(string url, string usernameFromUrl, Supported } } - if (DotNetLocalTool.TryCreate("dotnet-format") is { } dotnetFormat) + // allow global tool to be used (dotnet tool update --global jetbrains.resharper.globaltools) + var jb = DotNetLocalTool.TryCreate("jetbrains.resharper.globaltools"); + void RunJb(IEnumerable a) { - build.Target("format") - .DependsOn("restore") - .Describe("Fixes coding style with dotnet-format") - .Does(() => - { - dotnetFormat.Run(settings.GetVerbosityArg()); - }); + if (jb is not null) + jb.Run(a); + else + RunApp("jb", a); } - if (DotNetLocalTool.TryCreate("jetbrains.resharper.globaltools") is { } jb) + if (jb is not null || FindFiles("*.DotSettings").Count != 0) { build.Target("cleanup") .DependsOn("restore") .Describe("Fixes coding style with JetBrains CleanupCode") .Does(() => { - jb.Run( - new[] - { - "cleanupcode", - "--profile=Build", - "--verbosity=ERROR", - "--disable-settings-layers:GlobalAll;GlobalPerProduct;SolutionPersonal;ProjectPersonal", - }.Concat(GetJetBrainsProperties()).Append(GetSolutionName())); + RunJb(new[] + { + "cleanupcode", + "--profile=Build", + "--verbosity=ERROR", + "--disable-settings-layers:GlobalAll;GlobalPerProduct;SolutionPersonal;ProjectPersonal", + }.Concat(GetJetBrainsProperties()).Append(GetSolutionName())); }); build.Target("inspect") @@ -656,7 +654,7 @@ Credentials ProvideDocsCredentials(string url, string usernameFromUrl, Supported { var outputPath = Path.Combine("release", "inspect.xml"); - jb.Run( + RunJb( new[] { "inspectcode", diff --git a/tests/Faithlife.Build.Tests/Faithlife.Build.Tests.csproj b/tests/Faithlife.Build.Tests/Faithlife.Build.Tests.csproj index 679e127..12569fa 100644 --- a/tests/Faithlife.Build.Tests/Faithlife.Build.Tests.csproj +++ b/tests/Faithlife.Build.Tests/Faithlife.Build.Tests.csproj @@ -5,7 +5,7 @@ - + diff --git a/tools/Build/Build.csproj b/tools/Build/Build.csproj index c17b06a..3fe661a 100644 --- a/tools/Build/Build.csproj +++ b/tools/Build/Build.csproj @@ -3,7 +3,6 @@ Exe net7.0 - $(NoWarn);CA1852 diff --git a/tools/XmlDocGen/XmlDocGen.csproj b/tools/XmlDocGen/XmlDocGen.csproj index 2a1f118..088d825 100644 --- a/tools/XmlDocGen/XmlDocGen.csproj +++ b/tools/XmlDocGen/XmlDocGen.csproj @@ -3,7 +3,6 @@ Exe net7.0 - $(NoWarn);CA1852