Skip to content

fix: 修复 26.1-pre-1 版本号无法归一化的问题#5765

Merged
Glavo merged 2 commits intoHMCL-dev:mainfrom
Mine-diamond:26.1.pre-1
Mar 11, 2026
Merged

fix: 修复 26.1-pre-1 版本号无法归一化的问题#5765
Glavo merged 2 commits intoHMCL-dev:mainfrom
Mine-diamond:26.1.pre-1

Conversation

@Mine-diamond
Copy link
Contributor

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 修复了游戏版本号在遇到 -pre-(例如 26.1-pre-1)这种格式时无法正确归一化的问题,确保 toNormalizedString() 能输出项目期望的标准形式(-pre1)。

Changes:

  • GameVersionNumber.Release.parse 中新增对 -pre- 前缀的解析与归一化逻辑
  • 增加单元测试覆盖 26.1-pre-1 -> 26.1-pre1 的归一化结果

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
HMCLCore/src/main/java/org/jackhuang/hmcl/util/versioning/GameVersionNumber.java 在解析后缀时识别 -pre- 并设置 needNormalize,归一化为 -pre + 版本号
HMCLCore/src/test/java/org/jackhuang/hmcl/util/versioning/GameVersionNumberTest.java 新增用例验证 26.1-pre-1 会被归一化为 26.1-pre1

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Glavo Glavo merged commit 27c73b4 into HMCL-dev:main Mar 11, 2026
6 checks passed
@Mine-diamond Mine-diamond deleted the 26.1.pre-1 branch March 11, 2026 12:38
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.

3 participants