Skip to content

Commit

Permalink
OpenHarmony: Update SDK version and clarify Java as a build dependenc…
Browse files Browse the repository at this point in the history
…y. (#34)

* ohos: update the supported SDK version to v5.0

* ohos: add Java as a prerequisite for hvigor
  • Loading branch information
mukilan authored Nov 18, 2024
1 parent b7304c9 commit 9466540
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/hacking/building-for-openharmony.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Building for OpenHarmony requires the following:
### Setting up the OpenHarmony SDK

The OpenHarmony SDK is required to compile applications for OpenHarmony.
The minimum version of SDK that Servo currently supports is v5.0 (API-12).

#### Downloading via DevEco Studio

Expand All @@ -35,7 +36,7 @@ DevEco Studio will automatically download and install the components for you.
2. Scroll down to the section "Acquiring Source Code from Mirrors" and click the download link for the version of "Public SDK package for the standard system" matching your host system.
3. Extract the archive to a suitable location.
4. Switch into the SDK folder with `cd <sdk_folder>/<your_operating_system>`.
5. Create a sub-folder with the same name as the API version (e.g 11 for SDK v4.1) and switch into it.
5. Create a sub-folder with the same name as the API version (e.g 12 for SDK v5.0) and switch into it.
6. Unzip the zip files of the individual components into the folder created in the previous step. Preferably use the `unzip` command on the command-line, or manually ensure that the unzipped bundles are called e.g. `native` and not `native-linux-x64-5.x.y.z`.

The following snippet can be used as a reference for steps 4-6:
Expand Down Expand Up @@ -77,6 +78,13 @@ care to install the hvigor version matching the requirements of your project.
`hvigor` (not the wrapper `hvigorw`) is also available via `npm`.
1. Install the same nodejs version as the commandline-tools ship.
For HarmonyOS NEXT Node 18 is shipped. Ensure that the `node` binary is in PATH.
2. Install Java using the recommended installation method for your OS.
The build steps are known to work with OpenJDK v17, v21 and v23.
On MacOS, if you install Homebrew's [OpenJDK formula], the following additional command may need to be run after the installation:
```
# For the system Java wrappers to find this JDK, symlink it with
sudo ln -sfn $HOMEBREW_PREFIX/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
```
2. Edit your `.npmrc` to contain the following line:

```
Expand All @@ -92,6 +100,7 @@ care to install the hvigor version matching the requirements of your project.
```
/path/to/node_modules/@ohos/hvigor/bin/hvigor.js assembleHap
```
[OpenJDK formula]: https://formulae.brew.sh/formula/openjdk#default

### Configuring hdc on Linux

Expand Down

0 comments on commit 9466540

Please sign in to comment.