|
|
|
|
|
|
gn_params="" |
|
|
|
optimize="--unoptimized" |
|
|
|
ninja_params="" |
|
|
|
runtime_mode= |
|
|
|
|
|
|
|
|
|
|
|
echo "setting environment variable and other params..." |
|
|
|
|
|
|
|
while getopts ":r:p:m:eo" opt |
|
|
|
do |
|
|
|
|
|
|
gn_params="$gn_params --$OPTARG" # set the target platform android/ios/linux |
|
|
|
;; |
|
|
|
m) |
|
|
|
runtime_node=$OPTARG |
|
|
|
gn_params="$gn_params --runtime-mode=$runtime_node" # set runtime mode release/debug/profile |
|
|
|
if [ "$runtime_node" == "release" ];then |
|
|
|
ninja_params=" -C out/host_release flutter/third_party/txt:txt_lib" |
|
|
|
elif [ "$runtime_node" == "debug" ];then |
|
|
|
ninja_params=" -C out/host_debug_unopt/ flutter/third_party/txt:txt_lib" |
|
|
|
elif [ "$runtime_node" == "profile" ];then |
|
|
|
echo "not support profile build yet" |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
runtime_mode=$OPTARG |
|
|
|
gn_params="$gn_params --runtime-mode=$runtime_mode" # set runtime mode release/debug/profile |
|
|
|
;; |
|
|
|
e) |
|
|
|
gn_params="$gn_params --bitcode" # enable-bitcode switch |
|
|
|
|
|
|
esac |
|
|
|
done |
|
|
|
|
|
|
|
if [ "$runtime_mode" == "release" ] && [ "$optimize" == "--unoptimized" ]; |
|
|
|
then |
|
|
|
ninja_params=" -C out/host_release_unopt flutter/third_party/txt:txt_lib" |
|
|
|
elif [ "$runtime_mode" == "release" ] && [ "$optimize" == "" ]; |
|
|
|
then |
|
|
|
echo $ninja_params |
|
|
|
ninja_params="-C out/host_release flutter/third_party/txt:txt_lib" |
|
|
|
echo $ninja_params |
|
|
|
elif [ "$runtime_mode" == "debug" ] && [ "$optimize" == "--unoptimized" ]; |
|
|
|
then |
|
|
|
ninja_params=" -C out/host_debug_unopt flutter/third_party/txt:txt_lib" |
|
|
|
elif [ "$runtime_mode" == "debug" ] && [ "$optimize" == "" ]; |
|
|
|
then |
|
|
|
ninja_params=" -C out/host_debug flutter/third_party/txt:txt_lib" |
|
|
|
elif [ "$runtime_mode" == "profile" ]; |
|
|
|
then |
|
|
|
echo "not support profile build yet" |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
|
|
|
|
gn_params="$gn_params $optimize" |
|
|
|
|
|
|
|
#set environment variable |
|
|
|
|
|
|
if [ ! $FLUTTER_ROOT_PATH ];then |
|
|
|
echo "export FLUTTER_ROOT_PATH=$engine_path/engine/src" >> ~/.bash_profile |
|
|
|
else |
|
|
|
echo "This environment variable has been set, no need to set it again..." |
|
|
|
echo "This environment variable has been set, skip" |
|
|
|
echo "This environment variable has been set, no need to set it again..." |
|
|
|
echo "This environment variable has been set, skip" |
|
|
|
else |
|
|
|
echo "export PATH=$engine_path/depot_tools:\$PATH" >> ~/.bash_profile |
|
|
|
fi |
|
|
|
|
|
|
if [ ! -n "$engine_path" ]; then |
|
|
|
echo "Flutter engine path is null, please set the path by using \"-r\" param to set a engine path." |
|
|
|
echo "Flutter engine path is not exist, please set the path by using \"-r\" param to set a engine path." |
|
|
|
else |
|
|
|
echo "$engine_path" |
|
|
|
fi |
|
|
|
fi |
|
|
|
echo "depot_tools already installed, skip download" |
|
|
|
echo "depot_tools already installed, skip" |
|
|
|
else |
|
|
|
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git |
|
|
|
gclient |
|
|
|
|
|
|
if [ ! -d 'engine' ];then |
|
|
|
|
|
|
|
if [ -d 'engine' ]; |
|
|
|
then |
|
|
|
echo "engine folder already exist, skip" |
|
|
|
else |
|
|
|
else |
|
|
|
echo "engine folder already exist, skip create" |
|
|
|
fi |
|
|
|
cd engine |
|
|
|
#git@github.com:guanghuispark/engine.git is a temp repo, replace it later |
|
|
|
|
|
|
git checkout flutter-1.17-candidate.5 |
|
|
|
gclient sync -D |
|
|
|
|
|
|
|
echo "\nSCompiling engine..." |
|
|
|
echo "\nStarting compile engine..." |
|
|
|
cd $engine_path/engine/src/build/mac |
|
|
|
cp -f $work_path/patches/find_sdk.patch find_sdk.patch |
|
|
|
patch < find_sdk.patch -N |
|
|
|
|
|
|
echo "icu_use_data_file=false" >> out/host_debug_unopt/args.gn |
|
|
|
if [ "$runtime_mode" == "release" ] && [ "$optimize" == "--unoptimized" ]; |
|
|
|
then |
|
|
|
echo "icu_use_data_file=false" >> out/host_release_unopt/args.gn |
|
|
|
elif [ "$runtime_mode" == "release" ] && [ "$optimize" == "" ]; |
|
|
|
then |
|
|
|
echo "icu_use_data_file=false" >> out/host_release/args.gn |
|
|
|
elif [ "$runtime_mode" == "debug" ] && [ "$optimize" == "--unoptimized" ]; |
|
|
|
then |
|
|
|
echo "icu_use_data_file=false" >> out/host_debug_unopt/args.gn |
|
|
|
elif [ "$runtime_mode" == "debug" ] && [ "$optimize" == "" ]; |
|
|
|
then |
|
|
|
echo "icu_use_data_file=false" >> out/host_debug/args.gn |
|
|
|
elif [ "$runtime_mode" == "profile" ]; |
|
|
|
then |
|
|
|
echo "not support profile build yet" |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
|
|
|
|
cd $work_path |
|
|
|
cd $work_path |
|
|
|
echo "flutter root : $FLUTTER_ROOT" |
|
|
|
if [ "$runtime_mode" == "release" ]; |
|
|
|
then |
|
|
|
cp -f $work_path/patches/bee_release.patch bee_release.patch |
|
|
|
patch < bee_release.patch -N |
|
|
|
elif [ "$runtime_mode" == "debug" ]; |
|
|
|
then |
|
|
|
cp -f $work_path/patches/bee_debug.patch bee_debug.patch |
|
|
|
patch < bee_debug.patch -N |
|
|
|
fi |
|
|
|
|
|
|
|
mono bee.exe mac |