GFramework/GFramework.Godot.SourceGenerators/GFramework.Godot.SourceGenerators.csproj
GwWuYou 2f3bc2d526 feat(godot-source-generators): 重构Godot源代码生成器项目配置
- 将TargetFramework从net10.0更改为netstandard2.0以提高兼容性
- 添加必要的using语句(System和System.Linq)到GodotLoggerGenerator
- 配置项目属性以支持Roslyn分析器功能,包括GeneratePackageOnBuild、
  IsRoslynAnalyzer等设置
- 添加EnforceExtendedAnalyzerRules以启用扩展规则验证
- 配置项目引用GFramework.Godot.SourceGenerators.Attributes并设置
  PrivateAssets="all"避免运行时依赖
- 设置打包配置将生成器DLL打包为analyzers/dotnet/cs路径
- 修正GodotLogAttribute命名空间为GFramework.Godot.SourceGenerators.Attributes.logging
- 更新PackageId为GeWuYou.GFramework.SourceGenerators.Attributes
- 移除不必要的PackageReadmeFile配置
2025-12-25 21:22:20 +08:00

45 lines
2.1 KiB
XML

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>GeWuYou.GFramework.Godot.SourceGenerators</PackageId>
<TargetFramework>netstandard2.0</TargetFramework>
<IsRoslynAnalyzer>true</IsRoslynAnalyzer>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<LangVersion>latest</LangVersion>
<IsRoslynComponent>true</IsRoslynComponent>
<!-- 对 generator 项目要启用扩展规则 -->
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<!-- 不把输出当作运行时库 -->
<IncludeBuildOutput>false</IncludeBuildOutput>
<!-- 有助于调试生成的代码(可选) -->
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.14.0"/>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0"/>
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="AnalyzerReleases.Shipped.md"/>
<AdditionalFiles Include="AnalyzerReleases.Unshipped.md"/>
</ItemGroup>
<ItemGroup>
<!-- Generator 需要引用 Attributes 项目,但不作为运行时依赖 -->
<ProjectReference Include="..\GFramework.Godot.SourceGenerators.Attributes\GFramework.SourceGenerators.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)$(AssemblyName).dll" Pack="true" PackagePath="lib/netstandard2.0"/>
<None Include="$(OutputPath)\GFramework.Godot.SourceGenerators.Attributes.dll" Pack="true"
PackagePath="analyzers/dotnet/cs" Visible="false"/>
</ItemGroup>
</Project>