Update VersionTable to show MC version compatibility range

This commit is contained in:
CPTProgrammer
2026-07-10 08:37:23 +08:00
parent e8d4994cec
commit ef276b6ef4
2 changed files with 9 additions and 5 deletions
+5 -2
View File
@@ -95,11 +95,14 @@
1. 读取 `{project_dir}/{project_properties_path}`,提取 `mod_version_field` 对应的值 → `version`
2. 扫描 `{project_dir}/{minecraft_properties_dir}/` 目录,获取所有 `${mc_version}.properties` 文件名 → `mc_version[]`
3. 遍历每个 `mc_version`
3. `mc_version[]` 排序后计算每个版本的兼容范围
- 非最后一个版本:范围为 `[当前版本, 下一个版本)`,如 `"1.19.1"``"1.19.1-1.19.2"`
- 最后一个版本:`< 26` 的版本用 `~` 匹配次版本号(如 `1.21.x`);`≥ 26` 的版本用 `^` 匹配主版本号(如 `26.x`),截止版本由用户在下拉框中选择
4. 遍历每个 `mc_version`
-`version``mc_version` 填入 `filename_format` 模板,生成构建产物文件名
-`version``mc_version` 填入 `source_filename_format` 模板,生成源码文件名
- 检查 `{project_dir}/build/libs/` 下是否存在对应文件
4. 将所有匹配结果返回前端,由 VersionTable 展示(MC 版本 | 构建产物 | 源码)
5. 将所有匹配结果返回前端,由 VersionTable 展示(MC 版本 | 兼容范围 | 构建产物 | 源码)
### 4. 版本确认与发布