-
Notifications
You must be signed in to change notification settings - Fork 275
Expand file tree
/
Copy pathbuild-engine
More file actions
executable file
·71 lines (57 loc) · 2.75 KB
/
build-engine
File metadata and controls
executable file
·71 lines (57 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
SNAPSHOT_HASH=$(cat ../SNAPSHOT_HASH)
ROOT_DIR=$(pwd)
# Required packages for macOS
brew update
brew install libzip openssl libplist autoconf automake libtool autoconf-archive pkg-config ninja python@3.13
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/opt/openssl@1.1/lib/pkgconfig
brew install libplist libusbmuxd
cd "$ROOT_DIR"
xcrun --sdk macosx --show-sdk-path
brew install ideviceinstaller
brew install ios-deploy
# Install reflutter
cd ..
pip3 install wheel
pip3 install .
cd "$ROOT_DIR"
if [ -d "depot_tools" ]; then
rm -rf depot_tools
fi
if [ -d "engine" ]; then
rm -rf engine
fi
if [ -d "customEngine" ]; then
rm -rf customEngine
fi
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
# Deprecated repo: https://github.com/flutter/engine
git clone https://github.com/flutter/flutter.git engine
export PATH=$PATH:$ROOT_DIR/depot_tools
cd engine
git fetch origin $(reflutter -b "$SNAPSHOT_HASH")
git reset --hard FETCH_HEAD
reflutter -b "$SNAPSHOT_HASH" -p
echo 'reflutter' >REFLUTTER
git add . && git commit -am "reflutter"
cd "$ROOT_DIR"
mkdir customEngine
cd customEngine
# Deprecated engine path
# echo 'solutions = [{"managed": False,"name": "src/flutter","url": "'"$ROOT_DIR"/engine'","custom_deps": {},"deps_file": "DEPS","safesync_url": "",},]' >.gclient
echo 'solutions = [{"managed": False,"name": ".","url": "'"$ROOT_DIR"/engine'","custom_deps": {},"deps_file": "DEPS","safesync_url": "",},]' >.gclient
gclient sync
reflutter -b "$SNAPSHOT_HASH" -p
cd "$ROOT_DIR"
export PATH=$PATH:$(pwd)/depot_tools && sudo xcode-select -s /Applications/Xcode.app && customEngine/engine/src/flutter/tools/gn --ios --runtime-mode=release && ninja -C customEngine/engine/src/out/ios_release
cp customEngine/engine/src/out/ios_release/Flutter.framework/Flutter Flutter
cd "$ROOT_DIR"
export PATH=$PATH:$(pwd)/depot_tools && customEngine/engine/src/flutter/tools/gn --no-goma --android --android-cpu=arm64 --runtime-mode=release && ninja -C customEngine/engine/src/out/android_release_arm64
cd "$ROOT_DIR"
export PATH=$PATH:$(pwd)/depot_tools && customEngine/engine/src/flutter/tools/gn --no-goma --android --android-cpu=arm --runtime-mode=release && ninja -C customEngine/engine/src/out/android_release
cd "$ROOT_DIR"
export PATH=$PATH:$(pwd)/depot_tools && customEngine/engine/src/flutter/tools/gn --no-goma --android --android-cpu=x64 --runtime-mode=release && ninja -C customEngine/engine/src/out/android_release_x64
cd "$ROOT_DIR"
cp customEngine/engine/src/out/android_release_arm64/lib.stripped/libflutter.so libflutter_arm64.so 2>/dev/null
cp customEngine/engine/src/out/android_release/lib.stripped/libflutter.so libflutter_arm.so 2>/dev/null
cp customEngine/engine/src/out/android_release_x64/lib.stripped/libflutter.so libflutter_x64.so 2>/dev/null