From 8a30ed52e32e9f2d76240f61b37aab32eee4ab98 Mon Sep 17 00:00:00 2001 From: Nick Rudzicz Date: Wed, 3 Aug 2022 13:19:58 -0400 Subject: [PATCH 1/2] Fix: AppleCoreBuildStep disabling bitcode on tvOS Bitcode is required on tvOS; building without bitcode causes an error on upload to ASC --- .../Apple.Core/Editor/AppleCoreBuildStep.cs | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Editor/AppleCoreBuildStep.cs b/plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Editor/AppleCoreBuildStep.cs index 45d488a9..61952e70 100644 --- a/plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Editor/AppleCoreBuildStep.cs +++ b/plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Editor/AppleCoreBuildStep.cs @@ -23,20 +23,23 @@ public class AppleCoreBuildStep : AppleBuildStep #if UNITY_EDITOR_OSX public override void OnFinalizePostProcess(AppleBuildProfile appleBuildProfile, BuildTarget buildTarget, string pathToBuiltProject) { - Debug.Log($"AppleBuild: disabling Bitcode for framework and app targets."); - var pbxProject = AppleBuild.GetPbxProject(buildTarget, pathToBuiltProject); - var pbxProjectPath = AppleBuild.GetPbxProjectPath(buildTarget, pathToBuiltProject); - - if (pbxProject != null) + if (buildTarget != BuildTarget.tvOS) { - var targetGuid = (buildTarget == BuildTarget.StandaloneOSX) ? pbxProject.TargetGuidByName(Application.productName) : pbxProject.GetUnityMainTargetGuid(); - var frameworkGuid = pbxProject.GetUnityFrameworkTargetGuid(); + Debug.Log($"AppleBuild: disabling Bitcode for framework and app targets."); + var pbxProject = AppleBuild.GetPbxProject(buildTarget, pathToBuiltProject); + var pbxProjectPath = AppleBuild.GetPbxProjectPath(buildTarget, pathToBuiltProject); + + if (pbxProject != null) + { + var targetGuid = (buildTarget == BuildTarget.StandaloneOSX) ? pbxProject.TargetGuidByName(Application.productName) : pbxProject.GetUnityMainTargetGuid(); + var frameworkGuid = pbxProject.GetUnityFrameworkTargetGuid(); - pbxProject.AddBuildProperty(frameworkGuid, "ENABLE_BITCODE", "false"); - pbxProject.AddBuildProperty(targetGuid, "ENABLE_BITCODE", "false"); + pbxProject.AddBuildProperty(frameworkGuid, "ENABLE_BITCODE", "false"); + pbxProject.AddBuildProperty(targetGuid, "ENABLE_BITCODE", "false"); - Debug.Log($"AppleBuild: Writing bitcode changes to PBXProject {pbxProjectPath}..."); - pbxProject.WriteToFile(pbxProjectPath); + Debug.Log($"AppleBuild: Writing bitcode changes to PBXProject {pbxProjectPath}..."); + pbxProject.WriteToFile(pbxProjectPath); + } } } From 4b49c71f5cb553c9e53e5427be53bdc61fc47251 Mon Sep 17 00:00:00 2001 From: Nick Rudzicz Date: Thu, 22 Jun 2023 11:44:33 -0400 Subject: [PATCH 2/2] GameController: delete unwanted gamepads In the Apple GameController Build Step, while processing info.plist, it's possible that the user has un-selected certain gamepads. If these have been unselected, they should be removed from the resulting info.plist file. --- .../Editor/AppleGameControllerBuildStep.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plug-ins/Apple.GameController/Apple.GameController_Unity/Assets/Apple.GameController/Editor/AppleGameControllerBuildStep.cs b/plug-ins/Apple.GameController/Apple.GameController_Unity/Assets/Apple.GameController/Editor/AppleGameControllerBuildStep.cs index 6fb77d12..0d043ff8 100644 --- a/plug-ins/Apple.GameController/Apple.GameController_Unity/Assets/Apple.GameController/Editor/AppleGameControllerBuildStep.cs +++ b/plug-ins/Apple.GameController/Apple.GameController_Unity/Assets/Apple.GameController/Editor/AppleGameControllerBuildStep.cs @@ -1,6 +1,7 @@ using Apple.Core; using System; using System.Collections.Generic; +using System.Linq; using UnityEditor; using UnityEngine; @@ -53,6 +54,10 @@ public override void OnProcessInfoPlist(AppleBuildProfile _, BuildTarget buildTa newController.SetString("ProfileName", "MicroGamepad"); supportedControllers.values.Add(newController); } + else + { + supportedControllers.values.Remove(supportedControllers.values.First(pi => pi["ProfileName"].AsString() == "MicroGamepad")); + } // ExtendedGamepad... if (SupportsExtendedGamePad) @@ -61,6 +66,10 @@ public override void OnProcessInfoPlist(AppleBuildProfile _, BuildTarget buildTa newController.SetString("ProfileName", "ExtendedGamepad"); supportedControllers.values.Add(newController); } + else + { + supportedControllers.values.Remove(supportedControllers.values.First(pi => pi["ProfileName"].AsString() == "ExtendedGamepad")); + } } public override void OnProcessFrameworks(AppleBuildProfile _, BuildTarget buildTarget, string pathToBuiltTarget, PBXProject pbxProject)