Skip to content

Commit 9c3843e

Browse files
authored
Update ohos-build and ohos CI (#664)
- Update SDK version in CI - Support `--target <target>` in ohos-build. Signed-off-by: Jonathan Schwender <[email protected]>
1 parent 4b94ef2 commit 9c3843e

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ jobs:
231231
- uses: actions/checkout@v4
232232
- name: Setup OpenHarmony SDK
233233
id: setup_sdk
234-
uses: openharmony-rs/setup-ohos-sdk@v0.1
234+
uses: openharmony-rs/setup-ohos-sdk@v0.2
235235
with:
236-
version: "4.1"
236+
version: "5.0.2"
237237
- name: Install Rust
238238
uses: dtolnay/rust-toolchain@master
239239
id: toolchain

ohos-build

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/env python
1+
#!/usr/bin/env python3
22
# This Source Code Form is subject to the terms of the Mozilla Public
33
# License, v. 2.0. If a copy of the MPL was not distributed with this
44
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
@@ -12,9 +12,17 @@ from typing import Dict, Optional
1212

1313

1414
def get_target_from_args() -> Optional[str]:
15+
is_target_arg = False
1516
for arg in sys.argv:
16-
if arg.startswith("--target="):
17+
if is_target_arg:
18+
return arg
19+
elif arg.startswith("--target="):
1720
return arg.replace("--target=", "")
21+
elif arg == "--target":
22+
is_target_arg = True
23+
continue
24+
if is_target_arg:
25+
print("Warn: Missing argument after `--target`.")
1826
return None
1927

2028

0 commit comments

Comments
 (0)