fix nuget package for Generator assembly?
All checks were successful
Publish NuGets / build (release) Successful in 46s

This commit is contained in:
Mathias Beaulieu-Duncan 2025-11-07 12:48:00 -05:00
parent 9aed854b1b
commit 898aca0905
3 changed files with 38 additions and 11 deletions

View File

@ -32,7 +32,15 @@
"Bash(lsof:*)",
"Bash(xargs kill -9)",
"Bash(dotnet run:*)",
"Bash(find:*)"
"Bash(find:*)",
"Bash(dotnet pack:*)",
"Bash(unzip:*)",
"WebFetch(domain:andrewlock.net)",
"WebFetch(domain:github.com)",
"WebFetch(domain:stackoverflow.com)",
"WebFetch(domain:www.kenmuse.com)",
"WebFetch(domain:blog.rsuter.com)",
"WebFetch(domain:natemcmaster.com)"
],
"deny": [],
"ask": []

View File

@ -7,7 +7,10 @@
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<IsPackable>true</IsPackable>
<DevelopmentDependency>true</DevelopmentDependency>
<!-- Don't include build output in lib/ - this is an analyzer/generator package -->
<IncludeBuildOutput>false</IncludeBuildOutput>
<NoPackageAnalysis>true</NoPackageAnalysis>
<NoWarn>$(NoWarn);NU5128</NoWarn>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
<Company>Svrnty</Company>
@ -20,11 +23,8 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Description>Source Generator for Svrnty.CQRS.Grpc - generates .proto files and gRPC service implementations from commands and queries</Description>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<IncludeSymbols>true</IncludeSymbols>
<IncludeSource>true</IncludeSource>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<!-- Disable symbol packages for analyzer/generator packages (prevents NU5017 error) -->
<IncludeSymbols>false</IncludeSymbols>
</PropertyGroup>
<ItemGroup>
@ -39,11 +39,24 @@
</ItemGroup>
<ItemGroup>
<!-- Package as analyzer -->
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<!-- Also package as build task -->
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="build" Visible="false" />
<!-- Include targets and props files in both build and buildTransitive for proper dependency flow -->
<None Include="build\Svrnty.CQRS.Grpc.Generators.targets" Pack="true" PackagePath="build" />
<None Include="build\Svrnty.CQRS.Grpc.Generators.targets" Pack="true" PackagePath="buildTransitive" />
<None Include="build\Svrnty.CQRS.Grpc.Generators.props" Pack="true" PackagePath="build" />
<None Include="build\Svrnty.CQRS.Grpc.Generators.props" Pack="true" PackagePath="buildTransitive" />
</ItemGroup>
<!-- Use the recommended pattern to include the generator DLL in the package -->
<PropertyGroup>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);IncludeGeneratorAssemblyInPackage</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>
<Target Name="IncludeGeneratorAssemblyInPackage">
<ItemGroup>
<!-- Include in analyzers folder for Roslyn source generator -->
<TfmSpecificPackageFile Include="$(OutputPath)$(AssemblyName).dll" PackagePath="analyzers/dotnet/cs" />
<!-- Include in build folder for MSBuild task (WriteProtoFileTask) -->
<TfmSpecificPackageFile Include="$(OutputPath)$(AssemblyName).dll" PackagePath="build" />
</ItemGroup>
</Target>
</Project>

View File

@ -0,0 +1,6 @@
<Project>
<PropertyGroup>
<!-- Marker to indicate Svrnty.CQRS.Grpc.Generators is referenced -->
<SvrntyCqrsGrpcGeneratorsVersion>$(SvrntyCqrsGrpcGeneratorsVersion)</SvrntyCqrsGrpcGeneratorsVersion>
</PropertyGroup>
</Project>