Skip to content

feat(build): 修改项目构建配置和依赖管理#248

Merged
GeWuYou merged 1 commit intomainfrom
feat/build-config
Apr 17, 2026
Merged

feat(build): 修改项目构建配置和依赖管理#248
GeWuYou merged 1 commit intomainfrom
feat/build-config

Conversation

@GeWuYou
Copy link
Copy Markdown
Owner

@GeWuYou GeWuYou commented Apr 17, 2026

  • 添加 Directory.Build.props 统一构建属性配置
  • 配置 netstandard2.0 和 netstandard2.1 目标框架
  • 集成 Meziantou.Polyfill 提供新特性支持
  • 设置 Nullable 启用可空类型检查
  • 配置文档文件生成和包标识设置
  • 添加 Microsoft.CodeAnalysis 相关包引用
  • 配置项目引用和命名空间引入规则

Summary by CodeRabbit

变更日志

  • 杂项
    • 实现构建配置的中央集中管理,统一所有项目的依赖版本配置。
    • 优化项目文件结构,移除冗余的包管理配置以提高构建效率和代码维护性。

- 添加 Directory.Build.props 统一构建属性配置
- 配置 netstandard2.0 和 netstandard2.1 目标框架
- 集成 Meziantou.Polyfill 提供新特性支持
- 设置 Nullable 启用可空类型检查
- 配置文档文件生成和包标识设置
- 添加 Microsoft.CodeAnalysis 相关包引用
- 配置项目引用和命名空间引入规则
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1954bb98-1534-4601-a77b-a6a39883e1f1

📥 Commits

Reviewing files that changed from the base of the PR and between 6b4631e and d3c5c4c.

📒 Files selected for processing (13)
  • Directory.Build.props
  • GFramework.Core.Abstractions/Directory.Build.props
  • GFramework.Core.Abstractions/GFramework.Core.Abstractions.csproj
  • GFramework.Core.SourceGenerators.Abstractions/Directory.Build.props
  • GFramework.Core.SourceGenerators.Abstractions/GFramework.Core.SourceGenerators.Abstractions.csproj
  • GFramework.Cqrs.Abstractions/Directory.Build.props
  • GFramework.Ecs.Arch.Abstractions/Directory.Build.props
  • GFramework.Game.Abstractions/Directory.Build.props
  • GFramework.Game.Abstractions/GFramework.Game.Abstractions.csproj
  • GFramework.Godot.SourceGenerators.Abstractions/Directory.Build.props
  • GFramework.Godot.SourceGenerators.Abstractions/GFramework.Godot.SourceGenerators.Abstractions.csproj
  • GFramework.SourceGenerators.Common/Directory.Build.props
  • GFramework.SourceGenerators.Common/GFramework.SourceGenerators.Common.csproj
💤 Files with no reviewable changes (5)
  • GFramework.Godot.SourceGenerators.Abstractions/GFramework.Godot.SourceGenerators.Abstractions.csproj
  • GFramework.Game.Abstractions/GFramework.Game.Abstractions.csproj
  • GFramework.SourceGenerators.Common/GFramework.SourceGenerators.Common.csproj
  • GFramework.Core.SourceGenerators.Abstractions/GFramework.Core.SourceGenerators.Abstractions.csproj
  • GFramework.Core.Abstractions/GFramework.Core.Abstractions.csproj
