GFramework/GFramework.SourceGenerators/GeWuYou.GFramework.SourceGenerators.targets
GeWuYou f63714f1e1 test(game): 添加游戏模块集成测试项目
- 创建了 GFramework.Game.Tests 测试项目配置文件
- 添加了 Microsoft.NET.Test.Sdk、Moq、NUnit 等测试依赖包
- 配置了项目引用包括 GFramework.Game、GFramework.Core 和源代码生成器
- 实现了自动生成配置消费者集成测试验证功能
- 添加了怪物配置模式定义用于端到端测试验证
- 创建了源代码生成器目标文件实现自动化配置收集
- 验证了消费者项目自动拾取 schema 并生成绑定的功能
2026-04-03 15:50:45 +08:00

41 lines
2.3 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.

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- This file is automatically generated by the NuGet package -->
<!-- It ensures that the source generators are properly registered during build -->
<PropertyGroup>
<!--
消费项目默认从 schemas/ 目录收集配置 schema。
这样可以让配置生成器开箱即用,同时保留通过属性重定向目录的余地。
-->
<GFrameworkConfigSchemaDirectory Condition="'$(GFrameworkConfigSchemaDirectory)' == ''">schemas</GFrameworkConfigSchemaDirectory>
</PropertyGroup>
<ItemGroup>
<!--
仅在 NuGet 打包布局存在时自动注入 analyzer。
仓库内项目引用场景会通过 ProjectReference(OutputItemType=Analyzer) 提供生成器,
因此这里需要避免对不存在的打包路径做无效引用。
-->
<Analyzer Include="$(MSBuildThisFileDirectory)../analyzers/dotnet/cs/GFramework.SourceGenerators.dll"
Condition="Exists('$(MSBuildThisFileDirectory)../analyzers/dotnet/cs/GFramework.SourceGenerators.dll')"/>
<Analyzer Include="$(MSBuildThisFileDirectory)../analyzers/dotnet/cs/GFramework.SourceGenerators.Abstractions.dll"
Condition="Exists('$(MSBuildThisFileDirectory)../analyzers/dotnet/cs/GFramework.SourceGenerators.Abstractions.dll')"/>
<Analyzer Include="$(MSBuildThisFileDirectory)../analyzers/dotnet/cs/GFramework.SourceGenerators.Common.dll"
Condition="Exists('$(MSBuildThisFileDirectory)../analyzers/dotnet/cs/GFramework.SourceGenerators.Common.dll')"/>
</ItemGroup>
<ItemGroup Condition="Exists('$(MSBuildProjectDirectory)/$(GFrameworkConfigSchemaDirectory)')">
<!--
将消费者项目中的 schema 文件自动暴露为 AdditionalFiles
避免每个游戏项目都手工维护同样的 MSBuild 配置。
-->
<AdditionalFiles Include="$(MSBuildProjectDirectory)/$(GFrameworkConfigSchemaDirectory)/**/*.schema.json"/>
</ItemGroup>
<!-- Ensure the analyzers are loaded -->
<Target Name="EnsureGFrameworkAnalyzers" BeforeTargets="CoreCompile">
<Message Text="Loading GFramework source generators" Importance="high"/>
</Target>
</Project>