Skip to content

Commit

Permalink
Use .NET project files analyzers
Browse files Browse the repository at this point in the history
  • Loading branch information
Corniel committed Dec 23, 2024
1 parent 0892426 commit dddfe36
Show file tree
Hide file tree
Showing 9 changed files with 158 additions and 131 deletions.
1 change: 1 addition & 0 deletions .globalconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dotnet_diagnostic.Proj0003.severity = none # Define usings explicit
21 changes: 21 additions & 0 deletions .net.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<SignAssembly>false</SignAssembly>
<NoWarn>$(NoWarn);NU1504</NoWarn>
</PropertyGroup>

<ItemGroup>
<None Include="assets/**" />
</ItemGroup>

<ItemGroup>
<AdditionalFiles Include="LICENSE" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="DotNetProjectFile.Analyzers.Sdk" Version="1.5.3" PrivateAssets="all" />
</ItemGroup>

</Project>
67 changes: 67 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<Project>

<PropertyGroup>
<LangVersion>latest</LangVersion>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<DebugType>embedded</DebugType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<OutputType>Library</OutputType>
<Nullable>enable</Nullable>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<IsPublishable>false</IsPublishable>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>../../assets/Destructurama.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<PropertyGroup Label="Package info">
<Authors>Destructurama Contributors, Serilog Contributors</Authors>
<CurrentYear>$([System.DateTime]::Now.ToString(yyyy))</CurrentYear>
<Copyright>Copyright © Serilog Contributors 2017-$(CurrentYear)</Copyright>
<ProductName>Destructurama Attributed</ProductName>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageProjectUrl>https://github.com/destructurama/attributed</PackageProjectUrl>
<PackageIcon>icon.png</PackageIcon>
<PackageTags>serilog;attributed</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/destructurama/attributed</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<!-- https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables -->
<ContinuousIntegrationBuild>True</ContinuousIntegrationBuild>
</PropertyGroup>

<PropertyGroup Condition="EXISTS('../../../../../../assets/Destructurama.snk')">
<!-- https://github.com/dotnet/BenchmarkDotNet/issues/836 -->
<AssemblyOriginatorKeyFile>../../../../../../assets/Destructurama.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup Label="Analyzers">
<PackageReference Include="DotNetProjectFile.Analyzers" Version="1.5.3" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<AdditionalFiles Include="*.csproj" Visible="false" />
</ItemGroup>

<Choose>
<When Condition="'$(IsPackable)' == 'true'">
<ItemGroup>
<None Include="../../assets/icon.png" Pack="true" PackagePath="/" Visible="false" />
<None Include="../../README.md" Pack="true" PackagePath="/" Visible="false" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="6.0.0" PrivateAssets="All" />
</ItemGroup>
</When>
</Choose>