📜 Recent review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build and Test
  • GitHub Check: Code Quality & Security
  • GitHub Check: Analyze (C#)
🧰 Additional context used
🧠 Learnings (11)
📚 Learning: 2026-04-16T11:55:23.931Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T11:55:23.931Z
Learning: Applies to **/*.csproj : Follow the repository defaults with `ImplicitUsings` disabled, `Nullable` enabled, `GenerateDocumentationFile` enabled for shipped libraries, and `LangVersion` generally `preview` in the main libraries and abstractions

Applied to files:

  • Directory.Build.props
  • GFramework.Ecs.Arch.Abstractions/Directory.Build.props
  • GFramework.Godot.SourceGenerators.Abstractions/Directory.Build.props
  • GFramework.Game.Abstractions/Directory.Build.props
  • GFramework.SourceGenerators.Common/Directory.Build.props
  • GFramework.Cqrs.Abstractions/Directory.Build.props
  • GFramework.Core.SourceGenerators.Abstractions/Directory.Build.props
  • GFramework.Core.Abstractions/Directory.Build.props
📚 Learning: 2026-04-16T11:55:23.932Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T11:55:23.932Z
Learning: Applies to **/*.csproj : Minimize new package dependencies. Add them only when necessary and keep scope narrow

Applied to files:

  • Directory.Build.props
  • GFramework.Ecs.Arch.Abstractions/Directory.Build.props
  • GFramework.Godot.SourceGenerators.Abstractions/Directory.Build.props
  • GFramework.Game.Abstractions/Directory.Build.props
  • GFramework.SourceGenerators.Common/Directory.Build.props
  • GFramework.Cqrs.Abstractions/Directory.Build.props
  • GFramework.Core.SourceGenerators.Abstractions/Directory.Build.props
  • GFramework.Core.Abstractions/Directory.Build.props
📚 Learning: 2026-04-16T11:55:23.932Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T11:55:23.932Z
Learning: Applies to **/*.Tests.csproj : Public API changes must be covered by unit or integration tests

Applied to files:

  • Directory.Build.props
  • GFramework.Ecs.Arch.Abstractions/Directory.Build.props
  • GFramework.Godot.SourceGenerators.Abstractions/Directory.Build.props
  • GFramework.SourceGenerators.Common/Directory.Build.props
  • GFramework.Cqrs.Abstractions/Directory.Build.props
  • GFramework.Core.SourceGenerators.Abstractions/Directory.Build.props
  • GFramework.Core.Abstractions/Directory.Build.props
📚 Learning: 2026-04-16T11:55:23.932Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T11:55:23.932Z
Learning: Applies to **/*.cs : The repository uses `Meziantou.Analyzer`; treat analyzer feedback as part of the coding standard

Applied to files:

  • Directory.Build.props
  • GFramework.Ecs.Arch.Abstractions/Directory.Build.props
  • GFramework.Godot.SourceGenerators.Abstractions/Directory.Build.props
  • GFramework.Game.Abstractions/Directory.Build.props
  • GFramework.SourceGenerators.Common/Directory.Build.props
  • GFramework.Cqrs.Abstractions/Directory.Build.props
  • GFramework.Core.SourceGenerators.Abstractions/Directory.Build.props
  • GFramework.Core.Abstractions/Directory.Build.props
📚 Learning: 2026-04-16T11:55:23.932Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T11:55:23.932Z
Learning: Applies to **/*.cs : When adding analyzers or suppressions, keep them minimal and justify them in code comments if the reason is not obvious

Applied to files:

  • Directory.Build.props
📚 Learning: 2026-04-06T12:45:47.739Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 190
File: GFramework.Game/Config/GameConfigBootstrap.cs:1-3
Timestamp: 2026-04-06T12:45:47.739Z
Learning: In the GFramework repository (GeWuYou/GFramework), even though `ImplicitUsings` is disabled in the `.csproj` files, the project uses a manual `GlobalUsings.cs` file with `global using` directives to provide common System namespaces (e.g., System, System.Threading, System.Threading.Tasks) project-wide. Do not flag missing System-level `using` imports in C# files within this repository, as they are covered by GlobalUsings.cs.

Applied to files:

  • GFramework.Ecs.Arch.Abstractions/Directory.Build.props
  • GFramework.Godot.SourceGenerators.Abstractions/Directory.Build.props
  • GFramework.Game.Abstractions/Directory.Build.props
  • GFramework.Core.SourceGenerators.Abstractions/Directory.Build.props
  • GFramework.Core.Abstractions/Directory.Build.props
📚 Learning: 2026-04-16T11:55:23.932Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T11:55:23.932Z
Learning: Applies to **/*.cs : Preserve deterministic behavior in registries, lifecycle orchestration, and generated outputs

Applied to files:

  • GFramework.Ecs.Arch.Abstractions/Directory.Build.props
📚 Learning: 2026-04-16T13:25:59.124Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 235
File: GFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.cs:1-3
Timestamp: 2026-04-16T13:25:59.124Z
Learning: In the GeWuYou/GFramework repository, the test project `GFramework.SourceGenerators.Tests` provides `global using NUnit.Framework;` via its `GlobalUsings.cs`. Do not flag missing `using NUnit.Framework;` directives in test files within this project, as the global using already covers it. The project-wide GlobalUsings.cs pattern is used broadly to supply common namespaces (including NUnit, System.IO, etc.) without per-file imports.

Applied to files:

  • GFramework.Ecs.Arch.Abstractions/Directory.Build.props
  • GFramework.Core.SourceGenerators.Abstractions/Directory.Build.props
📚 Learning: 2026-04-16T11:55:23.932Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T11:55:23.932Z
Learning: Applies to **/*.SourceGenerators.cs : Keep source generators deterministic and free of hidden environment or network dependencies

Applied to files:

  • GFramework.Ecs.Arch.Abstractions/Directory.Build.props
  • GFramework.Godot.SourceGenerators.Abstractions/Directory.Build.props
  • GFramework.SourceGenerators.Common/Directory.Build.props
  • GFramework.Core.SourceGenerators.Abstractions/Directory.Build.props
📚 Learning: 2026-04-16T11:55:23.932Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T11:55:23.932Z
Learning: Applies to **/*.SourceGenerators.cs : When generator behavior changes intentionally, update snapshots together with the implementation

Applied to files:

  • GFramework.Godot.SourceGenerators.Abstractions/Directory.Build.props
  • GFramework.SourceGenerators.Common/Directory.Build.props
  • GFramework.Core.SourceGenerators.Abstractions/Directory.Build.props
📚 Learning: 2026-04-16T11:55:23.932Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T11:55:23.932Z
Learning: Applies to **/*.SourceGenerators.Tests.cs : Preserve snapshot-based verification patterns already used in the repository for source generator tests

Applied to files:

  • GFramework.SourceGenerators.Common/Directory.Build.props
  • GFramework.Core.SourceGenerators.Abstractions/Directory.Build.props
🔇 Additional comments (8)
GFramework.Core.Abstractions/Directory.Build.props (1)

15-17: 集中依赖继承方式合理,改动通过。

Line 15 保持项目级显式启用 Meziantou.Polyfill,Line 17 通过父级 Directory.Build.props 统一版本与资产策略,结构清晰且便于维护。

Directory.Build.props (1)

3-12: 仓库级依赖与分析器统一配置设计正确。

Meziantou.AnalyzerMeziantou.Polyfill 的版本/资产范围集中到根 Directory.Build.props,可减少重复并降低后续升级成本。

GFramework.Ecs.Arch.Abstractions/Directory.Build.props (1)

9-11: 依赖下沉到父级配置的实现一致且可维护。

Line 9 + Line 11 的组合与根配置协同正常,能够保持该项目仅在需要时启用 polyfill,同时复用统一版本管理。

GFramework.Cqrs.Abstractions/Directory.Build.props (1)

9-11: 该项目的包引用继承链配置正确。

PackageReference Include 与父级 Import 的配套改动完整,符合统一管理依赖版本的目标。

GFramework.SourceGenerators.Common/Directory.Build.props (1)

15-17: SourceGenerator 公共项目的构建配置调整合理。

该改动保持项目侧最小声明(仅声明需要的 polyfill),并把版本与资产细节统一收敛到父级配置。

GFramework.Godot.SourceGenerators.Abstractions/Directory.Build.props (1)

15-17: Godot SourceGenerator 抽象层配置与全仓策略一致。

该段改动与其他子项目保持一致,依赖声明职责边界清晰,便于后续统一升级。

GFramework.Game.Abstractions/Directory.Build.props (1)

15-17: Game 抽象层的依赖配置收敛实现正确。

将版本与元数据统一放到父级后,此处只保留必要引用,维护成本更低。

GFramework.Core.SourceGenerators.Abstractions/Directory.Build.props (1)

15-17: Core SourceGenerator 抽象项目的继承配置改动通过。

Meziantou.Polyfill 的声明与父级导入配合良好,符合本次“集中构建配置与依赖管理”的目标。


📝 Walkthrough

概述

此更改将 Meziantou.Analyzer 和 Meziantou.Polyfill 包引用从各个项目文件集中到根目录 Directory.Build.props 文件中,减少配置重复并统一版本管理。

变更

项目 / 文件 摘要
根级构建配置
Directory.Build.props
新增根级构建属性文件,定义 Meziantou.Analyzer(v3.0.48)和 Meziantou.Polyfill(v1.0.110)的共享包引用配置。
子项目 Directory.Build.props
GFramework.Core.Abstractions/Directory.Build.props, GFramework.Core.SourceGenerators.Abstractions/Directory.Build.props, GFramework.Cqrs.Abstractions/Directory.Build.props, GFramework.Ecs.Arch.Abstractions/Directory.Build.props, GFramework.Game.Abstractions/Directory.Build.props, GFramework.Godot.SourceGenerators.Abstractions/Directory.Build.props, GFramework.SourceGenerators.Common/Directory.Build.props
移除显式的 Meziantou 包版本和资源配置,替换为仅包含 Meziantou.Polyfill 的无版本引用,并添加条件导入父级 Directory.Build.props。
项目文件
GFramework.Core.Abstractions/GFramework.Core.Abstractions.csproj, GFramework.Core.SourceGenerators.Abstractions/GFramework.Core.SourceGenerators.Abstractions.csproj, GFramework.Game.Abstractions/GFramework.Game.Abstractions.csproj, GFramework.Godot.SourceGenerators.Abstractions/GFramework.Godot.SourceGenerators.Abstractions.csproj, GFramework.SourceGenerators.Common/GFramework.SourceGenerators.Common.csproj
移除项目级的 Meziantou.Analyzer 和 Meziantou.Polyfill 包引用更新条目,让版本由集中的 Directory.Build.props 管理。

代码审查工作量估算

🎯 3 (中等) | ⏱️ ~20 分钟

可能相关的 PR

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR标题是中文,描述了添加Directory.Build.props以统一构建配置和依赖管理的主要改动,与变更集高度相关且清晰明确。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/build-config

Comment @coderabbitai help to get the list of available commands and usage tips.

@GeWuYou GeWuYou merged commit 665b3e8 into main Apr 17, 2026
7 checks passed
@GeWuYou GeWuYou deleted the feat/build-config branch April 17, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant