Skip to content

Commit

Permalink
Merge pull request #57 from ejball/dotnet-format
Browse files Browse the repository at this point in the history
  • Loading branch information
ejball authored Jul 27, 2023
2 parents 5ef2cc1 + 8e64eb1 commit f9d743a
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 28 deletions.
10 changes: 3 additions & 7 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project>

<PropertyGroup>
<VersionPrefix>5.18.1</VersionPrefix>
<VersionPrefix>5.19.0</VersionPrefix>
<LangVersion>11.0</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoWarn>$(NoWarn);1591;1998;NU5105</NoWarn>
<NoWarn>$(NoWarn);1591;1998</NoWarn>
<DebugType>embedded</DebugType>
<GitHubOrganization>Faithlife</GitHubOrganization>
<RepositoryName>FaithlifeBuild</RepositoryName>
Expand Down Expand Up @@ -34,11 +34,7 @@
<ItemGroup>
<PackageReference Include="Faithlife.Analyzers" Version="1.4.0" PrivateAssets="All" IncludeAssets="runtime; build; native; contentfiles; analyzers" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435" PrivateAssets="All" IncludeAssets="runtime; build; native; contentfiles; analyzers" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507" PrivateAssets="All" IncludeAssets="runtime; build; native; contentfiles; analyzers" />
</ItemGroup>

<PropertyGroup>
<NoWarn>$(NoWarn);NU5104</NoWarn>
</PropertyGroup>

</Project>
5 changes: 5 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
34 changes: 16 additions & 18 deletions src/Faithlife.Build/DotNetBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string?> 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")
Expand All @@ -656,7 +654,7 @@ Credentials ProvideDocsCredentials(string url, string usernameFromUrl, Supported
{
var outputPath = Path.Combine("release", "inspect.xml");
jb.Run(
RunJb(
new[]
{
"inspectcode",
Expand Down
2 changes: 1 addition & 1 deletion tests/Faithlife.Build.Tests/Faithlife.Build.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion tools/Build/Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<NoWarn>$(NoWarn);CA1852</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion tools/XmlDocGen/XmlDocGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<NoWarn>$(NoWarn);CA1852</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit f9d743a

Please sign in to comment.