|
|
|
|
|
|
engine_path=$OPTARG # set engine_path, depot_tools and flutter engine folder will be put into this path |
|
|
|
;; |
|
|
|
p) |
|
|
|
gn_params="$gn_params --$OPTARG" # set the target platform android/ios/linux |
|
|
|
gn_params="$gn_params --$OPTARG" # set the target platform android/ios |
|
|
|
gn_params="$gn_params --runtime-mode=$runtime_mode" # set runtime mode release/debug/profile |
|
|
|
gn_params="$gn_params --runtime-mode=$runtime_mode" # set runtime mode release/debug |
|
|
|
;; |
|
|
|
e) |
|
|
|
gn_params="$gn_params --bitcode" # enable-bitcode switch |
|
|
|
|
|
|
|
|
|
|
if [ "$runtime_mode" == "release" ] && [ "$optimize" == "--unoptimized" ]; |
|
|
|
then |
|
|
|
output_path="host_release_unopt" |
|
|
|
echo $ninja_params |
|
|
|
output_path="host_release" |
|
|
|
echo $ninja_params |
|
|
|
output_path="host_debug_unopt" |
|
|
|
output_path="host_debug" |
|
|
|
ninja_params=" -C out/host_debug flutter/third_party/txt:txt_lib" |
|
|
|
elif [ "$runtime_mode" == "profile" ]; |
|
|
|
then |
|
|
|
|
|
|
|
|
|
|
echo "\nGetting Depot Tools..." |
|
|
|
if [ ! -n "$engine_path" ]; then |
|
|
|
echo "Flutter engine path is not exist, 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 an engine path." |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
cd $engine_path |
|
|
|
|
|
|
cd ../.. |
|
|
|
./flutter/tools/gn $gn_params |
|
|
|
|
|
|
|
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 |
|
|
|
|
|
|
|
echo "icu_use_data_file=false" >> out/$output_path/args.gn |
|
|
|
ninja $ninja_params |
|
|
|
|
|
|
|
echo "\nStarting build engine..." |
|
|
|
|
|
|
then |
|
|
|
mono bee.exe mac_release |
|
|
|
if [ -d '../com.unity.uiwidgets/Runtime/Plugins/osx' ]; |
|
|
|
then |
|
|
|
echo "engine folder already exist, skip" |
|
|
|
else |
|
|
|
mkdir ../com.unity.uiwidgets/Runtime/Plugins/osx |
|
|
|
fi |
|
|
|
rm -rf ../com.unity.uiwidgets/Runtime/Plugins/osx/* |
|
|
|
cp -r build_release/. ../com.unity.uiwidgets/Runtime/Plugins/osx |
|
|
|
if [ -d '../com.unity.uiwidgets/Runtime/Plugins/osx' ]; |
|
|
|
then |
|
|
|
echo "engine folder already exist, skip create folder" |
|
|
|
else |
|
|
|
mkdir ../com.unity.uiwidgets/Runtime/Plugins/osx |
|
|
|
fi |
|
|
|
rm -rf ../com.unity.uiwidgets/Runtime/Plugins/osx/* |
|
|
|
cp -r build_debug/. ../com.unity.uiwidgets/Runtime/Plugins/osx |
|
|
|
|