浏览代码

update revert patch and bitcode setting

/zgh-build_scripts
guanghuispark 3 年前
当前提交
4a7de290
共有 7 个文件被更改,包括 57 次插入11 次删除
  1. 29
      engine/Build.bee.cs
  2. 2
      engine/Scripts/full_build.sh
  3. 13
      engine/Scripts/lib_build_ios.sh
  4. 2
      engine/Scripts/lib_build_win.py
  5. 22
      engine/Scripts/prelink.py

29
engine/Build.bee.cs


using Bee.Toolchain.GNU;
using Bee.Toolchain.IOS;
using System.Diagnostics;
using System.IO;
enum UIWidgetsBuildTargetPlatform
{

static void Main()
{
flutterRoot = Environment.GetEnvironmentVariable("FLUTTER_ROOT_PATH");
try
{
using (StreamReader sr = new StreamReader("Scripts/bitcode.conf"))
{
string line;
if ((line = sr.ReadLine()) != null)
{
if(line.Trim() == "true")
{
ios_bitcode_enabled = true;
}
else
{
ios_bitcode_enabled = false;
}
}
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
if (string.IsNullOrEmpty(flutterRoot))
{
flutterRoot = Environment.GetEnvironmentVariable("USERPROFILE") + "/engine/src";

//this setting is disabled by default, don't change it unless you know what you are doing
//it must be set the same as the settings we choose to build the flutter txt library
//refer to the readme file for the details
private static bool ios_bitcode_enabled = false;
private static bool ios_bitcode_enabled = true;
static NativeProgram SetupLibUIWidgets(UIWidgetsBuildTargetPlatform platform, out List<NPath> dependencies_d, out List<NPath> dependencies_r)
{

2
engine/Scripts/full_build.sh


;;
"mac") ./lib_build_mac.sh -m $runtime_mode -r $engine_path
;;
"windows") echo 'You select windows'
"windows") python3 lib_build_win.py -m $runtime_mode -r $engine_path
;;
*) echo "unknown platform, only support \"android\",\"ios\",\"mac\",\"windows\""
;;

13
engine/Scripts/lib_build_ios.sh


mkdir $engine_path
fi
if [ "$bitcode" == "-bitcode_bundle -bitcode_verify" ];
then
echo "true" > bitcode.conf
else
echo "false" > bitcode.conf
fi
if [ "$runtime_mode" == "release" ];
then
optimize=""

tundra_file="$work_path/../artifacts/tundra.dag.json"
python3 Scripts/prelink.py $tundra_file $runtime_mode $output_path $work_path $bitcode
echo "\nRevert patches..."
cd $FLUTTER_ROOT_PATH/flutter/third_party/txt
patch -R < BUILD.gn.patch
cd $FLUTTER_ROOT_PATH/build/mac
patch -R < find_sdk.patch

2
engine/Scripts/lib_build_win.py


os.system("patch -R < BUILD.gn.patch")
os.chdir(flutter_root_path + "/third_party/angle")
os.system("patch -R < BUILD.gn.patch -N")
os.system("patch -R < BUILD.gn.patch")
os.chdir(flutter_root_path + "/third_party/angle/src/libANGLE/renderer/d3d/d3d11/")
os.system("patch -R < cpp.patch")

22
engine/Scripts/prelink.py


os.system('\"' + xcode_path + '/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip" -x "libUIWidgets.a"')
os.system('cp -r libUIWidgets.a ' + '../com.unity.uiwidgets/Runtime/Plugins/ios/libUIWidgets.a')
def revert_patches(work_path):
print("\nRevert patches...")
flutter_root_path = os.environ['FLUTTER_ROOT_PATH']
os.chdir(flutter_root_path + "/flutter/third_party/txt")
os.system("patch -R < BUILD.gn.patch")
os.chdir(flutter_root_path + "/build/mac")
os.system("patch -R < find_sdk.patch")
os.chdir(work_path)
if os.path.exists(work_path + "/bitcode.conf"):
os.remove("bitcode.conf")
work_path = sys.argv[4]
prelinkfiles(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5])
prelinkfiles(sys.argv[1], sys.argv[2], sys.argv[3], work_path, sys.argv[5])
prelinkfiles(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], "")
prelinkfiles(sys.argv[1], sys.argv[2], sys.argv[3], work_path, "")
revert_patches(work_path)

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存