Flutter Engine編譯環境安裝

前言

根據設置引擎開發環境的描述,確保有以下可用依賴項:

  • Linux、macOS 或 Windows。
    • Linux 支持 Android 和 Fuchsia 的交叉編譯工件,但不支持 iOS。
    • macOS 支持 Android 和 iOS 的交叉編譯工件。
    • Windows 不支持任何 Android、Fuchsia 或 iOS 的交叉編譯工件。
  • git(用于源代碼版本控制)。
  • 一個IDE。另請參閱本頁底部的部分,了解有關在編輯引擎時設置語法突出顯示的建議。
  • 一個 ssh 客戶端(用于通過 GitHub 進行身份驗證)。
  • Chromium 的 depot_tools (確保它在你的路徑中)。我們使用gclien tdepot_tools 中的工具。
  • Python(被我們許多工具使用,包括gclient)。
  • 在 macOS 和 Linux 上:curl 和 unzip(被gclient sync使用)。
  • 在 Windows 上:
    • Visual Studio 2017 或更高版本(僅非 Google 員工需要)。
    • Windows 10 SDK(僅非 Google 員工需要)。
      • 請務必安裝“Windows 調試工具”功能。
  • 在 macOS 上:最新的 Xcode。
  • 推薦給 Google 員工:用于分布式構建的 Goma。該編譯頁有關于如何設置此詳細信息。

不需要安裝Dart,因為 Dart 工具鏈會作為“獲取代碼”步驟的一部分自動下載。類似的對于 Android SDK,它是通過以下gclient sync步驟下載的。

1 flutter engine

1.1 win10

根據flutter官方的wiki設置引擎開發環境,做好前置工作,主要是depot_tools的安裝

depot_tools是Google專門為開發大項目開發的.git代碼倉庫管理的python腳本,統一管理整個源碼倉庫的所有依賴,depot_tools使用說明

但是給的鏈接不能訪問,找到以下命令git下載depot_tools,但是這個仍然需要科學上網,這里可以直接看第1.2章

git clone https://chromium.googlesource.com/chromium/tools/depot_tools

用git下載好后,得到depot_tools文件夾,可以將depot_tools路徑加到環境變量PATH

Fork https://github.com/flutter/engine到你自己的GitHub帳戶

然后創建engine文件夾,在engine文件夾內創建.gclient文件,并且替換<your_name_here>為你的GitHub帳戶名

solutions = [{"managed": False,"name": "src/flutter","url": "git@github.com:<your_name_here>/engine.git","custom_deps": {},"deps_file": "DEPS","safesync_url": "","custom_vars" : {"download_android_deps" : False,"download_windows_deps" : False,},},
]

然后在engine目錄執行

../depot_tools/gclient sync

報錯如下,這是在win10系統下,這是不能訪問服務器導致

Downloading CIPD client for windows-amd64 from https://chrome-infra-packages.appspot.com/client?platform=windows-amd64&version=git_revision:9464003f070813371070f9b8f7c350d87619d145...
Failed to download the file, check your network connection, 使用“2”個參數調用“DownloadFile”時發生異常:“無法連接到遠程服務器”
Retrying after a short nap...
Failed to download the file, check your network connection, 使用“2”個參數調用“DownloadFile”時發生異常:“無法連接到遠程服務器”
Retrying after a short nap...
Failed to download the file, check your network connection, 使用“2”個參數調用“DownloadFile”時發生異常:“無法連接到遠程服務器”
所在位置 D:\depot_tools\.cipd_impl.ps1:112 字符: 5
+     throw "Failed to download the file, check your network connection ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo          : OperationStopped: (Failed to downl...異常:“無法連接到遠程服務器”:String) [], RuntimeException+ FullyQualifiedErrorId : Failed to download the file, check your network connection, 使用“2”個參數調用“DownloadFile”時發生異常:“無法連接到遠程服務器”Failed to bootstrap or update CIPD client 

直接從CSDN下載別人整理好的包depot_tools_20210326_updated.7z

修改depot_tools/update_depot_tools.bat這個文件,取消自動更新,添加如下變量

:: MODIFY: Disable automatic update!
set DEPOT_TOOLS_UPDATE=0

注意gclient是用python來運行的,如果是使用csdn上的包,一定要先安裝python,不然會一直卡住

