-
Notifications
You must be signed in to change notification settings - Fork 2.5k
HarmonyOS/OpenHarmony Port #13152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MetsukiMio
wants to merge
92
commits into
libsdl-org:main
Choose a base branch
from
OpenMinecraft-Dev:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
HarmonyOS/OpenHarmony Port #13152
Changes from all commits
Commits
Show all changes
92 commits
Select commit
Hold shift + click to select a range
462476f
Harmony port: Workflows
MetsukiMio a6ebc6a
Harmony port: Workflows (disable other plats)
MetsukiMio 15cbc26
Harmony port: Workflows (fix script error)
MetsukiMio 95ccfa6
Harmony port: Workflows (fix script error)
MetsukiMio 8f0b9c1
Harmony port: Workflows (fix script error)
MetsukiMio 1c48676
Harmony port: window fetching
MetsukiMio addb748
Harmony port: disable lib version suffix
MetsukiMio 845ba7d
Harmony port: video vulkan library & disable version test
MetsukiMio f25cbb1
Harmony port: video vulkan library & disable version test
MetsukiMio 4f5fcf6
Harmony port: video vulkan library & disable version test
MetsukiMio e339bde
Harmony port: video vulkan library
MetsukiMio 1e75f1f
Harmony port: video vulkan library
MetsukiMio cd0d25c
Harmony port: video library
MetsukiMio 8b6c78c
Harmony port: window creation
MetsukiMio 9e61fcb
Harmony port: egl/gles lib
MetsukiMio dc28e96
Harmony port: keyboard event
MetsukiMio 2570e9a
Harmony port: video drv fix
MetsukiMio af96018
Harmony port: napi callback shell
MetsukiMio 4a0d068
Harmony port: review changes
MetsukiMio 590509b
Harmony port: review changes
MetsukiMio c99ae6e
Harmony port: review changes
MetsukiMio 298581d
Harmony port: review changes
MetsukiMio 231ed48
Harmony port: review changes
MetsukiMio 0f2b280
Harmony port: entrypoint
MetsukiMio a910997
Harmony port: entrypoint
MetsukiMio b182ae0
Harmony port: entrypoint
MetsukiMio d031a49
Harmony port: entrypoint
MetsukiMio 04e8042
Harmony port: entrypoint
MetsukiMio d4039d3
Harmony port: entrypoint
MetsukiMio 27df340
Harmony port: video device
Rwagsu cf3353a
Harmony port: call test
MetsukiMio 9605a66
Harmony port: fix
MetsukiMio 56ccf29
Harmony port: napi shell
MetsukiMio c951070
Harmony port: touch event
MetsukiMio e919066
Harmony port: fix
MetsukiMio 048a59b
Harmony port: fix
MetsukiMio 167fe8b
Harmony port: fix
MetsukiMio 01fed59
Harmony port: fix
MetsukiMio a4b48d3
Harmony port: surface destroy
MetsukiMio 35ea914
Harmony port: fix
MetsukiMio 05f4fa7
Merge branch 'libsdl-org:main' into main
MetsukiMio ec58846
Harmony port: fix napi call
Rwagsu a886df9
Merge branch 'main' of github.com:libsdl-org/SDL
MetsukiMio 9c3e5f2
Harmony port: pthread enable
MetsukiMio cf69678
Update create-test-plan.py
MetsukiMio 4781c60
Update generic.yml
MetsukiMio 56cea28
Update CMakeLists.txt
MetsukiMio 0f4c8f5
Update create-test-plan.py
MetsukiMio f6147e0
Update SDL_ohos.c
MetsukiMio 2b5815a
Update CMakeLists.txt
MetsukiMio 376aa5d
Update create-test-plan.py
MetsukiMio 29c6d18
Update create-test-plan.py
MetsukiMio a649753
Harmony port: format
MetsukiMio e7bcd9a
Harmony port: workflow fix [sdl-ci-filter harmony]
MetsukiMio d7a01e6
Harmony port: workflow fix [sdl-ci-filter harmony]
MetsukiMio b8f497f
Harmony port: workflow fix [sdl-ci-filter harmony]
MetsukiMio 38a7790
Harmony port: workflow fix [sdl-ci-filter harmony-*]
MetsukiMio e7e0bd2
Harmony port: workflow fix [sdl-ci-filter harmony-*]
MetsukiMio e7fdb9c
Harmony port: workflow
MetsukiMio 973260a
OpenHarmony Port (renderer)
MetsukiMio 69104d0
Harmony port: entrypoint multithread
MetsukiMio 44497fc
fix
MetsukiMio 56e42de
Harmony port: dialog
MetsukiMio 3e64c9e
Harmony port: locale
MetsukiMio bc8a018
Harmony port: ohos project
MetsukiMio 3e14b2b
Harmony port: fix
MetsukiMio 9f185fa
Merge branch 'main' of github.com:libsdl-org/SDL
MetsukiMio 791e9b2
Merge branch 'main' of github.com:libsdl-org/SDL
MetsukiMio ed283ad
Harmony port: main project
MetsukiMio 768c89c
Harmony port: doc v0
MetsukiMio eac69a2
Merge branch 'libsdl-org:main' into main
MetsukiMio 4d331f4
OpenHarmony: locale subsystem
MetsukiMio e954eb5
Merge branch 'main' of https://github.com/libsdl-org/SDL
MetsukiMio cb58ba5
OpenHarmony: shell update
MetsukiMio ee6e129
Merge branch 'main' of github.com:libsdl-org/SDL
MetsukiMio 2ebb950
Merge branch 'libsdl-org:main' into main
MetsukiMio fcbdd08
OpenHarmony port: events
MetsukiMio 94fe990
OpenHarmony port: fix
MetsukiMio e51d3de
Merge branch 'libsdl-org:main' into main
MetsukiMio 9791c6a
OpenHarmony: fix
MetsukiMio cce5233
Merge branch 'main' of github.com:OpenMinecraft-Dev/SDL
MetsukiMio 5bb106f
OpenHarmony: fix
MetsukiMio d74b920
Merge branch 'libsdl-org:main' into main
MetsukiMio efd94a7
OpenHarmony: test web view
MetsukiMio 30e6321
Merge branch 'main' of github.com:OpenMinecraft-Dev/SDL
MetsukiMio ecad524
Update SDL_ohosvideo.c
MetsukiMio 89540d9
OpenHarmony: test
MetsukiMio 41256bc
OpenHarmony: misc api
MetsukiMio a48cde9
OpenHarmony: battery API
MetsukiMio 9f5452f
OpenHarmony: file selection
MetsukiMio 38aedfd
OpenHarmony: dialog api finish
MetsukiMio 07b6761
OpenHarmony: sensors
MetsukiMio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: 'Setup Harmony toolchain' | ||
| inputs: | ||
| version: | ||
| description: 'Harmony version' | ||
| default: '5.0.0-Release' | ||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - uses: actions/cache/restore@v4 | ||
| id: restore-cache | ||
| with: | ||
| path: /opt/native | ||
| key: harmony-${{ inputs.version }} | ||
|
|
||
| - name: Download Harmony toolchain | ||
| if: ${{ !steps.restore-cache.outputs.cache-hit }} | ||
| shell: bash | ||
| run: | | ||
| wget https://repo.huaweicloud.com/openharmony/os/${{ inputs.version }}/ohos-sdk-windows_linux-public.tar.gz | ||
| tar -zxvf ohos-sdk-windows_linux-public.tar.gz | ||
| mkdir -p /opt | ||
|
|
||
| unzip linux/native*.zip -d /opt | ||
| - uses: actions/cache/save@v4 | ||
| if: ${{ !steps.restore-cache.outputs.cache-hit }} | ||
| with: | ||
| path: /opt/native | ||
| key: harmony-${{ inputs.version }} | ||
| - name: 'Set output vars' | ||
| id: final | ||
| shell: bash | ||
| run: | | ||
| echo "HARMONY_NATIVE_SDK=/opt/native" >> $GITHUB_OUTPUT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| OpenHarmony / HarmonyOS | ||
| ================================================================================ | ||
|
|
||
| Requirements | ||
| ================================================================================ | ||
|
|
||
| DevEco Studio 5.0.0 or later | ||
| https://developer.huawei.com/consumer/en/download | ||
|
|
||
| Harmony OS Development Toolchain 5.0.0 (API 12) or later (Bundled in the DevEco Studio) | ||
|
|
||
|
|
||
| How the port works | ||
| ================================================================================ | ||
|
|
||
| - OpenHarmony / Harmony OS apps are based on ArkTS/JS running on the Ark JS runtime, optionally with parts written in C | ||
| - We can use the napi and ndk provided by the Harmony SDK to fetch the app window, context and so on. We wrote a simple Harmony shell for SDL, simpily initialize the basic application and the context for SDL library, then runs your app in another thread. (Harmony JS apps only contains one thread, if we runs your app main loop directly in JS, the whole app just freezes) | ||
| - This produces a .hap or .app package which can be installed in OpenHarmony and HarmonyOS Emulators (you will need to apply for a certificate to sign the app before testing it on a real HarmonyOS machine) | ||
|
|
||
|
|
||
| Building the example app and test it (HarmonyOS Emulator) | ||
| ================================================================================ | ||
|
|
||
| Download the DevEco Studio, and open the ohos-project folder in this repo | ||
|
|
||
| Then, download a emulator in the Device Manager tab, and runs it. | ||
|
|
||
| Click the run button, the IDE will automatically build the app and run it for you, you can act with your app in the emulator window. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| /node_modules | ||
| /oh_modules | ||
| /local.properties | ||
| /.idea | ||
| **/build | ||
| /.hvigor | ||
| .cxx | ||
| /.clangd | ||
| /.clang-format | ||
| /.clang-tidy | ||
| **/.test | ||
| /.appanalyzer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "app": { | ||
| "bundleName": "com.cpp.app", | ||
| "vendor": "example", | ||
| "versionCode": 1000000, | ||
| "versionName": "1.0.0", | ||
| "icon": "$media:layered_image", | ||
| "label": "$string:app_name" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "string": [ | ||
| { | ||
| "name": "app_name", | ||
| "value": "MyApplication" | ||
| }, | ||
| { | ||
| "name": "perm_reason", | ||
| "value": "Subsystem for SDL / SDL 子系统" | ||
| } | ||
| ] | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions
7
ohos-project/AppScope/resources/base/media/layered_image.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "layered-image": | ||
| { | ||
| "background" : "$media:background", | ||
| "foreground" : "$media:foreground" | ||
| } | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| { | ||
| "app": { | ||
| "signingConfigs": [], | ||
| "products": [ | ||
| { | ||
| "name": "default", | ||
| "signingConfig": "default", | ||
| "targetSdkVersion": "6.0.0(20)", | ||
| "compatibleSdkVersion": "5.0.2(14)", | ||
| "runtimeOS": "HarmonyOS", | ||
| "buildOption": { | ||
| "strictMode": { | ||
| "caseSensitiveCheck": true, | ||
| "useNormalizedOHMUrl": true | ||
| } | ||
| } | ||
| } | ||
| ], | ||
| "buildModeSet": [ | ||
| { | ||
| "name": "debug", | ||
| }, | ||
| { | ||
| "name": "release" | ||
| } | ||
| ] | ||
| }, | ||
| "modules": [ | ||
| { | ||
| "name": "entry", | ||
| "srcPath": "./entry", | ||
| "targets": [ | ||
| { | ||
| "name": "default", | ||
| "applyToProducts": [ | ||
| "default" | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| { | ||
| "files": [ | ||
| "**/*.ets" | ||
| ], | ||
| "ignore": [ | ||
| "**/src/ohosTest/**/*", | ||
| "**/src/test/**/*", | ||
| "**/src/mock/**/*", | ||
| "**/node_modules/**/*", | ||
| "**/oh_modules/**/*", | ||
| "**/build/**/*", | ||
| "**/.preview/**/*" | ||
| ], | ||
| "ruleSet": [ | ||
| "plugin:@performance/recommended", | ||
| "plugin:@typescript-eslint/recommended" | ||
| ], | ||
| "rules": { | ||
| "@security/no-unsafe-aes": "error", | ||
| "@security/no-unsafe-hash": "error", | ||
| "@security/no-unsafe-mac": "warn", | ||
| "@security/no-unsafe-dh": "error", | ||
| "@security/no-unsafe-dsa": "error", | ||
| "@security/no-unsafe-ecdsa": "error", | ||
| "@security/no-unsafe-rsa-encrypt": "error", | ||
| "@security/no-unsafe-rsa-sign": "error", | ||
| "@security/no-unsafe-rsa-key": "error", | ||
| "@security/no-unsafe-dsa-key": "error", | ||
| "@security/no-unsafe-dh-key": "error", | ||
| "@security/no-unsafe-3des": "error" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| /node_modules | ||
| /oh_modules | ||
| /.preview | ||
| /build | ||
| /.cxx | ||
| /.test |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.