mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-10-19 18:33:00 +08:00
[fix] restore minimum Xmake version to 3.1.1
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
|
||||
- JDK 17 或更新版本(可使用 Android Studio 自带 JBR)。
|
||||
- Android SDK Platform 36、Build Tools 36.0.0、NDK `28.2.13676358`。
|
||||
- Xmake **3.0.0 或更新版本**、Python 3.9+、Git、CMake 和主机编译工具。
|
||||
- Xmake **3.1.1 或更新版本**、Python 3.9+、Git、CMake 和主机编译工具。
|
||||
- Python 的 setuptools、wheel,用于构建依赖的宿主工具。
|
||||
|
||||
先在仓库根目录初始化子模块:
|
||||
@@ -50,7 +50,7 @@ macOS 命令行示例:
|
||||
```sh
|
||||
export ANDROID_HOME="$HOME/Library/Android/sdk"
|
||||
export JAVA_HOME="/Applications/Android Studio.app/Contents/jbr/Contents/Home"
|
||||
# 使用 PATH 中的 Xmake(最低 3.0.0),或通过 XMAKE_BIN 指定其他可执行文件。
|
||||
# 使用 PATH 中的 Xmake(最低 3.1.1),或通过 XMAKE_BIN 指定其他可执行文件。
|
||||
cd apps/android
|
||||
./gradlew :app:assembleDebug
|
||||
```
|
||||
@@ -94,7 +94,7 @@ git push origin android-v1.6.0-20261002
|
||||
|
||||
已有 Release 需要补传服务器或刷新下载信息时,可手动运行 `Update version.json from Release` 并填写已有 `source_tag`,无需重新构建。
|
||||
|
||||
工作流使用 Ubuntu 24.04、JDK 17、Python 3.13、SDK 36、Build Tools 36.0.0、NDK r28c,并使用最低支持的 Xmake 3.0.0 验证构建;本地允许使用更新的 Xmake。Gradle 使用工程内的 Wrapper,原生构建器固定 Xmake 包仓库版本。SDK/NDK 使用独立目录缓存,按宿主系统、架构和工具链版本区分;命中缓存时跳过 SDK 安装,未命中时在安装完成后立即保存,即使后续 APK 构建失败,下次也可复用。Xmake 可执行环境、固定版本的包仓库和 pip 下载也有各自的缓存;Ubuntu 系统工具只安装缺失项。
|
||||
工作流使用 Ubuntu 24.04、JDK 17、Python 3.13、SDK 36、Build Tools 36.0.0、NDK r28c,并使用最低支持的 Xmake 3.1.1 验证构建;本地允许使用更新的 Xmake。Gradle 使用工程内的 Wrapper,原生构建器固定 Xmake 包仓库版本。SDK/NDK 使用独立目录缓存,按宿主系统、架构和工具链版本区分;命中缓存时跳过 SDK 安装,未命中时在安装完成后立即保存,即使后续 APK 构建失败,下次也可复用。Xmake 可执行环境、固定版本的包仓库和 pip 下载也有各自的缓存;Ubuntu 系统工具只安装缺失项。
|
||||
|
||||
Gradle 缓存与 Android 原生依赖缓存分别管理;原生缓存按宿主架构、构建脚本及 MiniRTC 配方区分,不复用桌面或 iOS 的配置和目标文件。GitHub 托管 runner 每次启动仍是新环境;第一次运行或缓存失效时需要安装。不同分支和标签可读取默认分支的缓存,因此建议先在默认分支运行一次 `Build Android` 预热,再创建发布标签。
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
set_project("crossdesk_android")
|
||||
set_xmakever("3.0.0")
|
||||
set_xmakever("3.1.1")
|
||||
set_languages("c++17")
|
||||
add_rules("mode.release", "mode.debug")
|
||||
set_policy("package.precompiled", false)
|
||||
|
||||
@@ -12,7 +12,7 @@ ROOT = ANDROID.parents[1]
|
||||
SOURCE = ROOT / 'deps/submodules/minirtc'
|
||||
CACHE = ANDROID / '.native'
|
||||
PACKAGE_REVISION = 'eda39de3fb99b420c168f1ab9ab2d1791e11b662'
|
||||
XMAKE_MIN_VERSION = (3, 0, 0)
|
||||
XMAKE_MIN_VERSION = (3, 1, 1)
|
||||
|
||||
|
||||
def find_xmake():
|
||||
|
||||
@@ -18,16 +18,15 @@ class XmakeSelectionTest(unittest.TestCase):
|
||||
for patcher in (
|
||||
patch.dict(os.environ, {}, clear=True),
|
||||
patch.object(build_native.shutil, "which", return_value="/tools/xmake"),
|
||||
patch.object(build_native.subprocess, "check_output", return_value="xmake v3.0.0\n"),
|
||||
patch.object(build_native.subprocess, "check_output", return_value="xmake v3.1.1\n"),
|
||||
):
|
||||
patcher.start()
|
||||
self.addCleanup(patcher.stop)
|
||||
|
||||
def test_path_tool_accepts_minimum_and_newer_versions(self):
|
||||
for output in ("xmake v3.0.0", "xmake v3.0.1\n", "xmake v3.0.9\n", "xmake v3.0.99\n",
|
||||
"xmake v3.1.0\n", "xmake v3.1.1\n", "xmake v3.1.2\n", "xmake v3.1.10, A build utility\n",
|
||||
for output in ("xmake v3.1.1", "xmake v3.1.2\n", "xmake v3.1.10, A build utility\n",
|
||||
"xmake v3.2.0\n", "xmake v3.10.0\n", "xmake v4.0.0\n",
|
||||
"\x1b[1mxmake v3.0.0+HEAD.3ba37a0d4, A build utility\x1b[0m\n"):
|
||||
"\x1b[1mxmake v3.1.1+HEAD.3ba37a0d4, A build utility\x1b[0m\n"):
|
||||
with self.subTest(output=output):
|
||||
build_native.subprocess.check_output.return_value = output
|
||||
self.assertEqual(build_native.find_xmake(), "/tools/xmake")
|
||||
@@ -41,16 +40,16 @@ class XmakeSelectionTest(unittest.TestCase):
|
||||
|
||||
def test_missing_tool_reports_minimum_requirement(self):
|
||||
build_native.shutil.which.return_value = None
|
||||
with self.assertRaisesRegex(SystemExit, "Xmake 3.0.0 or newer is required"):
|
||||
with self.assertRaisesRegex(SystemExit, "Xmake 3.1.1 or newer is required"):
|
||||
build_native.find_xmake()
|
||||
build_native.subprocess.check_output.assert_not_called()
|
||||
|
||||
def test_older_or_unrecognized_versions_are_rejected(self):
|
||||
for output in ("xmake v2.9.9\n", "xmake v2.99.99\n",
|
||||
"xmake version unknown\n", "xmake v3.0\n", "xmake v3.0.0invalid\n", ""):
|
||||
for output in ("xmake v3.1.0\n", "xmake v3.0.99\n", "xmake v2.99.99\n",
|
||||
"xmake version unknown\n", "xmake v3.1\n", "xmake v3.1.1invalid\n", ""):
|
||||
with self.subTest(output=output):
|
||||
build_native.subprocess.check_output.return_value = output
|
||||
with self.assertRaisesRegex(SystemExit, "Use Xmake 3.0.0 or newer"):
|
||||
with self.assertRaisesRegex(SystemExit, "Use Xmake 3.1.1 or newer"):
|
||||
build_native.find_xmake()
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -7,7 +7,7 @@ There is no `WKWebView` or browser runtime.
|
||||
## Requirements
|
||||
|
||||
- Xcode 16 or newer
|
||||
- Xmake 3.0.0 or newer available on `PATH` (or selected with `XMAKE_BIN`)
|
||||
- Xmake 3.1.1 or newer available on `PATH` (or selected with `XMAKE_BIN`)
|
||||
- A physical arm64 iPhone/iPad running iOS 16 or newer, or an iOS simulator on Apple Silicon
|
||||
|
||||
## Build
|
||||
@@ -27,7 +27,7 @@ licenses** when cloning: `git clone --branch <source-tag> --recurse-submodules
|
||||
https://github.com/kunkundi/crossdesk.git`. The iOS marketing version is independent
|
||||
of the repository tag; use the source tag or commit recorded in the app.
|
||||
|
||||
Install [Xmake](https://xmake.io/guide/quick-start.html) 3.0.0 or newer,
|
||||
Install [Xmake](https://xmake.io/guide/quick-start.html) 3.1.1 or newer,
|
||||
CMake, and a current Python 3 with setuptools/wheel. Pin the package repository
|
||||
in a separate Xmake global directory before building:
|
||||
|
||||
@@ -105,7 +105,7 @@ or relevant build configuration also trigger it. The main
|
||||
workflow on branch/tag pushes and manual runs, and waits for its result before
|
||||
publishing a version-tag release.
|
||||
|
||||
The workflow builds with the minimum supported Xmake version (3.0.0) and retains
|
||||
The workflow builds with the minimum supported Xmake version (3.1.1) and retains
|
||||
the pinned Xcode/SDK, dependency cache, license catalog validation, unsigned arm64
|
||||
Release build, and app-bundle verification. Unit tests run locally as needed.
|
||||
It uploads
|
||||
|
||||
@@ -900,7 +900,7 @@
|
||||
],
|
||||
"bundle_sha256": "f54e5e2168bf6e91d81a413931a052d29f59e0c221df5e1de3f51bd27c662c3a",
|
||||
"toolchain": {
|
||||
"xmake_min_version": "3.0.0",
|
||||
"xmake_min_version": "3.1.1",
|
||||
"xmake_repository_revision": "121109352da272cd1a3d4ed52f2dcda34f839955"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ class LicenseValidationTest(unittest.TestCase):
|
||||
self.target.write_text(str(self.root / "packages/a/asio/1.0/abcd/include") + "\n")
|
||||
self.lock = {
|
||||
"bundle_sha256": licenses.digest(self.bundle.read_bytes()),
|
||||
"toolchain": {"xmake_min_version": "3.0.0"},
|
||||
"toolchain": {"xmake_min_version": "3.1.1"},
|
||||
"components": [
|
||||
{
|
||||
"id": "minirtc", "version": self.reviewed_revision,
|
||||
@@ -151,21 +151,20 @@ class LicenseValidationTest(unittest.TestCase):
|
||||
|
||||
def test_minimum_and_newer_xmake_versions_are_accepted(self):
|
||||
version = self.root / "xmake-version.txt"
|
||||
for output in ("xmake v3.0.0", "xmake v3.0.1\n", "xmake v3.0.9\n", "xmake v3.0.99\n",
|
||||
"xmake v3.1.0\n", "xmake v3.1.1\n", "xmake v3.1.2\n", "xmake v3.1.10, A build utility\n",
|
||||
for output in ("xmake v3.1.1", "xmake v3.1.2\n", "xmake v3.1.10, A build utility\n",
|
||||
"xmake v3.2.0\n", "xmake v3.10.0\n", "xmake v4.0.0\n",
|
||||
"\x1b[1mxmake v3.0.0+HEAD.3ba37a0d4, A build utility\x1b[0m\n"):
|
||||
"\x1b[1mxmake v3.1.1+HEAD.3ba37a0d4, A build utility\x1b[0m\n"):
|
||||
with self.subTest(output=output):
|
||||
version.write_text(output)
|
||||
self.verify(xmake_version=version)
|
||||
|
||||
def test_older_or_unrecognized_xmake_versions_are_rejected(self):
|
||||
version = self.root / "xmake-version.txt"
|
||||
for output in ("xmake v2.9.9\n", "xmake v2.99.99\n",
|
||||
"xmake version unknown\n", "xmake v3.0\n", "xmake v3.0.0invalid\n", ""):
|
||||
for output in ("xmake v3.1.0\n", "xmake v3.0.99\n", "xmake v2.99.99\n",
|
||||
"xmake version unknown\n", "xmake v3.1\n", "xmake v3.1.1invalid\n", ""):
|
||||
with self.subTest(output=output):
|
||||
version.write_text(output)
|
||||
with self.assertRaisesRegex(ValueError, "Xmake 3.0.0 or newer is required"):
|
||||
with self.assertRaisesRegex(ValueError, "Xmake 3.1.1 or newer is required"):
|
||||
self.verify(xmake_version=version)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user