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.mzph.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…