Apq.Cfg.SourceGenerator.csproj 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <Project Sdk="Microsoft.NET.Sdk">
  2. <PropertyGroup>
  3. <!-- Source Generator 必须使用 netstandard2.0 -->
  4. <TargetFramework>netstandard2.0</TargetFramework>
  5. <LangVersion>latest</LangVersion>
  6. <Nullable>enable</Nullable>
  7. <ImplicitUsings>disable</ImplicitUsings>
  8. <!-- Roslyn 分析器/生成器配置 -->
  9. <EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
  10. <IsRoslynComponent>true</IsRoslynComponent>
  11. <!-- 不作为普通引用,仅作为分析器 -->
  12. <IncludeBuildOutput>false</IncludeBuildOutput>
  13. <DevelopmentDependency>true</DevelopmentDependency>
  14. <!-- 禁止生成符号包(源生成器通常不需要调试) -->
  15. <!-- 如需调试支持,改为 true -->
  16. <IncludeSymbols>false</IncludeSymbols>
  17. <!-- 禁止依赖项组 -->
  18. <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
  19. <!-- NuGet 包元数据 -->
  20. <RootNamespace>Apq.Cfg.SourceGenerator</RootNamespace>
  21. <Description>Apq.Cfg 源生成器,编译时生成强类型配置绑定代码,零反射</Description>
  22. <PackageTags>configuration;source-generator;roslyn;aot;codegen</PackageTags>
  23. </PropertyGroup>
  24. <!-- Roslyn 依赖 - 使用 4.3.0 以兼容更多编译器版本 -->
  25. <ItemGroup>
  26. <PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
  27. <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.0" PrivateAssets="all" />
  28. </ItemGroup>
  29. <!-- 打包为分析器 -->
  30. <ItemGroup>
  31. <None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
  32. </ItemGroup>
  33. </Project>