Fluent — Engine compilation

Time:2021-8-26

Wall climbing

  1. Ensure terminal agent traffic
  2. Use git config — global http.proxy “localhost: Port” to set the proxy.

Port is the port number, which is different according to different VPN. I use LARTERN here, and the port is 50321.

  1. Execute git config — global http.proxy “localhost: 50321”

    The specific port number is determined according to the relevant configuration of the wall climbing software

    git config --global https.proxy http://127.0.0.1:1080
    git config --global https.proxy https://127.0.0.1:1080
    git config --global http.proxy 'socks5://127.0.0.1:1080' 
    git config --global https.proxy 'socks5://127.0.0.1:1080'
    //Cancel
    git config --global --unset http.proxy
    git config --global --unset https.proxy

Configure Depot_ Tools tools

depot_ Tools is a toolkit containing gclient, GN, ninja and other tools. It is a source code management tool provided by Google for chromium to solve the problem of chromium source code management. Fluent source code synchronization also depends on depot_ Tools tool.

//clone depot_ Tools source code
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

//Depot_ Adding environment variables to tools
export PATH="$PATH:/path/to/depot_tools"

//Use can refer to
https://dev.chromium.org/developers/how-tos/depottools
https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.htm

Download source code

  1. From the official website fork project to your own project,https://github.com/flutter/engine
  2. Configure SSH keyhttps://help.github.com/artic…
  3. Create a. Gclient file in the engine directory to synchronize the source code

    solutions = [
      {
        "managed": False,
        "name": "src/flutter",
        "url": "[email protected]:chiqtv/engine.git",
        "custom_deps": {},
        "deps_file": "DEPS",
        "safesync_url": "",
      },
    ]
  4. Synchronization code

    cd /path/to/engine
    Gclient sync // get the source code that flutter depends on. It will automatically run git clone and other commands

compile

  1. The compilation options can be viewed through the. / fluent / tools / GN — help command

    usage: gn [-h] [--unoptimized]
              [--runtime-mode {debug,profile,release,jit_release}] [--interpreter]
              [--dart-debug] [--full-dart-debug]
              [--target-os {android,ios,linux,fuchsia}] [--android]
              [--android-cpu {arm,x64,x86,arm64}] [--ios] [--ios-cpu {arm,arm64}]
              [--simulator] [--fuchsia] [--linux-cpu {x64,x86,arm64,arm}]
              [--fuchsia-cpu {x64,arm64}] [--arm-float-abi {hard,soft,softfp}]
              [--goma] [--no-goma] [--lto] [--no-lto] [--clang] [--no-clang]
              [--clang-static-analyzer] [--no-clang-static-analyzer]
              [--target-sysroot TARGET_SYSROOT]
              [--target-toolchain TARGET_TOOLCHAIN]
              [--target-triple TARGET_TRIPLE]
              [--operator-new-alignment OPERATOR_NEW_ALIGNMENT] [--enable-vulkan]
              [--enable-fontconfig] [--enable-skshaper]
              [--enable-vulkan-validation-layers] [--embedder-for-target]
              [--coverage] [--out-dir OUT_DIR] [--full-dart-sdk]
              [--no-full-dart-sdk] [--ide IDE] [--disable-desktop-embeddings]
              [--build-glfw-shell] [--no-build-glfw-shell] [--bitcode]
              [--stripped] [--no-stripped] [--asan] [--lsan] [--msan] [--tsan]
  2. Release optimized version of Android arm64

    cd /path/to/engine/src/
      ./flutter/tools/gn --android-cpu arm64 --no-lto --runtime-mode=release
    ninja -C out/host_ release_ Arm64 -j 8 // generate the host compilation product and save the file
      
    ./flutter/tools/gn --android --android-cpu arm64 --no-lto --runtime-mode=release 
    ninja -C out/android_ release_ Arm64 -j 8 // generate the Android compiled product storage file
      
      
     //There is an error during compilation. You need to turn off the LTO optimization
      https://github.com/flutter/flutter/issues/57207
  3. Android armeabi support

    Android armeabi is not supported, and armeabi-v7a is supported at least. In my personal opinion, the application development of small factories should pass quickly, and can transition to arm64. The mainstream flagship machines that do not support arm64 are mainly Hisilicon 935, Qualcomm 801, Hisilicon 950 and Qualcomm 808.

  4. Use the compiled fluent

    //Local engine SRC path: Specifies the path to the fluent engine repository, that is, the absolute path to the SRC root directory
    //Local engine: specifies which engine version to use

flutter build apk –target-platform android-arm64 –local- engine=android_release_arm64 –local-engine-src- path=/Users/xiaoyao/Documents/code/flutter/engine/src

Recommended Today

A detailed explanation of the differences between Perl and strawberry Perl and ActivePerl

Perl is the abbreviation of practical extraction and report language “practical report extraction language”. Application of activestateperl and strawberry PERL on Windows platformcompiler。 Perl   The relationship between the latter two is that C language and Linux system have their own GCC. The biggest difference between activestate Perl and strawberry Perl is that strawberry Perl […]