然后再次報錯,這是在win10系統下,這也是不能訪問服務器導致

[E2021-08-13T19:04:59.085262+08:00 22076 0 annotate.go:266]
original error: prpc: when sending request: Post "https://chrome-infra-packages.appspot.com/prpc/cipd.Repository/ResolveVersion": dial tcp 108.160.167.167:443:
connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

這里我放棄了,回家科學上網,直接在ubuntu 20.04.2.0中安裝

1.2 ubuntu

科學上網加ubuntu 20.04.2.0版本,直接執行以下命令下載depot_tools,當然git這些要先配置好

git clone https://chromium.googlesource.com/chromium/tools/depot_tools

下載完成之后,把depot_tools目錄添加到環境變量中,這樣可以隨時使用gclient命令

在depot_tools同級目錄創建engine目錄,在engine文件夾內創建.gclient文件,文件內容如下

solutions = [{"managed": False,"name": "src/flutter","url": "git@github.com:flutter/engine.git","custom_deps": {},"deps_file": "DEPS","safesync_url": "","custom_vars" : {"download_android_deps" : False,"download_windows_deps" : False,},},
]

還可以指定engine的版本,把url換成下面的,FLUTTER_ENGINE也就是commit id

如Flutter Stable 2.5.1 Engine的id就是b3af521a050e6ef076778bcaf16e27b2521df8f8

"url": "https://github.com/flutter/engine.git@FLUTTER_ENGINE",

然后在engine目錄執行

gclient sync

之后是漫長的下載過程,下載完成后,depot_tools和engine壓縮成tar.gz大約是6.9G,下載過程中遇到一些小err,百度一下就能解決

另外,代碼下載完成后需要切換版本,進入engine/src/flutter,然后執行

git reset --hard b3af521a050e6ef076778bcaf16e27b2521df8f8
#或者直接切換分支,例如
git checkout flutter-2.5-candidate.5

然后返回engine目錄執行

gclient sync --with_branch_heads --with_tags

此時目錄結構大約是這樣的

.
├── depot_tools
│   ├── bootstrap
│   ├── bootstrap-2@3.8.10.chromium.20_bin
│   ├── gclient
│   ├── git-cache
│   ├── gn
│   ├── ninja
│   ├── third_party
│   ├── update_depot_tools
│   ├── ...
├── engine├── _bad_scm└── src

下載之后,以后如果沒有網絡,可以設置環境變量DEPOT_TOOLS_UPDATE,取消depot_tools的更新

export DEPOT_TOOLS_UPDATE=0

之后cd engine/src/flutter,設置engine更新源

git remote add upstream git@github.com:flutter/engine.git

需要更新的時候,在engine/src/flutter執行

git pull upstream master
gclient sync

最后編譯下,看看能否正常編譯

