diff --git a/README.en.md b/README.en.md index e561d5dcc9a40687dd2c9f91a4430330d9fb70a2..672d61668a7988da3434cbf11ca37dcfe7f063c1 100644 --- a/README.en.md +++ b/README.en.md @@ -9,7 +9,7 @@ This warehouse is based on the extension of Flutter's official engine warehouse ## Build instructions: * Build environment: -1. Currently supports building in Linux and Mac; +1. Supports building in Linux and Mac, mainly building gen_snapshot for Window environment; 2. Please ensure that the current build environment can access the allowed_hosts field configured in the DEPS file. @@ -33,6 +33,9 @@ This warehouse is based on the extension of Flutter's official engine warehouse export PATH=$NODE_HOME/bin:$PATH ``` + for Window environment: please refer to the [official](https://github.com/flutter/flutter/wiki/Compiling-the-engine#compiling-for-windows) website; + Chapter "Compiling for Windows" + 2. Configuration file: Create an empty folder engine, create a new `.gclient` file in the engine, and edit the file: ``` @@ -51,7 +54,7 @@ This warehouse is based on the extension of Flutter's official engine warehouse 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; 4. Download sdk: Download ohos-sdk-full in [the daily build](http://ci.openharmony.cn/workbench/cicd/dailybuild/dailylist), create a new folder ndk/linux/4.0 in the engine root directory, unzip the native folder in ohos-sdk-full and place it in ndk/linux/4.0 in folder; -(For mac environment, please download mac-sdk-full or mac-sdk-m1-full, and the placement directory is ndk/mac/4.0) +(For mac environment, please download mac-sdk-full or mac-sdk-m1-full, and the placement directory is ndk/mac/4.0;No need to download OpenHarmony SDK in Windows environment) 5. Start building: engine directory, execute `make` to start building the flutter engine that supports ohos devices. diff --git a/README.md b/README.md index 6bff688919d3443448f07e46cb50660380a1145e..2de040c7c2045979387b906721afff9574ab5de8 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Flutter Engine ## 构建说明: * 构建环境: -1. 目前支持在Linux与Mac中构建; +1. 目前支持在Linux与Mac中构建,Window环境中支持构建gen_snapshot; 2. 请确保当前构建环境可以访问DEPS文件中配置的字段allowed_hosts列表。 * 构建步骤: @@ -32,6 +32,11 @@ Flutter Engine export PATH=$NODE_HOME/bin:$PATH ``` + Windows构建环境: + 可参考[官网](https://github.com/flutter/flutter/wiki/Compiling-the-engine#compiling-for-windows) + "Compiling for Windows" 章节搭建Windows构建环境 + + 2. 配置文件:创建空文件夹engine,engine内新建.gclient文件,编辑文件: ``` @@ -50,7 +55,8 @@ Flutter Engine 3. 同步代码:在engine目录,执行`gclient sync`;这里会同步engine源码、官方packages仓,还有执行ohos_setup任务; 4. 下载sdk: 在[每日构建](http://ci.openharmony.cn/workbench/cicd/dailybuild/dailylist)下载ohos-sdk-full,在engine根目录下,新建文件夹 ndk/linux/4.0,解压ohos-sdk-full中的native文件夹并放置到ndk/linux/4.0文件夹中; -(mac环境,请下载mac-sdk-full或者mac-sdk-m1-full,放置目录为ndk/mac/4.0) +(mac环境,请下载mac-sdk-full或者mac-sdk-m1-full,放置目录为ndk/mac/4.0;Windows环境无需下载鸿蒙sdk,请参考《构建基础环境》配置Windows环境) + 5. 开始构建:engine目录,执行`make`,即可开始构建支持ohos设备的flutter engine。 diff --git a/attachment/repos/angle.patch b/attachment/repos/angle.patch index a849520947fa07b2e573020e09c1289cfc51c72b..ffb0616f06fa0da717bf4de84ffe968156880f8b 100644 Binary files a/attachment/repos/angle.patch and b/attachment/repos/angle.patch differ diff --git a/attachment/repos/bootstrap/Makefile b/attachment/repos/bootstrap/Makefile index 4834809ed9360cc54856f0201c35c9076ec5a182..3d34580ac8f49e397831d549968d0fb6f87c4ef9 100755 --- a/attachment/repos/bootstrap/Makefile +++ b/attachment/repos/bootstrap/Makefile @@ -1,20 +1,30 @@ -# Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -default: ohos -ohos: - ./ohos.sh -clean: - rm -rf src/out -setup: - ./setup.sh +# Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +ifeq ($(OS),Windows_NT) + ohos=".\ohos.bat" + clean=".\clean.bat" +else + ohos="./ohos.sh" + clean="./clean.sh" +endif + +$(info ${clean_command}) +default: ohos +ohos: + ${ohos} +clean: + ${clean} + + diff --git a/attachment/repos/bootstrap/clean.bat b/attachment/repos/bootstrap/clean.bat new file mode 100644 index 0000000000000000000000000000000000000000..9f3374673c5cae3840ed4cd55ca47e03df78ec36 --- /dev/null +++ b/attachment/repos/bootstrap/clean.bat @@ -0,0 +1,16 @@ +@rem Copyright (c) 2021-2023 Huawei Device Co., Ltd. +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. + +@echo off + +rmdir /s/q "src\out\" diff --git a/attachment/repos/bootstrap/clean.sh b/attachment/repos/bootstrap/clean.sh new file mode 100644 index 0000000000000000000000000000000000000000..eb2b84ac81124674e0dc7c76c6264f0e237c0411 --- /dev/null +++ b/attachment/repos/bootstrap/clean.sh @@ -0,0 +1,15 @@ +# Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#! /bin/bash + +rm -rf src/out diff --git a/attachment/repos/bootstrap/ohos.bat b/attachment/repos/bootstrap/ohos.bat new file mode 100644 index 0000000000000000000000000000000000000000..a52ff9e2971001734cf7d148fab694f00e6a3214 --- /dev/null +++ b/attachment/repos/bootstrap/ohos.bat @@ -0,0 +1,38 @@ +@rem Copyright (c) 2021-2023 Huawei Device Co., Ltd. +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. + +@echo off +setlocal EnableDelayedExpansion + +:config_debug_env +call python .\src\flutter\tools\gn --unoptimized --runtime-mode=debug --ohos --ohos-cpu=arm64 +EXIT /B 0 + + + +:config_release_env +call python .\src\flutter\tools\gn --runtime-mode=release --ohos --unoptimized --ohos-cpu=arm64 +EXIT /B 0 + +:config_host_debug_env +src/flutter/tools/gn "!HOST_OPT!" "--runtime-mode" "!RT_MODE!" "--no-dart-version-git-info" "--full-dart-sdk" "--no-build-web-sdk" "--disable-desktop-embeddings" "--no-build-embedder-examples" "--verbose" "--trace-gn" +EXIT /B 0 + +:config +CALL :config_debug_env +@REM CALL :config_release_env +EXIT /B 0 + +:compile +REM UNKNOWN: {"type":"Pipeline","commands":[{"type":"Command","name":{"text":"find","type":"Word"},"suffix":[{"text":"src/out","type":"Word"},{"text":"-mindepth","type":"Word"},{"text":"1","type":"Word"},{"text":"-maxdepth","type":"Word"},{"text":"1","type":"Word"},{"text":"-type","type":"Word"},{"text":"d","type":"Word"}]},{"type":"Command","name":{"text":"xargs","type":"Word"},"suffix":[{"text":"-n","type":"Word"},{"text":"1","type":"Word"},{"text":"sh","type":"Word"},{"text":"-c","type":"Word"},{"text":"ninja -C $0 || exit 255","type":"Word"}]}]} +EXIT /B 0 diff --git a/attachment/repos/dart.patch b/attachment/repos/dart.patch index 7410e5f2562b8e5c6683a17d2ef3416ccd0067e7..68d14e947b8535da0f83a7b294af9af0fc995f03 100644 Binary files a/attachment/repos/dart.patch and b/attachment/repos/dart.patch differ diff --git a/attachment/repos/skia.patch b/attachment/repos/skia.patch index 420a77ce49924aa4f721d9972f170616927d5fed..eaa646af7c781e3bee185b1a40e2270375bc045a 100644 Binary files a/attachment/repos/skia.patch and b/attachment/repos/skia.patch differ