GFramework/GFramework.Godot.SourceGenerators/GFramework.Godot.SourceGenerators.csproj
GwWuYou c5a11820bc build(generator): 添加源代码生成器的 MSBuild targets 配置文件
- 为 GFramework.Godot.SourceGenerators 创建 GeWuYou.GFramework.Godot.SourceGenerators.targets 文件
- 为 GFramework.SourceGenerators 创建 GeWuYou.GFramework.SourceGenerators.targets 文件
- 在项目中启用 EnforceExtendedAnalyzerRules 规则
- 修正项目引用路径配置
- 更新包打包配置以包含正确的 targets 文件
- 从 GFramework.csproj 中移除多余的 targets 文件排除配置
2025-12-27 23:05:44 +08:00

55 lines
2.4 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>GeWuYou.GFramework.Godot.SourceGenerators</PackageId>
<TargetFramework>netstandard2.0</TargetFramework>
<!-- 这是 Analyzer不是运行时库 -->
<IsRoslynAnalyzer>true</IsRoslynAnalyzer>
<IncludeBuildOutput>false</IncludeBuildOutput>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<!-- 可选:调试生成代码 -->
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
</PropertyGroup>
<!-- Roslyn 依赖,只用于 Generator 自身 -->
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" PrivateAssets="all"/>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="4.14.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<!-- Generator 编译期引用 Attributes / Common但不打包 -->
<ItemGroup>
<ProjectReference Include="..\GFramework.Godot.SourceGenerators.Abstractions\GFramework.Godot.SourceGenerators.Abstractions.csproj" PrivateAssets="all"/>
</ItemGroup>
<!-- ★关键:只把 Generator DLL 放进 analyzers -->
<ItemGroup>
<!-- Generator 本体 -->
<None Include="$(OutputPath)\GFramework.Godot.SourceGenerators.dll"
Pack="true"
PackagePath="analyzers/dotnet/cs"
Visible="false"/>
<!-- ★ Generator 运行期依赖 -->
<None Include="$(OutputPath)\GFramework.Godot.SourceGenerators.Abstractions.dll"
Pack="true"
PackagePath="analyzers/dotnet/cs"
Visible="false"/>
</ItemGroup>
<ItemGroup>
<None Include="$(OutputPath)\$(AssemblyName).Abstractions.dll" Pack="true" PackagePath="lib\netstandard2.0" Visible="true"/>
<None Include="$(OutputPath)\$(AssemblyName).Abstractions.xml" Pack="true" PackagePath="lib\netstandard2.0" Visible="true"/>
<!-- 包含targets文件 -->
<None Include="GeWuYou.GFramework.Godot.SourceGenerators.targets" Pack="true" PackagePath="build" Visible="false"/>
</ItemGroup>
</Project>