xxxx@Exdroid88:~/flutter-workspace/engine/src$ ./flutter/tools/gn --unoptimized
GOMA usage was specified but can't be found, falling back to local builds. Set the GOMA_DIR environment variable to fix GOMA.
Generating GN files in: out/host_debug_unopt
Generating compile_commands took 102ms
Done. Made 870 targets from 253 files in 831msxxxx@Exdroid88:~/flutter-workspace/engine/src$ ../../depot_tools/ninja -C out/host_debug_unopt
ninja: Entering directory `out/host_debug_unopt'
[6026/6026] STAMP obj/default.stampxxxx@Exdroid88:~//flutter-workspace/engine/src/out/host_debug_unopt$ find ./ -name \*.so
./lib.unstripped/libflutter_linux_gtk.so
./lib.unstripped/libGLESv2.so
./lib.unstripped/libflutter_linux_glfw.so
./lib.unstripped/libEGL.so
./lib.unstripped/libflutter_engine.so
./libflutter_linux_gtk.so
./libGLESv2.so
./libflutter_linux_glfw.so
./libEGL.so
./libflutter_engine.so    

2 flutter

根據flutter linux install的描述安裝即可,我是直接下載flutter_linux_2.2.3-stable.tar.xz,解壓后目錄如下,可以把flutter/bin路徑添加到環境變量中

.
├── depot_tools
│   ├── bootstrap
│   ├── bootstrap-2@3.8.10.chromium.20_bin
│   ├── gclient
│   ├── git-cache
│   ├── gn
│   ├── ninja
│   ├── third_party
│   ├── update_depot_tools
│   ├── ...
├── engine├── _bad_scm└── src
├── flutter
│   ├── analysis_options.yaml
│   ├── AUTHORS
│   ├── bin
│   ├── CODE_OF_CONDUCT.md
│   ├── CODEOWNERS
│   ├── CONTRIBUTING.md
│   ├── dartdoc_options.yaml
│   ├── dev
│   ├── examples
│   ├── flutter_console.bat
│   ├── flutter_root.iml
│   ├── LICENSE
│   ├── packages
│   ├── PATENT_GRANT
│   ├── README.md
│   ├── SECURITY.md
│   └── versio

然后執行下面命令,注意flutter doctor執行時也需要訪問github,要注意網絡聯通

xxxx@Exdroid88:~/flutter-workspace/flutter/bin$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[?] Flutter (Channel stable, 2.2.3, on Linux, locale zh_CN.UTF-8)
[?] Android toolchain - develop for Android devices? Unable to locate Android SDK.Install Android Studio from: https://developer.android.com/studio/index.htmlOn first launch it will assist you in installing the Android SDK components.(or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).If the Android SDK has been installed to a custom location, please use`flutter config --android-sdk` to update to that location.[?] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[?] Linux toolchain - develop for Linux desktop (the doctor check crashed)? Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know about this issue at https://github.com/flutter/flutter/issues.? ProcessException: Failed to find "clang++" in the search path.Command: clang++
[!] Android Studio (not installed)
[?] Connected device (1 available)! Doctor found issues in 4 categories.xxxx@Exdroid88:~/flutter-workspace/flutter/bin$ flutter precache
xxxx@Exdroid88:~/flutter-workspace/flutter/bin$ flutter config --enable-linux-desktop
Setting "enable-linux-desktop" value to "true".You may need to restart any open editors for them to read new settings.

3 flutter-embedded-linux

flutter-embedded-linux需要使用Wayland作為顯示后端的時候才需要安裝

git clone git@github.com:sony/flutter-embedded-linux.git

該庫編譯依要求cmake3.10,可以下載安裝cmake最新版
也可以通過該命令安裝好依賴

sudo apt install clang cmake build-essential pkg-config libegl1-mesa-dev libxkbcommon-dev libgles2-mesa-dev
sudo apt install libwayland-dev wayland-protocols
xxxx@Exdroid88:~/flutter-workspace$ cd flutter-embedded-linux/
xxxx@Exdroid88:~/flutter-workspace/flutter-embedded-linux$ mkdir build/
xxxx@Exdroid88:~/flutter-workspace/flutter-embedded-linux/build$ cd build/
xxxx@Exdroid88:~/flutter-workspace/flutter-embedded-linux/build$ cp ../../engine/src/out/host_debug_unopt/libflutter_engine.so ./
xxxx@Exdroid88:~/flutter-workspace/flutter-embedded-linux/build$ cmake -DUSER_PROJECT_PATH=examples/flutter-wayland-client -DCMAKE_BUILD_TYPE=Release ..
-- The CXX compiler identification is Clang 10.0.0
-- The C compiler identification is Clang 10.0.0
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/clang
-- Check for working C compiler: /usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
User project: examples/flutter-wayland-client
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for module 'egl'
--   Found egl, version 1.5
-- Checking for module 'xkbcommon'
--   Found xkbcommon, version 0.10.0
-- Checking for module 'wayland-protocols'
--   Found wayland-protocols, version 1.20
-- Checking for module 'wayland-client>=1.16.0'
--   Found wayland-client, version 1.18.0
-- Checking for module 'wayland-cursor>=1.16.0'
--   Found wayland-cursor, version 1.18.0
-- Checking for module 'wayland-egl>=1.16.0'
--   Found wayland-egl, version 18.1.0
-- Checking for module 'glesv2'
--   Found glesv2, version 3.2
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/d/flutter-workspace/flutter-embedded-linux/buildxxxx@Exdroid88:~/flutter-workspace/flutter-embedded-linux/build$ cmake --build .
[  1%] Generating ../src/third_party/wayland/protocols/presentation-time-protocol.h
[  3%] Generating ../src/third_party/wayland/protocols/xdg-shell-client-protocol.h
[  5%] Generating ../src/third_party/wayland/protocols/xdg-shell-protocol.c
[  6%] Generating ../src/third_party/wayland/protocols/text-input-unstable-v1-client-protocol.h
[  8%] Generating ../src/third_party/wayland/protocols/text-input-unstable-v1-protocol.c
[ 10%] Generating ../src/third_party/wayland/protocols/text-input-unstable-v3-client-protocol.h
[ 11%] Generating ../src/third_party/wayland/protocols/text-input-unstable-v3-protocol.c
[ 13%] Generating ../src/third_party/wayland/protocols/presentation-time-protocol.c
Scanning dependencies of target flutter-client
[ 15%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/flutter_elinux.cc.o
[ 16%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/flutter_elinux_engine.cc.o
[ 18%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/flutter_elinux_view.cc.o
[ 20%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/flutter_project_bundle.cc.o
[ 22%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/task_runner.cc.o
[ 23%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/system_utils.cc.o
[ 25%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/logger.cc.o
[ 27%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/external_texture_gl.cc.o
[ 28%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/vsync_waiter.cc.o
[ 30%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/flutter_elinux_texture_registrar.cc.o
[ 32%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/plugins/keyboard_glfw_util.cc.o
[ 33%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/plugins/key_event_plugin.cc.o
[ 35%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/plugins/lifecycle_plugin.cc.o
[ 37%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/plugins/mouse_cursor_plugin.cc.o
[ 38%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/plugins/navigation_plugin.cc.o
[ 40%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/plugins/platform_plugin.cc.o
[ 42%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/plugins/platform_views_plugin.cc.o
[ 44%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/plugins/text_input_plugin.cc.o
[ 45%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/surface/context_egl.cc.o
[ 47%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/surface/egl_utils.cc.o
[ 49%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/surface/elinux_egl_surface.cc.o
[ 50%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/surface/surface_base.cc.o
[ 52%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/surface/surface_gl.cc.o
[ 54%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/surface/surface_decoration.cc.o
[ 55%] Building C object CMakeFiles/flutter-client.dir/src/third_party/wayland/protocols/xdg-shell-protocol.c.o
[ 57%] Building C object CMakeFiles/flutter-client.dir/src/third_party/wayland/protocols/text-input-unstable-v1-protocol.c.o
[ 59%] Building C object CMakeFiles/flutter-client.dir/src/third_party/wayland/protocols/text-input-unstable-v3-protocol.c.o
[ 61%] Building C object CMakeFiles/flutter-client.dir/src/third_party/wayland/protocols/presentation-time-protocol.c.o
[ 62%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/window/elinux_window_wayland.cc.o
[ 64%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/window/native_window_wayland.cc.o
[ 66%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/window/native_window_wayland_decoration.cc.o
[ 67%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/window/renderer/shader.cc.o
[ 69%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/window/renderer/shader_context.cc.o
[ 71%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/window/renderer/shader_program.cc.o
[ 72%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/window/renderer/window_decoration_button.cc.o
[ 74%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/window/renderer/window_decoration_titlebar.cc.o
[ 76%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/linux_embedded/window/renderer/window_decorations_wayland.cc.o
[ 77%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/common/text_input_model.cc.o
[ 79%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/common/json_message_codec.cc.o
[ 81%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/common/json_method_codec.cc.o
[ 83%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/common/engine_switches.cc.o
[ 84%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/common/incoming_message_dispatcher.cc.o
[ 86%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/common/client_wrapper/engine_method_result.cc.o
[ 88%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/common/client_wrapper/standard_codec.cc.o
[ 89%] Building CXX object CMakeFiles/flutter-client.dir/src/flutter/shell/platform/common/client_wrapper/plugin_registrar.cc.o
[ 91%] Building CXX object CMakeFiles/flutter-client.dir/src/client_wrapper/flutter_engine.cc.o
[ 93%] Building CXX object CMakeFiles/flutter-client.dir/src/client_wrapper/flutter_view_controller.cc.o
[ 94%] Building CXX object CMakeFiles/flutter-client.dir/examples/flutter-wayland-client/flutter/generated_plugin_registrant.cc.o
[ 96%] Building CXX object CMakeFiles/flutter-client.dir/examples/flutter-wayland-client/flutter_window.cc.o
[ 98%] Building CXX object CMakeFiles/flutter-client.dir/examples/flutter-wayland-client/main.cc.o
[ 99%] Linking CXX executable flutter-client
[100%] Built target flutter-client

如果報錯下面的錯,那么就是沒有把上一步編譯生成的libflutter_engine.so拷貝到該編譯目錄下

make[2]: *** No rule to make target 'libflutter_engine.so', needed by 'flutter-client'.  Stop.
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/flutter-client.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

這一步編譯產物有flutter-client

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/38666.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/38666.shtml
英文地址,請注明出處:http://en.pswp.cn/news/38666.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

MySQL存儲結構及索引

文章目錄 MySQL結構1.2存儲引擎介紹1.3存儲引擎特點InnoDB邏輯存儲結構 MyISAMMemory區別及特點存儲引擎選擇 索引索引概述索引結構BTreeHash索引分類聚集索引&二級索引索引語法SQL性能分析索引優化最左前綴法則范圍查詢字符串不加引號模糊查詢or連接條件數據分布影響覆蓋索…

達夢數據庫dbms_stats包的操作實踐記錄

索引的統計信息收集 GATHER_INDEX_STATSindex_stats_show 根據模式名&#xff0c;索引名獲得該索引的統計信息。用于經過 GATHER_TABLE_STATS、GATHER_INDEX_STATS 或 GATHER_SCHEMA_STATS 收集之后展示。返回兩個結果集&#xff1a;一個是索引的統計信息&#xff1b;另一個是…

Kotlin優點及為什么使用Kotlin

文章目錄 一 Hello Kotlin二 Kotlin優點三 團隊為什么采用 Kotlin 一 Hello Kotlin Kotlin和Andriod 二 Kotlin優點 三 團隊為什么采用 Kotlin

如何從PHP 獲取絕對路徑、文檔根目錄、基本 URL

根據您的服務器配置,獲取正確的路徑信息可能具有挑戰性。例如,PHP 并沒有直接提供一個變量來返回站點基本 URL。以下是一些代碼片段,可以幫助您獲取絕對路徑、文檔根目錄和基本 URL。 獲取絕對路徑 如果您的腳本位于 /path/directory/ 目錄中,您可以使用以下代碼片段來獲…

Mendix 基礎審計模塊介紹

一、前言 作為售前顧問&#xff0c;幫助客戶選型低代碼產品是日常工作。考察一家低代碼產品的好壞&#xff0c;其中一個維度就是產品的成熟度。產品成熟度直接影響產品在使用中的穩定性和用戶體驗&#xff0c;對于新工具導入和可持續運用至關重要。 那怎么考察一個產品是否成…

【校招VIP】java語言考點之ConcurrentHashMap1.7和1.8

考點介紹&#xff1a; ConcurrentHashMap是JAVA校招面試的熱門考點&#xff0c;主要集中在1.7和1.8的底層結構和相關的性能提高。 理解這個考點要從map本身的并發問題出發&#xff0c;再到hashTable的低性能并發安全&#xff0c;引申到ConcurrentHashMap的分塊處理。同時要理解…

JAVA工具類Collections

// 【Collections】:集合的工具類 對集合進行排序 主要針對類類型 // 使用sort方法 // 1. 在需要排序的實體類中實現 Comparable接口 重寫compareTo方法 // 1.動態綁定 向下轉型 // 2.基本數據類型 this.id-s1.id 升序 // 3.類類型 this.n…

【C++】做一個飛機空戰小游戲(八)——生成敵方炮彈(rand()和srand()函數應用)

[導讀]本系列博文內容鏈接如下&#xff1a; 【C】做一個飛機空戰小游戲(一)——使用getch()函數獲得鍵盤碼值 【C】做一個飛機空戰小游戲(二)——利用getch()函數實現鍵盤控制單個字符移動【C】做一個飛機空戰小游戲(三)——getch()函數控制任意造型飛機圖標移動 【C】做一個飛…

SpringBoot中的可擴展接口

目錄 # 背景 # 可擴展的接口啟動調用順序圖 # ApplicationContextInitializer # BeanDefinitionRegistryPostProcessor # BeanFactoryPostProcessor # InstantiationAwareBeanPostProcessor # SmartInstantiationAwareBeanPostProcessor # BeanFactoryAware # Applicati…

炬芯科技發布全新第二代智能手表芯片,引領腕上新趨勢!

2023年7月&#xff0c;炬芯科技宣布全新第二代智能手表芯片正式發布。自2021年底炬芯科技推出第一代的智能手表芯片開始便快速獲得了市場廣泛認可和品牌客戶的普遍好評。隨著技術的不斷創新和突破&#xff0c;為了更加精準地滿足市場多元化的變幻和用戶日益增長的體驗需求&…

Jmeter-壓力測試工具

文章目錄 Jmeter快速入門1.1.下載1.2.解壓1.3.運行 2.快速入門2.1.設置中文語言2.2.基本用法 Jmeter快速入門 1s內發送大量請求&#xff0c;模擬高QPS&#xff0c;用以測試網站能承受的壓力有多大 Jmeter依賴于JDK&#xff0c;所以必須確保當前計算機上已經安裝了JDK&#xff0…

Android Shape 的使用

目錄 什么是Shape? shape屬性 子標簽屬性 corners &#xff08;圓角&#xff09; solid &#xff08;填充色&#xff09; gradient &#xff08;漸變&#xff09; stroke &#xff08;描邊&#xff09; padding &#xff08;內邊距&#xff09; size &#xff08;大小…

CentOS系統環境搭建(三)——Centos7安裝DockerDocker Compose

centos系統環境搭建專欄&#x1f517;點擊跳轉 Centos7安裝Docker&Docker Compose 使用 yum 安裝Docker 內核 [rootVM-4-17-centos ~]# uname -r 3.10.0-1160.88.1.el7.x86_64Docker 要求 CentOS 系統的內核版本高于 3.10 更新 yum yum update安裝需要的軟件包&#x…

在Windows Server 2008上啟用自動文件夾備份

要在Windows Server 2008上啟用自動文件夾備份&#xff0c;您可以使用內置的Windows備份功能。下面是如何設置它的方法&#xff1a; 1. 點擊“開始”按鈕并選擇“服務器管理器”&#xff0c;打開“服務器管理器”。 2. 在“服務器管理器”窗口中&#xff0c;單擊左側窗格中的“…

Python學習筆記_基礎篇(六)_Set集合,函數,深入拷貝,淺入拷貝,文件處理

1、Set基本數據類型 a、set集合&#xff0c;是一個無序且不重復的元素集合 class set(object):"""set() -> new empty set objectset(iterable) -> new set objectBuild an unordered collection of unique elements."""def add(self, *a…

redis-數據類型及樣例

一.string 類型數據的基本操作 1.添加/修改數據 set key value2.獲取數據 get key3.刪除數據 del key4.添加/修改多個數據 mset key1 value1 key2 value25.獲取多個數據 mget key1 key2二.list類型的基本操作 數據存儲需求&#xff1a;存儲多個數據&#xff0c;并對數據…

day 0815

計算文件有多少行&#xff1f; 2.文件的拷貝

SpringBoot引入外部jar打包失敗解決,SpringBoot手動引入jar打包war后報錯問題

前言 使用外部手動添加的jar到項目&#xff0c;打包時出現jar找不到問題解決 處理 例如項目結構如下 引入方式換成這種 <!-- 除了一下這兩種引入外部jar&#xff0c;還是可以將外部jar包添加到maven中&#xff08;百度查&#xff09;--><!-- pdf轉word --><…

Installshield軟件項目打包學習

Installshield打包學習記錄 個人工作學習的一點點記錄&#xff0c;可能有不專業的表述&#xff0c;各位可以提出建議&#xff0c;共同學習。 目錄 Installshield打包學習記錄一、Installshield的幾個事件&#xff1a;1. Before Move Data&#xff08;安裝數據前&#xff09;1.…

前端代理配置

dev: {env: require(./dev.env),port: process.env.PORT || 8080,autoOpenBrowser: true,assetsSubDirectory: static,assetsPublicPath: /,proxyTable: {// 以 /party/fundamental/ 開頭的請求&#xff0c;全部轉發到 target 設置的地址/party/fundamental/: {// target: http…