</Project>
43 changes: 43 additions & 0 deletions destructurama-attributed.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34330.188
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Destructurama.Attributed", "src\Destructurama.Attributed\Destructurama.Attributed.csproj", "{1F52A6F8-BE51-4648-9EDB-ADEC23E1C1C8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Destructurama.Attributed.Tests", "src\Destructurama.Attributed.Tests\Destructurama.Attributed.Tests.csproj", "{293201F5-761A-47AC-B6B0-98734CA6B4A2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benchmarks", "src\Benchmarks\Benchmarks.csproj", "{27515D99-8216-423E-B12A-0150101A2C19}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = ".net", ".net.csproj", "{E6C176E7-7F5F-48D2-96BF-0A70AA0E92EB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1F52A6F8-BE51-4648-9EDB-ADEC23E1C1C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1F52A6F8-BE51-4648-9EDB-ADEC23E1C1C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1F52A6F8-BE51-4648-9EDB-ADEC23E1C1C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1F52A6F8-BE51-4648-9EDB-ADEC23E1C1C8}.Release|Any CPU.Build.0 = Release|Any CPU
{293201F5-761A-47AC-B6B0-98734CA6B4A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{293201F5-761A-47AC-B6B0-98734CA6B4A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{293201F5-761A-47AC-B6B0-98734CA6B4A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{293201F5-761A-47AC-B6B0-98734CA6B4A2}.Release|Any CPU.Build.0 = Release|Any CPU
{27515D99-8216-423E-B12A-0150101A2C19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{27515D99-8216-423E-B12A-0150101A2C19}.Debug|Any CPU.Build.0 = Debug|Any CPU
{27515D99-8216-423E-B12A-0150101A2C19}.Release|Any CPU.ActiveCfg = Release|Any CPU
{27515D99-8216-423E-B12A-0150101A2C19}.Release|Any CPU.Build.0 = Release|Any CPU
{E6C176E7-7F5F-48D2-96BF-0A70AA0E92EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E6C176E7-7F5F-48D2-96BF-0A70AA0E92EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E6C176E7-7F5F-48D2-96BF-0A70AA0E92EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E6C176E7-7F5F-48D2-96BF-0A70AA0E92EB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F09D8B7B-37C6-417E-B8DA-296735211A4E}
EndGlobalSection
EndGlobal
3 changes: 1 addition & 2 deletions src/Benchmarks/Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<NoWarn>$(NoWarn);1591</NoWarn>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Destructurama.Attributed\Destructurama.Attributed.csproj" />
<ProjectReference Include="../Destructurama.Attributed/Destructurama.Attributed.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
<TargetFrameworks >net9.0;net462</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
<TargetFramework >net9.0</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">net9.0;net462</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net9.0</TargetFrameworks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<NoWarn>$(NoWarn);1591</NoWarn>
<DefineConstants>$(DefineConstants);CODE_GENERATION_ATTRIBUTES</DefineConstants> <!--Test with LogPropertyIgnoreAttribute requires it.-->
<!--Test with LogPropertyIgnoreAttribute requires it.-->
<DefineConstants>$(DefineConstants);CODE_GENERATION_ATTRIBUTES</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Telemetry.Abstractions" Version="9.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" PrivateAssets="all" />
<PackageReference Include="NUnit" Version="4.3.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" PrivateAssets="all" />
<PackageReference Include="Serilog" Version="4.2.0" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="PublicApiGenerator" Version="11.3.0" />
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="6.0.2" PrivateAssets="all" />
<PackageReference Include="MarkdownSnippets.MsBuild" Version="27.0.2" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Destructurama.Attributed\Destructurama.Attributed.csproj" />
<ProjectReference Include="../../src/Destructurama.Attributed/Destructurama.Attributed.csproj" />
</ItemGroup>

</Project>
12 changes: 11 additions & 1 deletion src/Destructurama.Attributed/Destructurama.Attributed.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@
<TargetFramework>netstandard2.0</TargetFramework>
<Description>Use attributes to control how complex types are logged to Serilog.</Description>
<RootNamespace>Destructurama</RootNamespace>
<IsPackable>true</IsPackable>
<PolySharpIncludeRuntimeSupportedAttributes>true</PolySharpIncludeRuntimeSupportedAttributes>
<PackageId>Destructurama.Attributed</PackageId>
<PackageReleaseNotes>
<![CDATA[
# To Be released.
]]>
</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Serilog" Version="4.2.0" />
<PackageReference Include="PolySharp" Version="1.15.0" PrivateAssets="All" />
<PackageReference Include="Serilog" Version="4.2.0" />
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="Destructurama.Attributed.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100638a43140e8a1271c1453df1379e64b40b67a1f333864c1aef5ac318a0fa2008545c3d35a82ef005edf0de1ad1e1ea155722fe289df0e462f78c40a668cbc96d7be1d487faef5714a54bb4e57909c86b3924c2db6d55ccf59939b99eb0cab6e8a91429ba0ce630c08a319b323bddcbbd509f1afe4ae77a6cbb8b447f588febc3" />
<InternalsVisibleTo Include="Benchmarks, PublicKey=0024000004800000940000000602000000240000525341310004000001000100638a43140e8a1271c1453df1379e64b40b67a1f333864c1aef5ac318a0fa2008545c3d35a82ef005edf0de1ad1e1ea155722fe289df0e462f78c40a668cbc96d7be1d487faef5714a54bb4e57909c86b3924c2db6d55ccf59939b99eb0cab6e8a91429ba0ce630c08a319b323bddcbbd509f1afe4ae77a6cbb8b447f588febc3" />
</ItemGroup>
Expand Down
38 changes: 0 additions & 38 deletions src/Directory.Build.props

This file was deleted.

79 changes: 0 additions & 79 deletions src/destructurama-attributed.sln

This file was deleted.

0 comments on commit dddfe36

Please sign in to comment.