From 26bd52f38eddb4fd8396dd7c6ed12393bb3cce6f Mon Sep 17 00:00:00 2001 From: gxzmf <279822581@qq.com> Date: Fri, 20 Sep 2024 19:58:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=8B=B1=E6=96=87=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: gxzmf <279822581@qq.com> --- OAT.xml | 4 +- README.en.md | 139 +++++++++++++++++++++++++-------------------------- 2 files changed, 70 insertions(+), 73 deletions(-) diff --git a/OAT.xml b/OAT.xml index 37b7254e6c..a1e1a7950d 100644 --- a/OAT.xml +++ b/OAT.xml @@ -143,11 +143,11 @@ used to filter file path. - + - + diff --git a/README.en.md b/README.en.md index 05c88e755f..12a823f553 100644 --- a/README.en.md +++ b/README.en.md @@ -1,124 +1,121 @@ Flutter Engine ============== -Original warehouse source: https://github.com/flutter/engine +Source of the original repository: https://github.com/flutter/engine -## Warehouse description: -This warehouse is based on the extension of Flutter's official engine warehouse and can build a Flutter engine program that supports running on OpenHarmony devices. +## Repository Description +This repository is an extension of the Flutter engine repository. It enables Flutter engine to run on OpenHarmony devices. -## Build instructions: +## How to Build * Build environment: -1. Supports building in Linux and Mac, mainly building gen_snapshot for Window environment; +1. Linux or macOS that support Flutter engine; Windows that supports **gen_snapshot**. +2. Access to the **allowed_hosts** field in the DEPS file. -2. Please ensure that the current build environment can access the allowed_hosts field configured in the DEPS file. +* Build steps: +1. Set up a basic environment. For details, see the [official document](https://github.com/flutter/flutter/wiki/Setting-up-the-Engine-development-environment). -* Building steps: -1. Build a basic environment: please refer to the [official](https://github.com/flutter/flutter/wiki/Setting-up-the-Engine-development-environment) website; - - Basic libraries that need to be installed: + The following libraries need to be installed: ``` - sudo apt install python3 - sudo apt install pkg-config - sudo apt install ninja-build + sudo apt install python3 + sudo apt install pkg-config + sudo apt install ninja-build ``` - Configure node: Download `node` and unzip it, and configure it into environment variables: + Configure `node`. Specifically, download `node`, unzip it, and configure it into environment variables. ``` - # nodejs - export NODE_HOME=/home//env/node-v14.19.1-linux-x64 - export PATH=$NODE_HOME/bin:$PATH + # nodejs + export NODE_HOME=/home//env/node-v14.19.1-linux-x64 + export PATH=$NODE_HOME/bin:$PATH ``` - for Window environment: - Refer to [official](https://github.com/flutter/flutter/wiki/Compiling-the-engine#compiling-for-windows) - The "Compiling for Windows" section sets up the Windows build environment + For Windows: + Refer to the section "Compiling for Windows" + in the [official document](https://github.com/flutter/flutter/wiki/Compiling-the-engine#compiling-for-windows). + -2. Configuration file: Create an empty folder engine, create a new `.gclient` file in the engine, and edit the file: +2. Configure the file. Specifically, create an empty folder **engine**, create the **.gclient** file in this folder, and edit the file. ``` - solutions = [ - { - "managed": False, - "name": "src/flutter", - "url": "git@gitee.com:openharmony-sig/flutter_engine.git", - "custom_deps": {}, - "deps_file": "DEPS", - "safesync_url": "", - }, - ] + solutions = [ + { + "managed": False, + "name": "src/flutter", + "url": "git@gitee.com:openharmony-sig/flutter_engine.git", + "custom_deps": {}, + "deps_file": "DEPS", + "safesync_url": "", + }, + ] ``` -3. Synchronize code: In the engine directory, execute `gclient sync`; here the engine source code, official packages repository will be synchronized, and the ohos_setup task will be executed; +3. Synchronize the code. In the **engine** directory, execute `gclient sync`. The engine source code and packages repository will be synchronized, and the **ohos_setup** task will be executed. -4. Download sdk: From [OpenHarmony SDK](https://developer.huawei.com/consumer/cn/develop)Download the matching development tool,Suites that are not downloaded through this channel are not supported +4. Download the SDK. Download the supporting development kits from [HarmonyOS SDK](https://developer.huawei.com/consumer/en/develop). Suites downloaded from other platforms are not supported. ```sh - # Environment variables that need to be set: HarmonyOS SDK, ohpm, hvigor, node - export TOOL_HOME=/Applications/DevEco-Studio.app/Contents # For mac - export DEVECO_SDK_HOME=$TOOL_HOME/sdk # command-line-tools/sdk - export PATH=$TOOL_HOME/tools/ohpm/bin:$PATH # command-line-tools/ohpm/bin - export PATH=$TOOL_HOME/tools/hvigor/bin:$PATH # command-line-tools/hvigor/bin - export PATH=$TOOL_HOME/tools/node/bin:$PATH # command-line-tools/tool/node/bin + # Environment variables to set: HarmonyOS SDK, ohpm, hvigor, and node. + export TOOL_HOME=/Applications/DevEco-Studio.app/Contents # macOS environment + export DEVECO_SDK_HOME=$TOOL_HOME/sdk # command-line-tools/sdk + export PATH=$TOOL_HOME/tools/ohpm/bin:$PATH # command-line-tools/ohpm/bin + export PATH=$TOOL_HOME/tools/hvigor/bin:$PATH # command-line-tools/ hvigor/bin + export PATH=$TOOL_HOME/tools/node/bin:$PATH # command-line-tools/tool/node/bin ``` -5. Start building: In the engine directory, execute `./ohos` to start building the flutter engine that supports ohos devices. +5. Start building. In the **engine** directory, execute `./ohos` to start building the Flutter engine that supports ohos devices. -6. Update code: In the engine directory, execute `./ohos -b master` +6. Update the code. In the **engine** directory, execute `./ohos -b master`. -## Engine Construction product +## Engine Build Products - [Construction product](https://docs.qq.com/sheet/DUnljRVBYUWZKZEtF?tab=BB08J2) + See [Build Products](https://docs.qq.com/sheet/DUnljRVBYUWZKZEtF?tab=BB08J2). -## FAQ: -1. When running the project, an error of Member notfound:'isOhos' is reported: Please ensure that all dart patches are applied in the src/third_party/dart directory (the patches are located in the src/flutter/attachment/repos directory, and you can use git apply to apply the patch). Recompile the engine after patching +## FAQs +1. The message `Member notfound:'isOhos'` is reported during project running.
Install all dart patches in the **src/third_party/dart** directory. (The patches are located in the **src/flutter/attachment/repos** directory, and you can use **git apply** to apply the patches). Recompile the engine after installing the patches. -2. Prompt Permission denied: Execute chmod +x