Skip to content

Commit 1b5c942

Browse files
authored
Simplify msbuild properties (#816)
1 parent df9f517 commit 1b5c942

18 files changed

+72
-87
lines changed

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@
3434
</ItemGroup>
3535

3636
<ItemGroup>
37-
<PackageReference Include="Meziantou.DotNet.CodingStandard" Version="1.0.151">
37+
<PackageReference Include="Meziantou.DotNet.CodingStandard" Version="1.0.170">
3838
<PrivateAssets>all</PrivateAssets>
3939
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
4040
</PackageReference>
41-
<PackageReference Include="Meziantou.Polyfill" Version="1.0.42">
41+
<PackageReference Include="Meziantou.Polyfill" Version="1.0.49">
4242
<PrivateAssets>all</PrivateAssets>
4343
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
4444
</PackageReference>

Directory.Build.targets

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@
7878

7979
<Otherwise>
8080
<ItemGroup>
81-
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
82-
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="4.13.0" />
83-
<PackageReference Update="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.13.0" />
84-
<PackageReference Update="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.13.0" />
81+
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="4.14.0" />
82+
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
83+
<PackageReference Update="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.14.0" />
84+
<PackageReference Update="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.14.0" />
8585
</ItemGroup>
8686
<PropertyGroup>
8787
<DefineConstants>$(DefineConstants);ROSLYN4_8;ROSLYN_4_2_OR_GREATER;ROSLYN_4_4_OR_GREATER;ROSLYN_4_5_OR_GREATER;ROSLYN_4_6_OR_GREATER;ROSLYN_4_8_OR_GREATER;ROSLYN_4_10_OR_GREATER</DefineConstants>

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "9.0.201",
3+
"version": "9.0.303",
44
"rollForward": "latestPatch"
55
}
66
}

src/DocumentationGenerator/DocumentationGenerator.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net9.0</TargetFramework>
66
<IsPackable>false</IsPackable>
7-
<ImplicitUsings>true</ImplicitUsings>
8-
<Nullable>enable</Nullable>
97
</PropertyGroup>
108

119
<ItemGroup>

src/ListDotNetTypes/ListDotNetTypes.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net9.0</TargetFramework>
6-
<Nullable>enable</Nullable>
76
<IsPackable>false</IsPackable>
8-
<ImplicitUsings>true</ImplicitUsings>
97
</PropertyGroup>
108

119
<ItemGroup>

src/Meziantou.Analyzer.Annotations/Meziantou.Analyzer.Annotations.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
<PackageTags>Meziantou.Analyzer, analyzers</PackageTags>
99
<GenerateDocumentationFile>True</GenerateDocumentationFile>
1010
</PropertyGroup>
11-
12-
<ItemGroup>
13-
<None Include="README.md" Pack="true" PackagePath="" />
14-
</ItemGroup>
1511

1612
<ItemGroup>
1713
<PackageReference Remove="Meziantou.Polyfill" />
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
Meziantou.Analyzer.Annotations help configuring some rules by annotating your code.
1+
`Meziantou.Analyzer.Annotations` enables you to configure certain analyzer rules by adding annotations directly to your code.
22

3-
All usages of Meziantou.Analyzer.Annotations attributes are erased from metadata by default, which means no actual binary reference to 'Meziantou.Analyzer.Annotations.dll' assembly is produced. If you need to preserve these attributes in metadata, just define 'MEZIANTOU_ANALYZER_ANNOTATIONS' conditional compilation symbol in your projects.
3+
By default, all usages of attributes from `Meziantou.Analyzer.Annotations` are removed from the compiled assembly metadata. This means your binaries will not reference the `Meziantou.Analyzer.Annotations.dll` assembly.
4+
5+
If you want to keep these attributes in the metadata (for example, for reflection or tooling purposes), define the `MEZIANTOU_ANALYZER_ANNOTATIONS` conditional compilation symbol in your project settings.

src/Meziantou.Analyzer.CodeFixers/Meziantou.Analyzer.CodeFixers.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
<TargetFrameworks>net9.0;netstandard2.0</TargetFrameworks>
44
<IncludeBuildOutput>false</IncludeBuildOutput>
55
<Version>1.0.1</Version>
6-
<Nullable>enable</Nullable>
7-
<DebugSymbols>True</DebugSymbols>
8-
<DebugType>Embedded</DebugType>
9-
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
106
<BaseOutputPath>bin\$(RoslynVersion)\</BaseOutputPath>
117
<RootNamespace>Meziantou.Analyzer</RootNamespace>
128
</PropertyGroup>

src/Meziantou.Analyzer/Meziantou.Analyzer.csproj

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,12 @@
1111
<Description>A Roslyn analyzer to enforce some good practices in C#</Description>
1212
<PackageTags>Meziantou.Analyzer, analyzers</PackageTags>
1313
<NoPackageAnalysis>true</NoPackageAnalysis>
14-
<Nullable>enable</Nullable>
15-
16-
<DebugSymbols>True</DebugSymbols>
17-
<DebugType>Embedded</DebugType>
18-
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
14+
1915
<BaseOutputPath>bin\$(RoslynVersion)\</BaseOutputPath>
2016
</PropertyGroup>
2117
<ItemGroup>
2218
<None Include="$(MSBuildThisFileDirectory)..\..\docs\**\*" LinkBase="docs" />
2319
<EmbeddedResource Include="Resources\*.txt" />
24-
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\BannedSymbols.txt" />
2520
</ItemGroup>
2621

2722
<ItemGroup>

src/Meziantou.Analyzer/Rules/DoNotUseImplicitCultureSensitiveToStringAnalyzer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Collections.Immutable;
1+
using System.Collections.Immutable;
22
using System.Diagnostics;
33
using Meziantou.Analyzer.Configurations;
44
using Meziantou.Analyzer.Internals;
@@ -169,12 +169,12 @@ private bool IsNonCultureSensitiveOperand(OperationAnalysisContext context, Diag
169169
private static bool MustUnwrapNullableTypes(OperationAnalysisContext context, DiagnosticDescriptor rule, IOperation operation)
170170
{
171171
// Avoid an allocation when creating the key
172-
if (rule == StringConcatRule)
172+
if (StringConcatRule.Equals(rule))
173173
{
174174
Debug.Assert(rule.Id == RuleIdentifiers.DoNotUseImplicitCultureSensitiveToString);
175175
return context.Options.GetConfigurationValue(operation.Syntax.SyntaxTree, RuleIdentifiers.DoNotUseImplicitCultureSensitiveToString + ".consider_nullable_types", defaultValue: true);
176176
}
177-
else if (rule == StringInterpolationRule)
177+
else if (StringInterpolationRule.Equals(rule))
178178
{
179179
Debug.Assert(rule.Id == RuleIdentifiers.DoNotUseImplicitCultureSensitiveToStringInterpolation);
180180
return context.Options.GetConfigurationValue(operation.Syntax.SyntaxTree, RuleIdentifiers.DoNotUseImplicitCultureSensitiveToStringInterpolation + ".consider_nullable_types", defaultValue: true);

0 commit comments

Comments
 (0)