Apq.Cfg.SourceGenerator.csproj 1.8 KB

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