OHOS: Use native API to get most of the information needed for starting servoshell. (#37392)

Uses the native ohos-api crates to get the required information for
starting servoshell.
This increases the minimum API version requirement to API-14.

Testing: Tested on device.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
This commit is contained in:
Narfinger 2025-06-13 11:38:56 +02:00 committed by GitHub
parent 7a801f0ef5
commit 099fd10317
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 95 additions and 47 deletions

View file

@ -293,8 +293,8 @@ class OpenHarmonyTarget(CrossBuildTarget):
meta = json.load(meta_file)
ohos_api_version = int(meta["apiVersion"])
ohos_sdk_version = parse_version(meta["version"])
if ohos_sdk_version < parse_version("5.0") or ohos_api_version < 12:
raise RuntimeError("Building servo for OpenHarmony requires SDK version 5.0 (API-12) or newer.")
if ohos_sdk_version < parse_version("5.0") or ohos_api_version < 14:
raise RuntimeError("Building servo for OpenHarmony requires SDK version 5.0.2 (API-14) or newer.")
print(f"Info: The OpenHarmony SDK {ohos_sdk_version} is targeting API-level {ohos_api_version}")
except (OSError, json.JSONDecodeError) as e:
print(f"Failed to read metadata information from {package_info}")