Merging //UE4/Dev-Main to Dev-Anim (//UE4/Dev-Anim) @ CL 5356908

#rb none

[CL 5360337 by Thomas Sarkanen in Dev-Anim branch]
This commit is contained in:
Thomas Sarkanen
2019-03-11 12:18:32 -04:00
parent 7f5c2a223f
commit bb193db1aa
536 changed files with 18114 additions and 9718 deletions

View File

@@ -716,15 +716,64 @@ namespace UnrealBuildTool
Content.Append("/* End PBXNativeTarget section */" + ProjectFileGenerator.NewLine + ProjectFileGenerator.NewLine);
}
private void AppendShellScriptSection(StringBuilder Content, string ShellScriptGuid)
private void AppendShellScriptSection(StringBuilder Content, string ShellScriptGuid, FileReference UProjectPath)
{
StringBuilder FrameworkScript = new StringBuilder();
// nothing to do without a project
if (UProjectPath == null)
{
return;
}
// @todo: look also in Project/Build/Frameworks directory!
ProjectDescriptor Project = ProjectDescriptor.FromFile(UProjectPath);
List<PluginInfo> AvailablePlugins = Plugins.ReadAvailablePlugins(UnrealBuildTool.EngineDirectory, UProjectPath, Project.AdditionalPluginDirectories);
// look in each plugin for frameworks
// @todo: Cache this kind of things since every target will re-do this work!
foreach (PluginInfo PI in AvailablePlugins)
{
if (!Plugins.IsPluginEnabledForProject(PI, Project, UnrealTargetPlatform.IOS, UnrealTargetConfiguration.Development, TargetRules.TargetType.Game))
{
continue;
}
// for now, we copy and code sign all *.framework.zip, even if the have no code (non-code frameworks are assumed to be *.embeddedframework.zip
DirectoryReference FrameworkDir = DirectoryReference.Combine(PI.Directory, "Source/Frameworks");
if (!DirectoryReference.Exists(FrameworkDir))
{
FrameworkDir = DirectoryReference.Combine(PI.Directory, "Frameworks");
}
if (DirectoryReference.Exists(FrameworkDir))
{
// look at each zip
foreach (FileInfo FI in new System.IO.DirectoryInfo(FrameworkDir.FullName).EnumerateFiles("*.framework.zip"))
{
string Guid = XcodeProjectFileGenerator.MakeXcodeGuid();
string RefGuid = XcodeProjectFileGenerator.MakeXcodeGuid();
// for FI of foo.framework.zip, this will give us foo.framework
string Framework = Path.GetFileNameWithoutExtension(FI.FullName);
// unzip the framework right into the .app
FrameworkScript.AppendFormat("\\techo Unzipping {0}...\\n", FI.FullName);
FrameworkScript.AppendFormat("\\tunzip -o -q {0} -d ${{FRAMEWORK_DIR}} -x \\\"__MACOSX/*\\\" \\\"*/.DS_Store\\\"\\n", FI.FullName);
}
}
}
string ShellScript = "set -e\\n\\n" +
"FRAMEWORK_DIR=$TARGET_BUILD_DIR/$EXECUTABLE_FOLDER_PATH/Frameworks\\n" +
"for FRAMEWORK in ${FRAMEWORK_DIR}/*.framework; do\\n" +
"\\t[ -d \\\"${FRAMEWORK}\\\" ] || continue\\n" +
"\\techo Codesigning ${FRAMEWORK}\\n" +
"\\tcodesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --verbose --preserve-metadata=identifier,entitlements,flags --timestamp=none \\\"${FRAMEWORK}\\\"\\n" +
"done";
"if [ $PLATFORM_NAME = iphoneos ] || [ $PLATFORM_NAME = tvos ]; then \\n" +
"\\tFRAMEWORK_DIR=$TARGET_BUILD_DIR/$EXECUTABLE_FOLDER_PATH/Frameworks\\n" +
FrameworkScript.ToString() +
// and now code sign anything that has been unzipped above
"\\tfor FRAMEWORK in ${FRAMEWORK_DIR}/*.framework; do\\n" +
"\\t\\t[ -d \\\"${FRAMEWORK}\\\" ] || continue\\n" +
"\\t\\techo Codesigning ${FRAMEWORK}\\n" +
"\\t\\tcodesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --verbose --preserve-metadata=identifier,entitlements,flags --timestamp=none \\\"${FRAMEWORK}\\\"\\n" +
"\\tdone\\n" +
"fi\\n";
Content.Append("/* Begin PBXShellScriptBuildPhase section */" + ProjectFileGenerator.NewLine);
Content.Append(string.Format("\t\t{0} /* Sign Frameworks */ = {{" + ProjectFileGenerator.NewLine, ShellScriptGuid));
@@ -1756,7 +1805,7 @@ namespace UnrealBuildTool
AppendXCBuildConfigurationSection(ProjectFileContent, ProjectBuildConfigs, TargetBuildConfigs, BuildTargetBuildConfigs, IndexTargetBuildConfigs, GameProjectPath, AllExtensions);
AppendXCConfigurationListSection(ProjectFileContent, TargetName, BuildTargetName, IndexTargetName, ProjectConfigListGuid, ProjectBuildConfigs,
TargetConfigListGuid, TargetBuildConfigs, BuildTargetConfigListGuid, BuildTargetBuildConfigs, IndexTargetConfigListGuid, IndexTargetBuildConfigs, AllExtensions);
AppendShellScriptSection(ProjectFileContent, ShellScriptSectionGuid);
AppendShellScriptSection(ProjectFileContent, ShellScriptSectionGuid, GameProjectPath);
ProjectFileContent.Append("\t};" + ProjectFileGenerator.NewLine);
ProjectFileContent.Append("\trootObject = " + ProjectGuid + " /* Project object */;" + ProjectFileGenerator.NewLine);