chore(build): 统一项目引用和包依赖配置

- 将项目引用从硬编码路径改为使用 $(AssemblyName) 变量
- 为所有项目引用添加 PrivateAssets="all" 属性
- 在 GFramework.Godot 项目中添加缺失的抽象层引用
- 更新源代码生成器测试项目的包依赖配置
- 添加 Microsoft.CodeAnalysis 和 Microsoft.CodeAnalysis.CSharp.Workspaces 包引用
This commit is contained in:
GwWuYou 2025-12-28 14:22:03 +08:00
parent 9ad300159f
commit 6b8e1fe66e
4 changed files with 7 additions and 3 deletions

View File

@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<PackageId>GeWuYou.GFramework.Core</PackageId> <PackageId>GeWuYou.$(AssemblyName)</PackageId>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks> <TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\GFramework.Core.Abstractions\GFramework.Core.Abstractions.csproj"/> <ProjectReference Include="..\$(AssemblyName).Abstractions\$(AssemblyName).Abstractions.csproj" PrivateAssets="all"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -8,6 +8,6 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\GFramework.Core\GFramework.Core.csproj"/> <ProjectReference Include="..\GFramework.Core\GFramework.Core.csproj"/>
<ProjectReference Include="..\GFramework.Game.Abstractions\GFramework.Game.Abstractions.csproj"/> <ProjectReference Include="..\$(AssemblyName).Abstractions\$(AssemblyName).Abstractions.csproj" PrivateAssets="all"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -15,6 +15,8 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\GFramework.Game\GFramework.Game.csproj"/> <ProjectReference Include="..\GFramework.Game\GFramework.Game.csproj"/>
<ProjectReference Include="..\GFramework.Game.Abstractions\GFramework.Game.Abstractions.csproj" PrivateAssets="all"/>
<ProjectReference Include="..\GFramework.Core.Abstractions\GFramework.Core.Abstractions.csproj" PrivateAssets="all"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Remove="extensions\ControlExtensions.cs"/> <Compile Remove="extensions\ControlExtensions.cs"/>

View File

@ -8,8 +8,10 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.14.0"/>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0"/> <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0"/>
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.14.0"/> <PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.14.0"/>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.14.0"/>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing" Version="1.1.2"/> <PackageReference Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing" Version="1.1.2"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1"/> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1"/>
<PackageReference Include="NUnit" Version="4.4.0"/> <PackageReference Include="NUnit" Version="4.4.0"/>