From f47a89662617cf23998fbd0b28379a9696ac58b2 Mon Sep 17 00:00:00 2001 From: lixiang Date: Tue, 15 Aug 2023 22:44:59 +0800 Subject: [PATCH] modify chromium_src for master patch Signed-off-by: lixiang --- .gitignore | 342 ++++++++++++ .gitignore.backup | 1 + cef | 1 - chrome | 1 - .../config/default.json | 8 + ohos_builds/build.sh | 328 ----------- ohos_builds/config_to_gn.py | 217 -------- ohos_sdk/.gitattributes | 5 - ohos_sdk/.gitignore.backup | 8 - ohos_sdk/.install | 38 -- ohos_sdk/README.md | 91 --- ohos_sdk/manifest_tag.xml | 525 ------------------ ohos_sdk/ohos_sdk.gni | 7 - ohos_sdk/update_sdk | 98 ---- third_party | 1 - v8 | 1 - 16 files changed, 351 insertions(+), 1321 deletions(-) create mode 100644 .gitignore delete mode 160000 cef delete mode 160000 chrome rename ohos_builds/config/ohos.json => ohos_build/config/default.json (48%) delete mode 100755 ohos_builds/build.sh delete mode 100755 ohos_builds/config_to_gn.py delete mode 100644 ohos_sdk/.gitattributes delete mode 100644 ohos_sdk/.gitignore.backup delete mode 100755 ohos_sdk/.install delete mode 100644 ohos_sdk/README.md delete mode 100644 ohos_sdk/manifest_tag.xml delete mode 100644 ohos_sdk/ohos_sdk.gni delete mode 100755 ohos_sdk/update_sdk delete mode 160000 third_party delete mode 160000 v8 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..ad7e70f7fe --- /dev/null +++ b/.gitignore @@ -0,0 +1,342 @@ +/client-py/ +*.bak +*.code-workspace +*.mk +*.ncb +*.opensdf +*.orig +*.pdb +*.props +*.pyc +*.pyproj +*.rules +*.sdf +*.sln +*.sublime-project +*.sublime-workspace +*.suo +*.targets +*.user +*.vc.opendb +*.vcproj +*.vcxproj +*.vcxproj.filters +*.vpj +*.vpw +*.vpwhistu +*.vtg +*.xcodeproj +*.xcworkspace +*.VC.db +*_proto.xml +*_proto_cpp.xml +*~ +!Android.mk +.*.sw? +.DS_Store +.android +.ccls-cache +.cipd +.classpath +.code-coverage +.cproject +.emulator_sdk +.gdb_history +.gdbinit +.landmines +.metadata +.project +.pydevproject +.checkstyle +*.class +compile_commands.json +cscope.* +GPATH +GRTAGS +GSYMS +GTAGS +Session.vim +tags +Thumbs.db +rust-project.json +v8.log +vs-chromium-project.txt +/.clangd +/.clangd/ +/.clangd-index/ +# Settings directories for eclipse +/.externalToolBuilders/ +/.settings/ +/.vs/ +# Visual Studio Code +.vscode/ +.vscode-server/ +/_out +#/android_emulator_sdk +#/ash/ash_unittests_run.xml +#/ash/webui/eche_app_ui/resources/app +#/ash/webui/eche_app_ui/resources/prod +#/ash/webui/help_app_ui/resources/prod +#/ash/webui/media_app_ui/resources/prod +#/ash/webui/media_app_ui/resources/app +#/ash/webui/media_app_ui/resources/pkg +#/ash/webui/projector_app/resources/prod +#/base/base_unittests_run.xml +# See build/.gitignore for entries covering src/build. + +# The Chrome OS build creates a /c and /c_icu symlink due to http://crbug.com/54866. +/c +/c_icu +/cdm +/ceee/internal/ +/cef +/chrome +/chrome/android/profiles/afdo.prof +/chrome/android/profiles/local.txt +/chrome/angle_unittests_run.xml +/chrome/app/vector_icons/google_chrome/ +/chrome/build/pgo_profiles/ +/chrome/gl_tests_run.xml +/chrome/gles2_conform_test_run.xml +/chrome/tab_capture_performance_tests_run.xml +/chrome/telemetry_gpu_test_run.xml +/chrome/app/theme/default_100_percent/google_chrome +/chrome/app/theme/default_200_percent/google_chrome +/chrome/app/theme/google_chrome +/chrome/browser/chromeos/arc/voice_interaction/internal +/chrome/browser/chromeos/assistant/internal +/chrome/browser/enterprise/connectors/internal +/chrome/browser/extensions/api/ledger/ +/chrome/browser/extensions/default_extensions/chromeos +/chrome/browser/google/linkdoctor_internal +/chrome/browser/internal +/chrome/browser/media/engagement_internal +/chrome/browser/performance_monitor/performance_monitor.xml +/chrome/browser/protector/internal +/chrome/browser/resources/chromeos/quickoffice +/chrome/browser/resources/pdf/html_office +/chrome/browser/resources/media_router/extension/src/ +/chrome/browser/resources/preinstalled_web_apps/internal/ +/chrome/browser/resources/media_router_internal/ +/chrome/browser/resources/settings_internal/ +/chrome/browser/resources/software_rendering_list +# Asset files downloaded by gclient runhooks. +/chrome/browser/resources/vr/assets/google_chrome/*.png +/chrome/browser/resources/vr/assets/google_chrome/*.wav +/chrome/browser/sharing/internal +/chrome/browser/spellchecker/internal +/chrome/browser/ui/media_router/internal +/chrome/browser_tests_run.xml +/chrome/chrome_cleaner/internal +/chrome/chrome_run.xml +/chrome/chrome_user32_delay_imports.xml +/chrome/chrome_version_resources.xml +/chrome/common/extensions/api/api.xml +/chrome/common/extensions/api/ledger/ +/chrome/installer/linux/internal +/chrome/installer/mac/internal +/chrome/installer/mac/third_party/xz/xz +/chrome/installer/mini_installer.xml +/chrome/installer/mini_installer/mini_installer.aps +/chrome/installer/mini_installer/support +/chrome/installer/mini_installer_tests_run.xml +/chrome/installer_util_strings.xml +/chrome/interactive_ui_tests_run.xml +/chrome/services/soda/internal +/chrome/setup.xml +/chrome/setup_unittests.xml +/chrome/sync_integration_tests_run.xml +/chrome/test/android/telemetry_tests/browser_tests/*.wpr +/chrome/test/chromedriver/third_party/ +/chrome/test/chromeos/autotest/files/client/deps/chrome_test/test_src/ +/chrome/test/chromeos/autotest/files/client/deps/page_cycler_dep/test_src/ +/chrome/test/chromeos/autotest/files/client/deps/perf_data_dep/test_src/ +/chrome/test/chromeos/autotest/files/client/deps/pyauto_dep/test_src/ +/chrome/test/chromeos/autotest/files/client/deps/telemetry_dep/test_src/ +/chrome/test/data/autofill/captured_sites +/chrome/test/data/extensions/api_test/permissions/nacl_enabled/bin +/chrome/test/data/firefox2_profile/searchplugins +/chrome/test/data/firefox2_searchplugins +/chrome/test/data/firefox3_profile/searchplugins +/chrome/test/data/firefox3_searchplugins +/chrome/test/data/gpu/vectortown_endurance/ +/chrome/test/data/gpu/vt/ +/chrome/test/data/layout_tests +/chrome/test/data/password/captured_sites +/chrome/test/data/pdf_private +/chrome/test/data/perf/canvas_bench +/chrome/test/data/perf/frame_rate/content +/chrome/test/data/perf/frame_rate/private +/chrome/test/data/perf/private/ +/chrome/test/data/perf/third_party/ +/chrome/test/data/plugin/ +/chrome/test/data/vr/ +/chrome/test/data/webrtc/resources +/chrome/test/data/xr/ar_playback_datasets/*.mp4 +/chrome/test/data/xr/webvr_info/ +/chrome/test/media_router/internal +/chrome/test/python_tests/ +/chrome/tools/memory +/chrome/tools/test/reference_build +/chrome/unit_tests_run.xml +/chrome/web_ui_mojo_bindings.xml +/chromecast/internal +/chromeos/assistant/internal +/chromeos/components/help_app_ui/resources/app +/chromeos/components/help_app_ui/resources/prod +/chromeos/profiles/chromeos.orderfile.txt +/chromeos/profiles/*.local.txt +/chromeos/profiles/*.afdo.prof +/cipd_cache/ +/clank +#/cloud_print/cloud_print_version_resources.xml +#/components/chrome_settings_proto_generated_compile.xml +#/components/cloud_policy_proto_generated_compile.xml +#/components/gcm_driver.xml +#/components/history_clusters/internal +#/components/leveldb_proto_test_support.xml +#/components/ntp_tiles/resources/internal +#/components/optimization_guide/internal +#/components/resources/default_100_percent/google_chrome +#/components/resources/default_200_percent/google_chrome +#/components/resources/default_300_percent/google_chrome +#/components/search_engines/prepopulated_engines.xml +#/components/site_isolation/internal +#/components/suggestions.xml +#/components/variations.xml +#/components/zucchini/testdata/*.exe +#/content/browser/service_worker/proto.xml +#/content/content_browsertests_run.xml +#/content/content_common_mojo_bindings.xml +#/content/content_unittests_run.xml +#/content/test/data/gpu/generated/ +#/content/test/data/gpu/gpu_reference/ +#/content/test/data/gpu/mediapipe/ +#/content/test/data/gpu/mediapipe_zip/mediapipe_chromium_tests.zip +#/content/test/data/layout_tests/ +#/content/test/data/plugin/ +#/content/web_ui_test_mojo_bindings.xml +#/data +#/delegate_execute +#/device/serial/device_serial_mojo.xml +/docs/website +#/google_apis/gcm/gcm.xml +#/google_apis/internal +#/googleurl +#/gpu/gles2_conform_test +#/infra/.recipe_deps +#/ios/third_party/earl_grey/src +#/ios/third_party/earl_grey2/src +#/ios/third_party/edo/src +#/ios/third_party/gcdwebserver/src +#/ios/third_party/gtx/src +#/ios/third_party/material_components_ios/src +#/ios/third_party/material_font_disk_loader_ios/src +#/ios/third_party/material_internationalization_ios/src +#/ios/third_party/material_roboto_font_loader_ios/src +#/ios/third_party/material_sprited_animation_view_ios/src +#/ios/third_party/material_text_accessibility_ios/src +#/ios/third_party/motion_animator_objc/src +#/ios/third_party/motion_interchange_objc/src +#/ios/third_party/motion_transitioning_objc/src +#/ios/third_party/ochamcrest/src +#/ios/third_party/webkit/src +#/ios_internal +#/libassistant +#/libinteraction +#/llvm +#/media/cast/logging/cast_logging_proto_lib.xml +#/media/cdm/api +#/media/media_mojo_bindings.xml +#/media/test/data/internal +#/metro_driver +#/mojo/internal +/native_client +#/net/Debug +#/net/net_derived_sources.xml +#/net/net_unittests_run.xml +#/net/Release +#/net/testserver.log +#/net/third_party/quiche/src +#/orderfiles +/out*/ +#/ppapi/native_client/nacl_irt.xml +#/ppapi/native_client/ppapi_lib.xml +#/remoting/android/internal/ +#/remoting/appengine/ +#/remoting/host/installer/linux/internal/ +#/remoting/ios/internal/ +#/remoting/internal/ +#/remoting/proto/chromotocol_proto_lib.xml +#/remoting/remoting_core_resources.xml +#/remoting/remoting_elevated_controller.xml +#/remoting/remoting_host.xml +#/remoting/remoting_host_event_logger.xml +#/remoting/remoting_host_installation.xml +#/remoting/remoting_host_messages.xml +#/remoting/remoting_infoplist_strings.xml +#/remoting/remoting_lib_idl.xml +#/remoting/remoting_lib_rc.xml +#/remoting/remoting_me2me_host.xml +#/remoting/remoting_native_messaging_manifests.xml +#/remoting/remoting_version_resources.xml +#/remoting/remoting_windows_resources.xml +#/remoting/test/internal/ +#/remoting/tools/internal/ +#/remoting/webapp/app_remoting/internal/ +#/sandbox/linux/seccomp-legacy/ +#/seccompsandbox +#/signing_keys +#/skia/tools/clusterfuzz-data/ +#/sql/sql_unittests_run.xml +#/sync/sync.xml +#/testing/libfuzzer/fuzzer_corpus_for_bots/ +#/testing/location_tags.json +#/testing/rts/ +#/testserver.log +/third_party +# See third_party/.gitignore for entries covering src/third_party. +#/tools/.bisect-builds-cache.json +#/tools/cygprofile/*.wprgo +#/tools/clang/dsymutil/bin/dsymutil +#/tools/distcc +#/tools/gn/bin/linux +#/tools/gn/bin/mac +#/tools/gn/bin/win +#/tools/histograms +#/tools/json_schema_compiler/test/json_schema_compiler_tests.xml +#/tools/metrics/actions/actions.old.xml +#/tools/metrics/histograms/histograms.before.pretty-print.xml +#/tools/metrics/histograms/metadata/*.before.pretty-print.xml +#/tools/metrics/histograms/metadata/*/*.before.pretty-print.xml +#/tools/metrics/histograms/enums.before.pretty-print.xml +/tools/page_cycler/acid3 +#/tools/reclient +#/tools/skia_goldctl/ +#/tools/tryserver +#/tools/win/link_limiter/build +#/ui/file_manager/internal +#/ui/keyboard/keyboard_mojom_bindings.xml +#/ui/surface/surface.xml +#/ui/surface/surface_gpu_tests.xml +#/ui/webui/internal +#/v8 +#/webkit/data +#/webpagereplay_logs/ +#/x86-generic_out/ +#/xcodebuild + +# Ignore any Android RenderTest goldens +**/render_tests/*.png + +# Ignore any WPR archive files +**/wpr_tests/*.wprgo + +# Ignore IntelliJ files. +.idea/ + +# Ignore cache folder created by clangd +.cache + +# Ignore the default results output directory for tools/run-swarmed.py +/results diff --git a/.gitignore.backup b/.gitignore.backup index 5a473b0515..ed2e1b3d2c 100644 --- a/.gitignore.backup +++ b/.gitignore.backup @@ -337,3 +337,4 @@ vs-chromium-project.txt # Ignore the default results output directory for tools/run-swarmed.py /results + diff --git a/cef b/cef deleted file mode 160000 index f9d89ba721..0000000000 --- a/cef +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f9d89ba7214e1eeedc107249dd26db46decd314d diff --git a/chrome b/chrome deleted file mode 160000 index 2806a19c71..0000000000 --- a/chrome +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2806a19c719add91204aac7a4706745cf2aacb3c diff --git a/ohos_builds/config/ohos.json b/ohos_build/config/default.json similarity index 48% rename from ohos_builds/config/ohos.json rename to ohos_build/config/default.json index 6afe31758b..acbbdb0428 100755 --- a/ohos_builds/config/ohos.json +++ b/ohos_build/config/default.json @@ -5,4 +5,12 @@ "genCommandline": "default", "dependence": "", "default": "true" +}, +{ "name": "OHOS_NWEB_EX", + "owner": "", + "desc": "config isolation for origin code", + "effect":"main gn blink_core other", + "genCommandline": "default", + "dependence": "", + "default": "true" } \ No newline at end of file diff --git a/ohos_builds/build.sh b/ohos_builds/build.sh deleted file mode 100755 index 1f05882aac..0000000000 --- a/ohos_builds/build.sh +++ /dev/null @@ -1,328 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Huawei Device 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. - -# use ./build.sh -nosym to build content_shell without symbol. -set -e -basedir=$(dirname "$0") -CUR_DIR=$PWD -ROOT_DIR="${CUR_DIR%/src*}""/src" -# Global variables. -BUILD_TARGET_WEBVIEW="ohos_nweb_hap" -BUILD_TARGET_BROWSERSHELL="ohos_browser_shell" -BUILD_TARGET_NATIVE="libweb_engine web_render libnweb_render" -BUILD_TARGET_BROWSER_SERVICE="ohos_nweb_ex/browser_service" -BUILD_TARGET_BROWSER_SERVICE_HAR="browser_service_har" -TEXT_BOLD="\033[1m" -TEXT_NORMAL="\033[0m" - -#Add build args begin -buildargs=" - target_os=\"ohos\" - is_debug=false - is_official_build=true - is_component_build=false - is_chrome_branded=false - use_official_google_api_keys=false - use_ozone=true - use_aura=true - ozone_auto_platforms=false - ozone_platform=\"headless\" - ozone_platform_headless=true - enable_extensions=true - ffmpeg_branding=\"Chrome\" - use_kerberos=false - use_bundled_fontconfig=true - enable_resource_allowlist_generation=false - clang_use_chrome_plugins=false - enable_message_center=true - safe_browsing_mode=0 - use_custom_libcxx=false - use_sysroot=false - gpu_switch=\"on\" - proprietary_codecs=true - media_use_ffmpeg=true" -#Add build args end - -buildgn=1 -buildcount=0 -buildccache=0 -buildsymbol=0 -buildproduct="" -buildarg_cpu="target_cpu=\"arm\"" -buildarg_musl="use_musl=true" -build_dir="out/rk3568/" -build_product_name="product_name=\"rk3568\"" -build_target="${BUILD_TARGET_NATIVE}" -build_output="" -artifact_mode=0 -without_nweb_ex=0 -build_sysroot="use_ohos_sdk_sysroot=false" -build_asan=0 - -usage() { - echo -ne "USAGE: $0 [OPTIONS] [PRODUCT] - -${TEXT_BOLD}OPTIONS${TEXT_NORMAL}: - -j N force number of build jobs - -ccache Enable CCache. - -t Build target, supports: - n Build native files. - b Build BrowserShell. - w Build NWeb WebView. - m Build NWebEx napi module. - M Build NWebEx napi npm package. - -o Output directory, for example: Default. - -A, -artifact Artifact mode, using pre-built NDK rather than building - them locally. - -asan Enable AddressSanitizer (ASan). - -${TEXT_BOLD}PRODUCT${TEXT_NORMAL}: - rk3568 rk3568_64 musl_64 x86_64 - Default is: rk3568 -" -} - -while [ "$1" != "" ]; do - case $1 in - "musl_64") - buildarg_cpu="target_cpu=\"arm64\"" - buildarg_musl="use_musl=true" - build_dir="out/musl_64/" - build_product_name="product_name=\"all\"" - ;; - "rk3568") - buildarg_cpu="target_cpu=\"arm\"" - buildarg_musl="use_musl=true" - build_dir="out/rk3568/" - build_product_name="product_name=\"rk3568\"" - ;; - "rk3568_64") - buildarg_cpu="target_cpu=\"arm64\"" - buildarg_musl="use_musl=true" - build_dir="out/rk3568_64/" - build_product_name="product_name=\"rk3568\"" - ;; - "x86_64") - buildarg_cpu="target_cpu=\"x64\"" - buildarg_musl="use_musl=true" - build_dir="out/x86_64/" - build_product_name="product_name=\"all\"" - ;; - "-j") - shift - buildcount=$1 - ;; - "-ccache") - buildccache=1 - ;; - "-sym") - buildsymbol=1 - ;; - "-t") - shift - build_target=$1 - ;; - "-o") - shift - build_output=$1 - ;; - "-artifact"|"-A") - artifact_mode=1 - ;; - "-asan") - build_asan=1 - ;; - "-without-nweb-ex") - without_nweb_ex=1 - ;; - "-h") - usage - exit 0 - ;; - *) - echo " -> $1 <- is not a valid option, please follow the usage below: " - usage - exit 1 - ;; - esac - shift -done - -if [ "-${build_output}" != "-" ]; then - build_dir="out/${build_output}/" -fi - -case "${build_target}" in - "w"|"${BUILD_TARGET_WEBVIEW}") - build_target="${BUILD_TARGET_WEBVIEW}" - ;; - "b"|"${BUILD_TARGET_BROWSERSHELL}") - build_target="${BUILD_TARGET_BROWSERSHELL}" - [[ "-$buildarg_musl" == "-use_musl=true" ]] && build_sysroot="use_ohos_sdk_sysroot=true" - ;; - "n"|"${BUILD_TARGET_NATIVE}") - build_target="${BUILD_TARGET_NATIVE}" - ;; - "m"|"${BUILD_TARGET_BROWSER_SERVICE}") - build_target="${BUILD_TARGET_BROWSER_SERVICE}" - build_sysroot="use_ohos_sdk_sysroot=true" - [[ "-${build_product_name}" != "-product_name=\"rk3568\"" ]] && echo \ - "Use -t M instead of -t m to build ${build_target} for current platform."\ - && exit 1 - ;; - "M"|"${BUILD_TARGET_BROWSER_SERVICE_HAR}") - build_target="${BUILD_TARGET_BROWSER_SERVICE_HAR}" - [[ "-$buildarg_musl" == "-use_musl=true" ]] && build_sysroot="use_ohos_sdk_sysroot=true" - ;; - *) - echo "Invalid build_target: ${build_target}" - exit 2 - ;; -esac - -SYMBOL_LEVEL=1 -if [ $buildsymbol = 1 ]; then - SYMBOL_LEVEL=2 -fi - -if [ $buildcount = 0 ]; then - #buildcount=$(grep processor /proc/cpuinfo | wc -l) - buildcount=40 -fi - -if [ $buildccache = 1 ]; then - if [ $buildcount = 0 ]; then - buildcount=64 - fi - GN_ARGS="cc_wrapper=\"ccache\" clang_use_chrome_plugins=false linux_use_bundled_binutils=false" - export CCACHE_CPP2=yes -fi - -if [ ${artifact_mode} -eq 1 ]; then - GN_ARGS="${GN_ARGS} build_chromium_with_ohos_src=false" -else - GN_ARGS="${GN_ARGS} build_chromium_with_ohos_src=true" -fi - -if [ ${build_asan} -eq 1 ]; then - GN_ARGS="${GN_ARGS} is_asan=true" -else - GN_ARGS="${GN_ARGS} is_asan=false" -fi - -# Extract ohos-sdk. -if [ -f "src/ohos_sdk/.install" ]; then - bash "src/ohos_sdk/.install" - if [ $? -ne 0 ]; then - echo "ERROR: Failed to install ohos-sdk, abort!" - exit 1 - fi -fi - -if [ -f "${ROOT_DIR}/third_party/ohos_nweb_hap/BUILD.gn" ]; then - buildargs="${buildargs} - enable_ohos_nweb_hap=true" -fi - -if [ ${without_nweb_ex} -ne 1 -a ${artifact_mode} -eq 1 ]; then - if ! [ -d "${ROOT_DIR}"/"${build_dir}" ]; then - mkdir -p "${ROOT_DIR}"/"${build_dir}" - fi - - BUILD_CONFIG_NAME="ohos_nweb_ex_config.gn" - CONFIG_AUTO_GEN_DIR="build/config_gn_java" - config_override=build/config/default.json - config_to_gn_args="" - - if [ -f "${ROOT_DIR}"/"${build_dir}""${BUILD_CONFIG_NAME}" ]; then - rm "${ROOT_DIR}"/"${build_dir}""${BUILD_CONFIG_NAME}" - fi - # Generate build_config.gn - if ! [ -d "${CONFIG_AUTO_GEN_DIR}" ];then - mkdir "${CONFIG_AUTO_GEN_DIR}" - fi - - result=python build/config_to_gn.py \ - -o "${ROOT_DIR}"/"${build_dir}""${BUILD_CONFIG_NAME}" \ - -d ${CONFIG_AUTO_GEN_DIR} \ - -i ${config_override} ${config_to_gn_args} - if [ $? -ne 0 ]; then - echo -e "Failed to execute build/config_to_gn.py, see errors above." - exit 1 - fi - buildargs="${buildargs} - ohos_nweb_ex_config_name=\"//${build_dir}${BUILD_CONFIG_NAME}\" - " -else - echo "ROOT_DIR ${ROOT_DIR}" - echo "build_dir ${build_dir}" - if ! [ -d "${ROOT_DIR}"/"${build_dir}" ]; then - mkdir -p "${ROOT_DIR}"/"${build_dir}" - fi - - BUILD_CONFIG_NAME="ohos_nweb_ex_config.gn" - CONFIG_AUTO_GEN_DIR="build/config_gn_java" - # for define macro - config_override=build/config/ohos.json - config_to_gn_args="" - - if [ -f "${ROOT_DIR}"/"${build_dir}""${BUILD_CONFIG_NAME}" ]; then - rm "${ROOT_DIR}"/"${build_dir}""${BUILD_CONFIG_NAME}" - fi - # Generate build_config.gn - if ! [ -d "${CONFIG_AUTO_GEN_DIR}" ];then - mkdir "${CONFIG_AUTO_GEN_DIR}" - fi - - result=python build/config_to_gn.py \ - -o "${ROOT_DIR}"/"${build_dir}""${BUILD_CONFIG_NAME}" \ - -d ${CONFIG_AUTO_GEN_DIR} \ - -i ${config_override} ${config_to_gn_args} - if [ $? -ne 0 ]; then - echo -e "Failed to execute build/config_to_gn.py, see errors above." - exit 1 - fi - buildargs="${buildargs} - ohos_nweb_ex_config_name=\"//${build_dir}${BUILD_CONFIG_NAME}\" - " -fi - -cd src - -time_start_for_build=$(date +%s) -time_start_for_gn=$time_start_for_build - -if [ $buildgn = 1 ]; then - echo "generating args list: $buildargs $GN_ARGS" - third_party/depot_tools/gn gen $build_dir --export-compile-commands --args="$buildargs $buildarg_cpu $buildarg_musl $build_sysroot $build_product_name $GN_ARGS symbol_level=$SYMBOL_LEVEL" -fi -time_end_for_gn=$(date +%s) - -third_party/depot_tools/ninja -C $build_dir -j$buildcount ${build_target} -time_end_for_build=$(date +%s) - -time_format() { - hours=$((($1 - $2) / 3600)) - minutes=$((($1 - $2) % 3600 / 60)) - seconds=$((($1 - $2) % 60)) -} - -time_format $time_end_for_gn $time_start_for_gn -printf "\n\e[32mTime for gn : %dH:%dM:%dS \e[0m\n" $hours $minutes $seconds -time_format $time_end_for_build $time_end_for_gn -printf "\e[32mTime for build : %dH:%dM:%dS \e[0m\n" $hours $minutes $seconds -time_format $time_end_for_build $time_start_for_build -printf "\e[32mTime for Total : %dH:%dM:%dS \e[0m\n\n" $hours $minutes $seconds - -echo "build done" diff --git a/ohos_builds/config_to_gn.py b/ohos_builds/config_to_gn.py deleted file mode 100755 index 114e029b83..0000000000 --- a/ohos_builds/config_to_gn.py +++ /dev/null @@ -1,217 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2014 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""hw build config to gn file -""" - -import fnmatch -import optparse -import os -import sys -import json -import re -import copy -import getopt -import hashlib - -gtemplate = """declare_args() {\n -%s -} -ohos_nweb_ex_defines_main = %s -ohos_nweb_ex_defines_blink_core = %s -ohos_nweb_ex_defines_other = %s -ohos_nweb_ex_build_defines = %s -""" - -glineSep = "\n*******************************************************\n" - -gKeyVariables = 'variables' -class BuildConfigException(Exception): - def __init__(self, msg): - self.msg = msg - def __str__(self): - return self.msg - -def generateGnConfig(itemEnable, itemDisable, gnOutputDest, targetName): - global gtemplate - gnOutputFile = open(gnOutputDest, 'w') - - strItemGn = '' - listItemDefineMain = [] - listItemDefineBlink = [] - listItemDefineOther = [] - listBuildDefines = [] - - for item in itemEnable: - if item.get('effect').find('gn') >= 0: - strItemGn = strItemGn + item.get('name') + '=true\n' - if item.get('effect').find('main') >= 0: - listItemDefineMain.append(item.get('name')) - if item.get('effect').find('blink') >= 0: - listItemDefineBlink.append(item.get('name')) - if item.get('effect').find('other') >= 0: - listItemDefineOther.append(item.get('name')) - listBuildDefines.append(item.get('name').lower()) - - - for item in itemDisable: - if item.get('effect').find('gn') >= 0: - strItemGn = strItemGn + item.get('name') + '=false\n' - strItemGn = strItemGn.lower() - - contentMain = gtemplate%(strItemGn, json.dumps(listItemDefineMain), json.dumps(listItemDefineBlink), json.dumps(listItemDefineOther), json.dumps(listBuildDefines)) - print glineSep + "final build_config:\n" + contentMain + glineSep - - gnOutputFile.write(contentMain) - gnOutputFile.close() - pass - -def hasVariables(item): - return isinstance(item, dict) and item.has_key(gKeyVariables) - -def runWithVariables(baseFuncName, item): - if not hasVariables(item): - return None - - itemExtFuncName = '%s_%s' % (baseFuncName, item.get('name')) - if itemExtFuncName not in globals(): - return None - - return eval(itemExtFuncName)(item.get('name'), item.get(gKeyVariables)) - -def WriteIfChange(outFile, contentMain): - oldContent = "" - if os.path.isfile(outFile): - outputFile = open(outFile, 'r') - oldContent = outputFile.read() - outputFile.close() - - if hashlib.md5(contentMain.strip()).hexdigest() != hashlib.md5(oldContent.strip()).hexdigest(): - print("regenerate " + outFile + "\n") - outputFile = open(outFile, 'w') - outputFile.write(contentMain) - outputFile.close() - pass - -def getItemFromFile(configFile): - content = open(configFile, 'r').read().encode('utf-8') - content = "".join(content).strip() - #splitItem = eval("[" + content + "]") - from collections import OrderedDict - if content.endswith(','): - content = content[:-1] - splitItem = json.loads("[" + content + "]", object_pairs_hook=OrderedDict) - return splitItem - -def isInConfigItems(configItems, newItem): - indice = 0 - for item in configItems: - if cmp(item['name'], newItem['name']) == 0: - return True, indice - indice = indice + 1 - return False, -1 - -def mergeAndSetAllItems(allConfigItems, newConfigItems): - for newItem in newConfigItems: - isExist, indice = isInConfigItems(allConfigItems, newItem) - if isExist == False: - newItem['default'] = "false" - allConfigItems.append(newItem) - return allConfigItems - -def delConfigItems(allConfigItems, delItem): - for item in allConfigItems: - isExist, indice = isInConfigItems(allConfigItems, delItem) - if isExist == True: - del allConfigItems[indice] - return allConfigItems - return allConfigItems - -def doCheck(newConfigItems, file): - itemsCopy=copy.deepcopy(newConfigItems) - itemsCopy.sort(key = lambda x:x["name"]) - for i in range(len(newConfigItems)): - if not newConfigItems[i].has_key("dependence"): - print("\n\033[1;31mError:Plese check config.json!!!!!!!!! key: " + newConfigItems[i].get('name') + " have add {dependence} value [file is] " + file +"\033[0m \n") - return False - if (newConfigItems[i].get('name') != itemsCopy[i].get('name')): - print("\n\033[1;31mError:Plese check config.json is with right Alphabet sort !!!!!!!!! key is: " + newConfigItems[i].get('name') + " [right key is->] " -+ itemsCopy[i].get('name') + " [file is] " + file +"\033[0m \n") - return False - return True - -def getAllConfigItems(configDirectory): - allConfigItems = [] - files= os.listdir(configDirectory) - # do not support recursively - for file in files: - newConfigItems = getItemFromFile(configDirectory + '/' + file) - if not doCheck(newConfigItems, file): - return "error" - allConfigItems = mergeAndSetAllItems(allConfigItems, newConfigItems) - return allConfigItems - -def main(argv): - configFile = '' - gnOutputDest = '' - templateOutputPath = '' - targetName = '' - dynamicConfigs = {} - opts, args = getopt.getopt(argv, "i:o:d:t:D:", ["input=", "output=", "template-dir=", "target_name=", "dynamic-config="]) - for opt, arg in opts: - if opt in ("-i", "--input"): - configFile = arg - elif opt in ("-o", "--output"): - gnOutputDest = arg - elif opt in ("-d", "--template-dir"): - templateOutputPath = arg - # elif opt in ("-t", "--target_name"): - # targetName = arg - elif opt in ("-D", "--dynamic-config"): - kv = arg.split('=') - if len(kv) >= 2: - dynamicConfigs[kv[0]] = kv[1] - - # get directory path from configFile - if (len(configFile) > 0): - configDirectory = os.path.dirname(configFile) - else: - configDirectory = os.path.split(os.path.realpath(__file__))[0] + '/config/' - print "configDirectory:%s" % configDirectory - - # scan and merge all jsons under configDirectory, set all of items' default value to 'false' - allConfigItems = getAllConfigItems(configDirectory) - allConfigDisableItems = copy.deepcopy(allConfigItems) ; - - # override allConfigsItems - overrideItems = [] - if len(configFile) > 0: - overrideItems = getItemFromFile(configFile) - - # construct itemEnable and itemDisable - itemEnable = [] - itemDisable = [] - - for item in overrideItems: - if len(item) < 5: - print "json.config format error" - return 1 - name = item['name'] - if name in dynamicConfigs and dynamicConfigs[name] != item['default']: - item['default'] = dynamicConfigs[name] - - if item.get('default') == 'true': - print item.get('name') + " :" + item.get('effect') + ": [enable]" - itemEnable.append(item) - allConfigDisableItems = delConfigItems(allConfigDisableItems, item) - - itemDisable = allConfigDisableItems - - generateGnConfig(itemEnable, itemDisable, gnOutputDest, targetName) - return 0 - -if __name__ == '__main__': - sys.exit(main(sys.argv[1:])) diff --git a/ohos_sdk/.gitattributes b/ohos_sdk/.gitattributes deleted file mode 100644 index 312efb657e..0000000000 --- a/ohos_sdk/.gitattributes +++ /dev/null @@ -1,5 +0,0 @@ -ohos-sdk-*.tar.gz filter=lfs diff=lfs merge=lfs -text -ohos-sdk-3.2.2.5-Beta1.tar.gz filter=lfs diff=lfs merge=lfs -text -ohos-sdk-3.2.10.6-Beta5.tar.gz filter=lfs diff=lfs merge=lfs -text -ohos-sdk-3.2.10.7-Beta5.tar.gz filter=lfs diff=lfs merge=lfs -text -ohos-sdk-4.0.7.5-Beta1.tar.gz filter=lfs diff=lfs merge=lfs -text diff --git a/ohos_sdk/.gitignore.backup b/ohos_sdk/.gitignore.backup deleted file mode 100644 index f6c2d42465..0000000000 --- a/ohos_sdk/.gitignore.backup +++ /dev/null @@ -1,8 +0,0 @@ -/ets -/js -/native -/toolchains -/.version -/previewer -/licenses -/[0-9]* diff --git a/ohos_sdk/.install b/ohos_sdk/.install deleted file mode 100755 index 65acc41427..0000000000 --- a/ohos_sdk/.install +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -latest_version="ohos-sdk-4.0.7.5-Beta1.tar.gz" - - -base_dir="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" -version_file="${base_dir}/.version" - -sdk_upgrade() { - installed_version="" - if [ -f "${version_file}" ]; then - installed_version=$(head -n 1 "${version_file}") - fi - - if [ "-${latest_version}" == "-${installed_version}" ]; then - return 0 - fi - - cd "${base_dir}" - if [ ! -f "${latest_version}" ]; then - echo "ERROR: Could not find latest SDK tarball: ${base_dir}/${latest_version}" - return 1 - fi - - rm -rf ets js native toolchains licenses previewer [0-9]* - tar zxf "${latest_version}" - rc=$? - - if [ ${rc} -eq 0 ]; then - echo -n "${latest_version}" > "${version_file}" - else - echo "ERROR: Failed to extract SDK tarball: ${base_dir}/${latest_version}, result: ${rc}" - fi - return ${rc} -} - - -sdk_upgrade diff --git a/ohos_sdk/README.md b/ohos_sdk/README.md deleted file mode 100644 index 335fd9680b..0000000000 --- a/ohos_sdk/README.md +++ /dev/null @@ -1,91 +0,0 @@ -# 如何更新 SDK? - -使用 OpenHarmony 提供的 *SDK命令行工具* 管理 SDK。 - -每次更新时,先使用工具将 SDK 下载到本地,然后提交到 git 仓库。 - -## 1. 安装依赖软件 - -- 需要安装 JDK,版本不低于 11。 -- 需要安装 Node.js,版本不低于 14.18.3,建议安装 16.\* 系列版本,可以[从公司内网镜像下载](https://mirrors.tools.huawei.com/nodejs/v16.15.1/),或者到[官网下载](https://nodejs.org/en/)。 -- 将 java 和 node 以及 npm 命令添加到系统 `PATH` 环境变量中。 - -## 2. 环境设置 - -设置 Node.js -``` -npm config set registry https://mirrors.tools.huawei.com/npm/ -npm config set @ohos:registry https://cmc.centralrepo.rnd.huawei.com/artifactory/api/npm/product_npm/ -npm config set strict-ssl false -``` - -## 3. 安装 SDK 命令行工具 - -1. 从此处[下载SDK命令行工具](https://developer.harmonyos.com/cn/develop/deveco-studio#download_cli_openharmony)。 -2. 解压。 -3. 检查解压缩后的文件,`oh-command-line-tools/bin/ohsdkmgr` 即为我们需要的 SDK 命令行工具。 - -## 4. 查看当前 SDK 的版本 - -``` -./ohsdkmgr list --proxy-type=http --proxy=localhost:3128 --no-ssl-verify -``` - -命令输出如下: -> Component | API Version | Version | Stage | Status | Available Update -> ---------- | ----------- | ------- | ------- | ------------- | ---------------- -> ets | 9 | 3.2.2.5 | Beta1 | Not Installed | -> ets | 8 | 3.1.6.5 | Release | Not Installed | -> js | 9 | 3.2.2.5 | Beta1 | Not Installed | -> js | 8 | 3.1.6.5 | Release | Not Installed | -> native | 9 | 3.2.2.5 | Beta1 | Not Installed | -> native | 8 | 3.1.6.5 | Release | Not Installed | -> previewer | 9 | 3.2.2.5 | Beta1 | Not Installed | -> previewer | 8 | 3.1.6.5 | Release | Not Installed | -> toolchains | 9 | 3.2.2.5 | Beta1 | Not Installed | -> toolchains | 8 | 3.1.6.5 | Release | Not Installed | - -## 5. 安装 SDK 到本地 - -``` -mkdir -p ohos_sdk_new -./ohsdkmgr install ets:9 js:9 native:9 previewer:9 toolchains:9 --proxy-type=http --proxy=localhost:3128 --sdk-directory=`pwd`/ohos_sdk_new --no-ssl-verify --accept-license -``` -这个命令中 *ohos_sdk_new* 是用来存放新版本 SDK 文件的目录。 -`ets:9` 表示安装 *ets* 的 API 9 版本,具体版本号见上一步骤工具输出的 `Version` 字段。 - -## 6. 替换旧版本的 SDK - -``` -cd ohos_sdk_new -tar cfz ohos-sdk-3.2.2.5-Beta1.tar.gz * -``` - -最后将上面生成的 *ohos-sdk-3.2.2.5-Beta1.tar.gz* 包放到 `//ohos_sdk/` 目录下,并将老版本的 *.tar.gz* 包删除。 -接下来的操作均在 `//ohos_sdk/` 目录下执行。 - -修改 `//ohos_sdk/.install` 文件中 SDK 文件名: -> latest_version="ohos-sdk-3.2.2.5-Beta1.tar.gz" - -修改 `//ohos_sdk/ohos_sdk.gni` 文件中 SDK 的版本号: -> ohos_sdk_version = "3.2.2.5" - -最后提交 `//ohos_sdk/` 目录下修改过的文件: -``` -git add ohos-sdk-3.2.2.5-Beta1.tar.gz .install ohos_sdk.gni -``` - - -## 7. 使用新的 SDK 进行编译验证 - -编译 NWeb 的 hap 包,编译没问题可以提交上库。 - -有些版本的 SDK 校验规则不一样,可能会出现 hap 工程的配置用新版本的 SDK 校验不通过导致编译失败的情况, -要在这一步发现并修改。 - -## 8. 手动更新 SDK 包 - -如果使用转测试的 OHOS SDK 包,需要在以下两个目录下执行 `npm install`,保证被 SDK 依赖的 NPM 包全部包含在 SDK 中: -> js/build-tools/ace-loader -> ets/build-tools/ets-loader - diff --git a/ohos_sdk/manifest_tag.xml b/ohos_sdk/manifest_tag.xml deleted file mode 100644 index 75e9a9f1ef..0000000000 --- a/ohos_sdk/manifest_tag.xml +++ /dev/null @@ -1,525 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ohos_sdk/ohos_sdk.gni b/ohos_sdk/ohos_sdk.gni deleted file mode 100644 index 132ec35e54..0000000000 --- a/ohos_sdk/ohos_sdk.gni +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright 2022 The Huawei Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -declare_args() { - ohos_sdk_version = "4.0.7.5" -} diff --git a/ohos_sdk/update_sdk b/ohos_sdk/update_sdk deleted file mode 100755 index 3e1de08203..0000000000 --- a/ohos_sdk/update_sdk +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/bash - -set -e -if [ $# -ne 1 ]; then - echo "Usage: $0 /path/to/original/sdk/package" - exit 1 -fi - -original_sdk="$1" -current_dir=`pwd` -npm_bin=$(realpath "../third_party/node/linux/node-linux-x64/bin/npm") -tmp_dir=$(realpath $(mktemp -d -p ./)) -new_sdk_dir=$(realpath $(mktemp -d -p ./)) -linux_sdk_dir="$tmp_dir/ohos-sdk/linux" -sdk_modules="ets js native previewer toolchains" - -# Decompress original SDK package. -tar zxf $original_sdk -C $tmp_dir - -new_sdk_level="" -new_sdk_version_tag="" -new_sdk_version="" -new_sdk_type="" -for module in $sdk_modules; do - unzip -q $linux_sdk_dir/$module*.zip -d $new_sdk_dir - _json=$new_sdk_dir/$module/oh-uni-package.json - new_sdk_level=$(cat $_json | grep '"apiVersion"' | awk -F: '{print $NF}' | sed 's/,//g' | sed 's/ //g' | sed 's/"//g') - new_sdk_version=$(cat $_json | grep '"version"' | awk -F: '{print $NF}' | sed 's/,//g' | sed 's/ //g' | sed 's/"//g') - new_sdk_type=$(cat $_json | grep '"releaseType"' | awk -F: '{print $NF}' | sed 's/,//g' | sed 's/ //g' | sed 's/"//g') - _sdk_tag="$new_sdk_version-$new_sdk_type" - if [ "-$new_sdk_version_tag" == "-" ]; then - new_sdk_version_tag=$_sdk_tag - elif [ "-$new_sdk_version_tag" != "-$_sdk_tag" ]; then - echo "ERROR: Invalid SDK module version: $module $new_sdk_version $new_sdk_type" - exit 3 - fi -done - -# Update npm modules. -cd $new_sdk_dir/js/build-tools/ace-loader -$npm_bin install --quiet - -cd $new_sdk_dir/ets/build-tools/ets-loader -$npm_bin install --quiet - -# Update musl header files. -patch --no-backup-if-mismatch $new_sdk_dir/native/sysroot/usr/include/dlfcn.h <