diff --git a/plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Editor/AppleBuild.cs b/plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Editor/AppleBuild.cs index 09760784..e413bc27 100644 --- a/plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Editor/AppleBuild.cs +++ b/plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Editor/AppleBuild.cs @@ -132,7 +132,7 @@ public static void OnPostProcessBuild(BuildTarget buildTarget, string generatedP { LogDevelopmentMessage("OnPostProcessBuild", "OnProcessEntitlements begin"); - var entitlementsPath = GetEntitlementsPath(buildTarget, generatedProjectPath); + var entitlementsPath = pbxProject.GetEntitlementFilePathForTarget(pbxProject.GetUnityMainTargetGuid()); var entitlements = new PlistDocument(); if (File.Exists(entitlementsPath)) @@ -286,32 +286,6 @@ public static string GetInfoPlistPath(BuildTarget buildTarget, string pathToBuil } } - /// - /// Returns the path to the entitlements for a given build target and project - /// - public static string GetEntitlementsPath(BuildTarget buildTarget, string pathToBuiltProject) - { - if (buildTarget == BuildTarget.StandaloneOSX) - { - if (AppleNativeLibraryUtility.IsXcodeProjectGeneratedForMac) - { -#if UNITY_2020_1_OR_NEWER - return $"{pathToBuiltProject}/{Application.productName}/{Application.productName}.entitlements"; -#else - return $"{Path.GetDirectoryName(pathToBuiltProject)}/{Application.productName}/{Application.productName}.entitlements"; -#endif - } - else - { - return $"{Path.GetDirectoryName(pathToBuiltProject)}/{Application.productName}.entitlements"; - } - } - else - { - return $"{pathToBuiltProject}/{Application.productName}.entitlements"; - } - } - /// /// Utility method for getting the .pbxproj path for a built project ///