浏览代码

update mac build

/zgh-build_scripts
guanghuispark 4 年前
当前提交
79821917
共有 4 个文件被更改,包括 98 次插入65 次删除
  1. 133
      engine/Build.bee.cs
  2. 8
      engine/Scripts/lib_build_mac.sh
  3. 11
      engine/Scripts/patches/bee_debug.patch
  4. 11
      engine/Scripts/patches/bee_release.patch

133
engine/Build.bee.cs


//bee.exe win
static void DeployWindows()
{
var libUIWidgets = SetupLibUIWidgets(UIWidgetsBuildTargetPlatform.windows, out var dependencies);
var libUIWidgets = SetupLibUIWidgets(UIWidgetsBuildTargetPlatform.windows, out var dependencies_d, out var dependencies_r);
var builder = new VisualStudioNativeProjectFileBuilder(libUIWidgets);
builder = libUIWidgets.SetupConfigurations.Aggregate(

sln.Projects.Add(deployed);
Backend.Current.AddAliasDependency("ProjectFiles", sln.Setup());
Backend.Current.AddAliasDependency("win", deployed.Path);
foreach (var dep in dependencies)
Backend.Current.AddAliasDependency("win_debug", deployed.Path);
foreach (var dep in dependencies_d)
Backend.Current.AddAliasDependency("win", dep);
Backend.Current.AddAliasDependency("win_debug", dep);
}
foreach (var dep in dependencies_r)
{
Backend.Current.AddAliasDependency("win_release", dep);
}
}

var libUIWidgets = SetupLibUIWidgets(UIWidgetsBuildTargetPlatform.android, out var dependencies);
var libUIWidgets = SetupLibUIWidgets(UIWidgetsBuildTargetPlatform.android, out var dependencies_d, out var dependencies_r);
foreach (var dep in dependencies)
foreach (var dep in dependencies_d)
Backend.Current.AddAliasDependency("android", dep);
Backend.Current.AddAliasDependency("android_debug", dep);
}
foreach (var dep in dependencies_r)
{
Backend.Current.AddAliasDependency("android_release", dep);
var libUIWidgets = SetupLibUIWidgets(UIWidgetsBuildTargetPlatform.mac, out var dependencies);
var libUIWidgets = SetupLibUIWidgets(UIWidgetsBuildTargetPlatform.mac, out var dependencies_d, out var dependencies_r);
Backend.Current.AddAliasDependency("mac", new NPath("libUIWidgetsMac.xcodeproj/project.pbxproj"));
foreach (var dep in dependencies)
Backend.Current.AddAliasDependency("mac_debug", new NPath("libUIWidgetsMac.xcodeproj/project.pbxproj"));
foreach (var dep in dependencies_d)
{
Backend.Current.AddAliasDependency("mac_debug", dep);
}
foreach (var dep in dependencies_r)
Backend.Current.AddAliasDependency("mac", dep);
Backend.Current.AddAliasDependency("mac_release", dep);
}
}

var libUIWidgets = SetupLibUIWidgets(UIWidgetsBuildTargetPlatform.ios, out var dependencies);
var libUIWidgets = SetupLibUIWidgets(UIWidgetsBuildTargetPlatform.ios, out var dependencies_d, out var dependencies_r);
Backend.Current.AddAliasDependency("ios", new NPath("libUIWidgetsIOS.xcodeproj/project.pbxproj"));
foreach(var dep in dependencies) {
Backend.Current.AddAliasDependency("ios", dep);
Backend.Current.AddAliasDependency("ios_debug", new NPath("libUIWidgetsIOS.xcodeproj/project.pbxproj"));
foreach(var dep in dependencies_d) {
Backend.Current.AddAliasDependency("ios_debug", dep);
}
foreach(var dep in dependencies_r) {
Backend.Current.AddAliasDependency("ios_release", dep);
}
}

//refer to the readme file for the details
private static bool ios_bitcode_enabled = false;
static NativeProgram SetupLibUIWidgets(UIWidgetsBuildTargetPlatform platform, out List<NPath> dependencies)
static NativeProgram SetupLibUIWidgets(UIWidgetsBuildTargetPlatform platform, out List<NPath> dependencies_d, out List<NPath> dependencies_r)
{
var np = new NativeProgram("libUIWidgets")
{

//SetupFml(np);
//SetupSkia(np);
//SetupTxt(np);
var codegens = new[] { CodeGen.Debug };
dependencies = new List<NPath>();
var codegens = new[] { CodeGen.Debug, CodeGen.Release };
dependencies_d = new List<NPath>();
dependencies_r = new List<NPath>();
if (platform == UIWidgetsBuildTargetPlatform.windows)
{
var toolchain = ToolChain.Store.Windows().VS2019().Sdk_17134().x64();

var config = new NativeProgramConfiguration(codegen, toolchain, lump: true);
var builtNP = np.SetupSpecificConfiguration(config, toolchain.DynamicLibraryFormat)
.DeployTo("build");
dependencies.Add(builtNP.Path);
builtNP.DeployTo("../com.unity.uiwidgets/Runtime/Plugins/x86_64");
if(codegen == CodeGen.Debug)
{
var builtNP = np.SetupSpecificConfiguration(config, toolchain.DynamicLibraryFormat)
.DeployTo("build_debug");
dependencies_d.Add(builtNP.Path);
builtNP.DeployTo("../com.unity.uiwidgets/Runtime/Plugins/x86_64_debug");
}
else if(codegen == CodeGen.Release)
{
var builtNP = np.SetupSpecificConfiguration(config, toolchain.DynamicLibraryFormat)
.DeployTo("build_release");
dependencies_r.Add(builtNP.Path);
builtNP.DeployTo("../com.unity.uiwidgets/Runtime/Plugins/x86_64_release");
}
}
}
else if (platform == UIWidgetsBuildTargetPlatform.android)

var config = new NativeProgramConfiguration(codegen, androidToolchain, lump: true);
validConfigurations.Add(config);
var buildNP = np.SetupSpecificConfiguration(config, androidToolchain.DynamicLibraryFormat).DeployTo("build");
var deoployNp = buildNP.DeployTo("../com.unity.uiwidgets/Runtime/Plugins/Android");
dependencies.Add(buildNP.Path);
dependencies.Add(deoployNp.Path);
if(codegen == CodeGen.Debug)
{
var buildNP = np.SetupSpecificConfiguration(config, androidToolchain.DynamicLibraryFormat).DeployTo("build_debug");
var deoployNp = buildNP.DeployTo("../com.unity.uiwidgets/Runtime/Plugins/Android_debug");
dependencies_d.Add(buildNP.Path);
dependencies_d.Add(deoployNp.Path);
}
else if(codegen == CodeGen.Release)
{
var buildNP = np.SetupSpecificConfiguration(config, androidToolchain.DynamicLibraryFormat).DeployTo("build_release");
var deoployNp = buildNP.DeployTo("../com.unity.uiwidgets/Runtime/Plugins/Android_release");
dependencies_r.Add(buildNP.Path);
dependencies_r.Add(deoployNp.Path);
}
}
np.ValidConfigurations = validConfigurations;
}

