Skip to content

Commit

Permalink
Added Roslyn generators to solution
Browse files Browse the repository at this point in the history
  • Loading branch information
jezzsantos committed Oct 2, 2023
1 parent 5540226 commit 92f1019
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@
</PropertyGroup>

<!-- Runs the analyzers (in memory) on build -->
<ItemGroup>
<ProjectReference Include="..\Tools.Analyzers.Core\Tools.Analyzers.Core.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" Condition="'$(IsTestProject)'=='' AND '$(IsRoslynComponent)'==''" />
<ItemGroup Condition="'$(IsTestProject)'!='true' AND '$(IsRoslynComponent)'!='true'">
<PackageReference Include="SaaStack.Tools.Analyzers.Core" Version="1.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions src/NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="SaaStack Packages" value="../tools/nuget"/>
</packageSources>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.7.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing" Version="1.1.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" Version="1.1.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing" Version="1.1.1" />
Expand Down
19 changes: 17 additions & 2 deletions src/Tools.Analyzers.Core/Tools.Analyzers.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@
<TargetFramework>.net7.0</TargetFramework>
<IsRoslynComponent>true</IsRoslynComponent>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<IsPackable>true</IsPackable>
<IncludeBuildOutput>false</IncludeBuildOutput>
<PackageId>SaaStack.Tools.Analyzers.Core</PackageId>
<Description>Roslyn analyzers for SaaStack codebases</Description>
<PackageReleaseNotes>https://github.com/jezzsantos/saastack/blob/main/src/Tools.Analyzers.Core/README.md</PackageReleaseNotes>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<NoWarn>RS2007</NoWarn>
<PropertyGroup>
<NoWarn>RS2007;NU5128</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -39,4 +45,13 @@
<AdditionalFiles Remove="AnalyzerReleases.Unshipped.md" />
</ItemGroup>

<ItemGroup>
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
</ItemGroup>

<Target Name="CopyPackage" AfterTargets="Pack">
<Copy
SourceFiles="$(OutputPath)../$(PackageId).$(PackageVersion).nupkg"
DestinationFolder="../../tools/nuget" />
</Target>
</Project>
Binary file not shown.

0 comments on commit 92f1019

Please sign in to comment.