mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-10-29 01:02:44 +08:00
[build] unify minimum Xmake version across platforms
This commit is contained in:
+7
-6
@@ -7,7 +7,7 @@ There is no `WKWebView` or browser runtime.
|
||||
## Requirements
|
||||
|
||||
- Xcode 16 or newer
|
||||
- Xmake 3.1.1 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 3.1.1](https://github.com/xmake-io/xmake/releases/tag/v3.1.1),
|
||||
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:
|
||||
|
||||
@@ -41,7 +41,7 @@ git -C "$XMAKE_GLOBALDIR/.xmake/repositories/xmake-repo" checkout --detach 12110
|
||||
Keep `XMAKE_GLOBALDIR` set for command-line Xcode builds. For builds launched
|
||||
from the Xcode app, set it as a user-defined build setting on the target, or
|
||||
pin the default `~/.xmake/repositories/xmake-repo` instead. The build checks
|
||||
the tool version, package repository commit and reviewed recipe hashes.
|
||||
the minimum Xmake version, package repository commit and reviewed recipe hashes.
|
||||
Application dependencies are built from source, with Xmake precompiled
|
||||
package downloads disabled.
|
||||
|
||||
@@ -105,9 +105,10 @@ 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 retains the pinned Xcode/SDK and Xmake versions, dependency cache,
|
||||
license and privacy checks, unsigned arm64 Release build, and app-bundle
|
||||
verification. It uploads `crossdesk-ios-arm64-unsigned-v<marketing-version>-<date>.zip`,
|
||||
The workflow tests the minimum supported Xmake version (3.1.1) and retains the
|
||||
pinned Xcode/SDK, dependency cache, license and privacy checks, unsigned arm64
|
||||
Release build, and app-bundle verification. It uploads
|
||||
`crossdesk-ios-arm64-unsigned-v<marketing-version>-<date>.zip`,
|
||||
including the app, source metadata, third-party source catalog, rights notice
|
||||
and any generated dSYM. The version comes from the iOS target; dated repository
|
||||
tags provide the build date, otherwise the date uses the Asia/Shanghai timezone.
|
||||
|
||||
@@ -900,7 +900,7 @@
|
||||
],
|
||||
"bundle_sha256": "f54e5e2168bf6e91d81a413931a052d29f59e0c221df5e1de3f51bd27c662c3a",
|
||||
"toolchain": {
|
||||
"xmake_version": "3.1.1",
|
||||
"xmake_min_version": "3.1.1",
|
||||
"xmake_repository_revision": "121109352da272cd1a3d4ed52f2dcda34f839955"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,9 +137,10 @@ def generate(lock, cache):
|
||||
def verify(lock, inputs, target_info, xmake_repository=None, xmake_version=None):
|
||||
checked(OUTPUT.read_bytes(), lock["bundle_sha256"], str(OUTPUT))
|
||||
if xmake_version is not None:
|
||||
version = re.search(r"xmake v(\d+\.\d+\.\d+)", xmake_version.read_text())
|
||||
if not version or version[1] != lock["toolchain"]["xmake_version"]:
|
||||
raise ValueError("Xmake version differs from the reviewed iOS toolchain; see apps/ios/README.md")
|
||||
minimum = lock["toolchain"]["xmake_min_version"]
|
||||
version = re.search(r"xmake v(\d+)\.(\d+)\.(\d+)(?:\+|[,\s]|$)", xmake_version.read_text())
|
||||
if not version or tuple(map(int, version.groups())) < tuple(map(int, minimum.split("."))):
|
||||
raise ValueError(f"Xmake {minimum} or newer is required; see apps/ios/README.md")
|
||||
if xmake_repository is not None:
|
||||
revision = subprocess.check_output(
|
||||
["git", "-C", str(xmake_repository), "rev-parse", "HEAD"], text=True).strip()
|
||||
|
||||
@@ -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_version": "3.1.1"},
|
||||
"toolchain": {"xmake_min_version": "3.1.1"},
|
||||
"components": [
|
||||
{
|
||||
"id": "minirtc", "version": self.reviewed_revision,
|
||||
@@ -149,11 +149,23 @@ class LicenseValidationTest(unittest.TestCase):
|
||||
with self.assertRaisesRegex(ValueError, "Source checksum mismatch: .*libopus.a"):
|
||||
self.verify()
|
||||
|
||||
def test_unreviewed_toolchain_is_rejected(self):
|
||||
def test_minimum_and_newer_xmake_versions_are_accepted(self):
|
||||
version = self.root / "xmake-version.txt"
|
||||
version.write_text("xmake v3.1.2\n")
|
||||
with self.assertRaisesRegex(ValueError, "Xmake version differs"):
|
||||
self.verify(xmake_version=version)
|
||||
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.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 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.1.1 or newer is required"):
|
||||
self.verify(xmake_version=version)
|
||||
|
||||
|
||||
class ComponentSourceTest(unittest.TestCase):
|
||||
|
||||
Reference in New Issue
Block a user