validConfigurations.Add(config);
var buildProgram = np.SetupSpecificConfiguration(config, toolchain.DynamicLibraryFormat);
var buildNp = buildProgram.DeployTo("build");
var deployNp = buildProgram.DeployTo("../com.unity.uiwidgets/Runtime/Plugins/osx");
dependencies.Add(buildNp.Path);
dependencies.Add(deployNp.Path);
if(codegen == CodeGen.Debug)
{
var buildNp = buildProgram.DeployTo("build_debug");
var deployNp = buildProgram.DeployTo("../com.unity.uiwidgets/Runtime/Plugins/osx_debug");
dependencies_d.Add(buildNp.Path);
dependencies_d.Add(deployNp.Path);
}
else if(codegen == CodeGen.Release)
{
var buildNp = buildProgram.DeployTo("build_release");
var deployNp = buildProgram.DeployTo("../com.unity.uiwidgets/Runtime/Plugins/osx_release");
dependencies_r.Add(buildNp.Path);
dependencies_r.Add(deployNp.Path);
}
}
np.ValidConfigurations = validConfigurations;

var config = new NativeProgramConfiguration(codegen, toolchain, lump: true);
validConfigurations.Add(config);
var buildProgram = np.SetupSpecificConfiguration(config, toolchain.StaticLibraryFormat);
var builtNP = buildProgram.DeployTo("build");
var deployNP = buildProgram.DeployTo("../com.unity.uiwidgets/Runtime/Plugins/iOS/");
dependencies.Add(builtNP.Path);
dependencies.Add(deployNP.Path);
if(codegen == CodeGen.Debug)
{
var builtNP = buildProgram.DeployTo("build_debug");
var deployNP = buildProgram.DeployTo("../com.unity.uiwidgets/Runtime/Plugins/iOS_debug/");
dependencies_d.Add(builtNP.Path);
dependencies_d.Add(deployNP.Path);
}
else if(codegen == CodeGen.Release)
{
var builtNP = buildProgram.DeployTo("build_release");
var deployNP = buildProgram.DeployTo("../com.unity.uiwidgets/Runtime/Plugins/iOS_release/");
dependencies_r.Add(builtNP.Path);
dependencies_r.Add(deployNP.Path);
}
}
np.ValidConfigurations = validConfigurations;

8
engine/Scripts/lib_build_mac.sh


ninja $ninja_params
echo "\nStarting build engine..."
#run mono
cp -f $work_path/patches/bee_release.patch bee_release.patch
patch < bee_release.patch -N
mono bee.exe mac_release
cp -f $work_path/patches/bee_debug.patch bee_debug.patch
patch < bee_debug.patch -N
mono bee.exe mac_debug
mono bee.exe mac

11
engine/Scripts/patches/bee_debug.patch


--- /Users/unity/Documents/GitHub/com.unity.uiwidgets/engine/Build.bee.cs 2021-05-17 10:44:45.000000000 +0800
+++ /Users/unity/Documents/GitHub/com.unity.uiwidgets/engine/Scripts/Build.bee.cs 2021-05-17 10:44:20.000000000 +0800
@@ -751,7 +751,7 @@
//SetupFml(np);
//SetupSkia(np);
//SetupTxt(np);
- var codegens = new[] { CodeGen.Release };
+ var codegens = new[] { CodeGen.Debug };
dependencies = new List<NPath>();
if (platform == UIWidgetsBuildTargetPlatform.windows)

11
engine/Scripts/patches/bee_release.patch


--- /Users/unity/Documents/GitHub/com.unity.uiwidgets/engine/Scripts/Build.bee.cs 2021-05-17 10:44:20.000000000 +0800
+++ /Users/unity/Documents/GitHub/com.unity.uiwidgets/engine/Build.bee.cs 2021-05-17 10:44:45.000000000 +0800
@@ -751,7 +751,7 @@
//SetupFml(np);
//SetupSkia(np);
//SetupTxt(np);
- var codegens = new[] { CodeGen.Debug };
+ var codegens = new[] { CodeGen.Release };
dependencies = new List<NPath>();
if (platform == UIWidgetsBuildTargetPlatform.windows)
正在加载...
取消
保存