From a5479e01ed6029d852870df1387e30bd6a5460b0 Mon Sep 17 00:00:00 2001 From: Jonathan Schwender Date: Tue, 18 Nov 2025 14:48:58 +0100 Subject: [PATCH] Update ohos-build and ohos CI - Update SDK version in CI - Support `--target ` in ohos-build. Signed-off-by: Jonathan Schwender --- .github/workflows/build.yml | 4 ++-- ohos-build | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cc63fdbf7ed..d3b3d898ab6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -231,9 +231,9 @@ jobs: - uses: actions/checkout@v4 - name: Setup OpenHarmony SDK id: setup_sdk - uses: openharmony-rs/setup-ohos-sdk@v0.1 + uses: openharmony-rs/setup-ohos-sdk@v0.2 with: - version: "4.1" + version: "5.0.2" - name: Install Rust uses: dtolnay/rust-toolchain@master id: toolchain diff --git a/ohos-build b/ohos-build index d6aa1ecb64c..4574968e79e 100755 --- a/ohos-build +++ b/ohos-build @@ -1,4 +1,4 @@ -#!/bin/env python +#!/usr/bin/env python3 # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -12,9 +12,17 @@ from typing import Dict, Optional def get_target_from_args() -> Optional[str]: + is_target_arg = False for arg in sys.argv: - if arg.startswith("--target="): + if is_target_arg: + return arg + elif arg.startswith("--target="): return arg.replace("--target=", "") + elif arg == "--target": + is_target_arg = True + continue + if is_target_arg: + print("Warn: Missing argument after `--target`.") return None