Skip to content

Commit 39fa0f9

Browse files
housekeeping: Further cleanup (#9)
* simplify csproj * Update MetadataExtractor.cs * Update Splat.DependencyInjection.SourceGenerator.Tests.csproj * housekeeping: bring back is packable * housekeeping: move location of IsPackable to match previous Co-authored-by: Glenn <[email protected]>
1 parent 26fd9e0 commit 39fa0f9

File tree

4 files changed

+8
-24
lines changed

4 files changed

+8
-24
lines changed

src/Directory.Build.props

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<Project>
22
<PropertyGroup>
33
<GenerateDocumentationFile>true</GenerateDocumentationFile>
4+
<Nullable>enable</Nullable>
5+
<LangVersion>latest</LangVersion>
46
<Platform>AnyCPU</Platform>
57
<IsTestProject>$(MSBuildProjectName.Contains('Tests'))</IsTestProject>
68
<DebugType>embedded</DebugType>
@@ -22,29 +24,20 @@
2224
<!-- Include PDB in the built .nupkg -->
2325
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
2426
<PackageIcon>logo.png</PackageIcon>
27+
<SolutionDir Condition="'$(SolutionDir)' == ''">$(MSBuildThisFileDirectory)</SolutionDir>
2528
</PropertyGroup>
2629

2730
<ItemGroup Condition="'$(IsTestProject)' != 'true'">
2831
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
2932
</ItemGroup>
3033

31-
<ItemGroup>
32-
<None Include="$(MSBuildThisFileDirectory)..\logo.png" Pack="true" PackagePath="" />
33-
</ItemGroup>
34-
35-
<PropertyGroup>
36-
<SolutionDir Condition="'$(SolutionDir)' == ''">$(MSBuildThisFileDirectory)</SolutionDir>
37-
</PropertyGroup>
38-
3934
<ItemGroup>
4035
<None Include="$(MSBuildThisFileDirectory)..\LICENSE" Pack="true" PackagePath="LICENSE" />
36+
<None Include="$(MSBuildThisFileDirectory)..\logo.png" Pack="true" PackagePath="" />
4137
</ItemGroup>
4238

4339
<ItemGroup>
4440
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.220" PrivateAssets="all" />
45-
</ItemGroup>
46-
47-
<ItemGroup>
4841
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.354" PrivateAssets="all" />
4942
<PackageReference Include="Roslynator.Analyzers" Version="3.2.0" PrivateAssets="All" />
5043
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3" PrivateAssets="all" />

src/Splat.DependencyInjection.SourceGenerator.Tests/Splat.DependencyInjection.SourceGenerator.Tests.csproj

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,16 @@
22

33
<PropertyGroup>
44
<TargetFramework>net5.0</TargetFramework>
5-
65
<IsPackable>false</IsPackable>
7-
<Nullable>enable</Nullable>
86
<NoWarn>$(NoWarn);SA1600;CS1591</NoWarn>
97
</PropertyGroup>
108

119
<ItemGroup>
10+
<PackageReference Include="Microsoft.CodeAnalysis" Version="3.10.0" />
1211
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
1312
<PackageReference Include="xunit" Version="2.4.1" />
14-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
15-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
16-
<PrivateAssets>all</PrivateAssets>
17-
</PackageReference>
18-
<PackageReference Include="coverlet.collector" Version="3.0.3">
19-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
20-
<PrivateAssets>all</PrivateAssets>
21-
</PackageReference>
13+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" PrivateAssets="all" />
14+
<PackageReference Include="coverlet.collector" Version="3.0.3" PrivateAssets="all" />
2215
<PackageReference Include="Verify.SourceGenerators" Version="1.0.1" />
2316
<PackageReference Include="ReactiveMarbles.SourceGenerator.TestNuGetHelper" Version="1.0.8" />
2417
<PackageReference Include="Verify.Xunit" Version="11.20.3" />

src/Splat.DependencyInjection.SourceGenerator/MetadataExtractor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public static IEnumerable<MethodMetadata> GetValidMethods(GeneratorExecutionCont
6060

6161
var numberTypeParameters = methodSymbol.TypeArguments.Length;
6262

63-
if (numberTypeParameters == 0 || numberTypeParameters > 2)
63+
if (numberTypeParameters is 0 or > 2)
6464
{
6565
return null;
6666
}

src/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>netstandard2.0</TargetFramework>
4-
<Nullable>enable</Nullable>
5-
<LangVersion>latest</LangVersion>
64
<DevelopmentDependency>true</DevelopmentDependency>
75
<IncludeBuildOutput>false</IncludeBuildOutput>
86
<!-- forces SDK to copy dependencies into build output to make packing easier -->

0 commit comments

Comments
 (0)