GFramework/GFramework.Generator/GFramework.Generator.csproj
GwWuYou 50a71deaa7 feat(generator): 添加枚举扩展方法生成器及相关属性
- 新增 EnumExtensionsGenerator 源生成器
- 实现 GenerateEnumExtensionsAttribute 特性标注
- 为标记的枚举自动生成 IsXXX 和 IsIn 扩展方法
- 配置项目引用及 Analyzer 打包设置
- 更新解决方案文件包含新增项目
- 调整主项目配置排除生成器相关文件编译
2025-12-10 08:39:27 +08:00

40 lines
1.6 KiB
XML

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageId>GeWuYou.GFramework.Generator</PackageId>
<LangVersion>latest</LangVersion>
<IsRoslynComponent>true</IsRoslynComponent>
<!-- 对 generator 项目要启用扩展规则 -->
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<!-- 不把输出当作运行时库 -->
<IncludeBuildOutput>false</IncludeBuildOutput>
<!-- 有助于调试生成的代码(可选) -->
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" PrivateAssets="all"/>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" PrivateAssets="all"/>
</ItemGroup>
<ItemGroup>
<!-- Generator 需要引用 Attributes 项目,但不作为运行时依赖 -->
<ProjectReference Include="..\GFramework.Generator.Attributes\GFramework.Generator.Attributes.csproj"
PrivateAssets="all"/>
</ItemGroup>
<!-- 将 Generator 和 Attributes DLL 打包为 Analyzer -->
<ItemGroup>
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true"
PackagePath="analyzers/dotnet/cs" Visible="false"/>
<None Include="$(OutputPath)\GFramework.Generator.Attributes.dll" Pack="true"
PackagePath="analyzers/dotnet/cs" Visible="false"/>
</ItemGroup>
</Project>