From 8bf5f12904c9876be944180032026bd4ab699fa4 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 9 May 2018 15:53:47 -0700 Subject: [PATCH] Use iOS .entitlements file instead of .plist for declaring app entitlements. Required by XCode 8 and newer. --- lime/tools/helpers/IOSHelper.hx | 9 +-------- lime/tools/helpers/TVOSHelper.hx | 9 +-------- lime/tools/platforms/IOSPlatform.hx | 4 +--- lime/tools/platforms/TVOSPlatform.hx | 4 +--- .../ios/template/{{app.file}}.xcodeproj/project.pbxproj | 5 ++++- ...le}}-Entitlements.plist => {{app.file}}.entitlements} | 0 6 files changed, 8 insertions(+), 23 deletions(-) rename templates/ios/template/{{app.file}}/{{{app.file}}-Entitlements.plist => {{app.file}}.entitlements} (100%) diff --git a/lime/tools/helpers/IOSHelper.hx b/lime/tools/helpers/IOSHelper.hx index 7b0cc1610..a8b0929be 100644 --- a/lime/tools/helpers/IOSHelper.hx +++ b/lime/tools/helpers/IOSHelper.hx @@ -457,7 +457,7 @@ class IOSHelper { } - public static function sign (project:HXProject, workingDirectory:String, entitlementsPath:String):Void { + public static function sign (project:HXProject, workingDirectory:String):Void { initialize (project); @@ -473,13 +473,6 @@ class IOSHelper { var commands = [ "-s", identity, "CODE_SIGN_IDENTITY=" + identity ]; - if (entitlementsPath != null) { - - commands.push ("--entitlements"); - commands.push (entitlementsPath); - - } - if (project.config.exists ("ios.provisioning-profile")) { commands.push ("PROVISIONING_PROFILE=" + project.config.getString ("ios.provisioning-profile")); diff --git a/lime/tools/helpers/TVOSHelper.hx b/lime/tools/helpers/TVOSHelper.hx index 27177d978..c78e8c08f 100644 --- a/lime/tools/helpers/TVOSHelper.hx +++ b/lime/tools/helpers/TVOSHelper.hx @@ -420,7 +420,7 @@ class TVOSHelper { } - public static function sign (project:HXProject, workingDirectory:String, entitlementsPath:String):Void { + public static function sign (project:HXProject, workingDirectory:String):Void { initialize (project); @@ -436,13 +436,6 @@ class TVOSHelper { var commands = [ "-s", identity, "CODE_SIGN_IDENTITY=" + identity ]; - if (entitlementsPath != null) { - - commands.push ("--entitlements"); - commands.push (entitlementsPath); - - } - if (project.config.exists ("tvos.provisioning-profile")) { commands.push ("PROVISIONING_PROFILE=" + project.config.getString ("tvos.provisioning-profile")); diff --git a/lime/tools/platforms/IOSPlatform.hx b/lime/tools/platforms/IOSPlatform.hx index 74ca83457..cdc62a914 100644 --- a/lime/tools/platforms/IOSPlatform.hx +++ b/lime/tools/platforms/IOSPlatform.hx @@ -58,8 +58,7 @@ class IOSPlatform extends PlatformTarget { if (!project.targetFlags.exists ("simulator")) { - var entitlements = targetDirectory + "/" + project.app.file + "/" + project.app.file + "-Entitlements.plist"; - IOSHelper.sign (project, targetDirectory + "/bin", entitlements); + IOSHelper.sign (project, targetDirectory + "/bin"); } @@ -606,7 +605,6 @@ class IOSPlatform extends PlatformTarget { FileHelper.recursiveSmartCopyTemplate (project, "haxe", projectDirectory + "/haxe", context, true, false); FileHelper.recursiveSmartCopyTemplate (project, "iphone/PROJ/Classes", projectDirectory + "/Classes", context, true, false); FileHelper.recursiveSmartCopyTemplate (project, "iphone/PROJ/Images.xcassets", projectDirectory + "/Images.xcassets", context, true, false); - FileHelper.copyFileTemplate (project.templatePaths, "iphone/PROJ/PROJ-Entitlements.plist", projectDirectory + "/" + project.app.file + "-Entitlements.plist", context, true, false); FileHelper.copyFileTemplate (project.templatePaths, "iphone/PROJ/PROJ-Info.plist", projectDirectory + "/" + project.app.file + "-Info.plist", context, true, false); FileHelper.copyFileTemplate (project.templatePaths, "iphone/PROJ/PROJ-Prefix.pch", projectDirectory + "/" + project.app.file + "-Prefix.pch", context, true, false); FileHelper.recursiveSmartCopyTemplate (project, "iphone/PROJ.xcodeproj", targetDirectory + "/" + project.app.file + ".xcodeproj", context, true, false); diff --git a/lime/tools/platforms/TVOSPlatform.hx b/lime/tools/platforms/TVOSPlatform.hx index 57be3ec1b..5f381f215 100644 --- a/lime/tools/platforms/TVOSPlatform.hx +++ b/lime/tools/platforms/TVOSPlatform.hx @@ -58,8 +58,7 @@ class TVOSPlatform extends PlatformTarget { if (!project.targetFlags.exists ("simulator")) { - var entitlements = targetDirectory + "/" + project.app.file + "/" + project.app.file + "-Entitlements.plist"; - TVOSHelper.sign (project, targetDirectory + "/bin", entitlements); + TVOSHelper.sign (project, targetDirectory + "/bin"); } @@ -484,7 +483,6 @@ class TVOSPlatform extends PlatformTarget { FileHelper.recursiveSmartCopyTemplate (project, "haxe", projectDirectory + "/haxe", context); FileHelper.recursiveSmartCopyTemplate (project, "tvos/PROJ/Classes", projectDirectory + "/Classes", context); FileHelper.recursiveSmartCopyTemplate (project, "tvos/PROJ/Images.xcassets", projectDirectory + "/Images.xcassets", context); - FileHelper.copyFileTemplate (project.templatePaths, "tvos/PROJ/PROJ-Entitlements.plist", projectDirectory + "/" + project.app.file + "-Entitlements.plist", context); FileHelper.copyFileTemplate (project.templatePaths, "tvos/PROJ/PROJ-Info.plist", projectDirectory + "/" + project.app.file + "-Info.plist", context); FileHelper.copyFileTemplate (project.templatePaths, "tvos/PROJ/PROJ-Prefix.pch", projectDirectory + "/" + project.app.file + "-Prefix.pch", context); FileHelper.recursiveSmartCopyTemplate (project, "tvos/PROJ.xcodeproj", targetDirectory + "/" + project.app.file + ".xcodeproj", context); diff --git a/templates/ios/template/{{app.file}}.xcodeproj/project.pbxproj b/templates/ios/template/{{app.file}}.xcodeproj/project.pbxproj index 7a6dcd0a2..8c54cc19f 100644 --- a/templates/ios/template/{{app.file}}.xcodeproj/project.pbxproj +++ b/templates/ios/template/{{app.file}}.xcodeproj/project.pbxproj @@ -55,7 +55,7 @@ 1EEEBAFF121BE2B30048A9DF /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 1EF0A839121ADB8E003F2F59 /* Main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Main.mm; path = "::APP_FILE::/Classes/Main.mm"; sourceTree = SOURCE_ROOT; }; 4257533E1A5EFD8C004AA45B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = "::APP_FILE::/Images.xcassets"; sourceTree = ""; }; - + 6662F3920A0E282007F4E3E /* ::APP_FILE::.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = ::APP_FILE::.entitlements; path = ::APP_FILE::/::APP_FILE::.entitlements; sourceTree = ""; }; 792E75C81C6C876900D01DE0 /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = System/Library/Frameworks/GameController.framework; sourceTree = SDKROOT; }; 792E75C81C6C876900D01DE1 /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; }; ::ADDL_PBX_FILE_REFERENCE:: @@ -131,6 +131,7 @@ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { isa = PBXGroup; children = ( + 6662F3920A0E282007F4E3E /* ::APP_FILE::.entitlements */, 1EEEBA99121AF18B0048A9DF /* Frameworks */, 080E96DDFE201D6D7F000001 /* Classes */, 29B97315FDCFA39411CA2CEA /* Other Sources */, @@ -345,6 +346,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_ENTITLEMENTS = ::APP_FILE::/::APP_FILE::.entitlements; ::if DEVELOPMENT_TEAM_ID::DEVELOPMENT_TEAM = ::DEVELOPMENT_TEAM_ID::;::end:: ENABLE_BITCODE = ::if (ENABLE_BITCODE)::YES::else::NO::end::; FRAMEWORK_SEARCH_PATHS = ( @@ -400,6 +402,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_ENTITLEMENTS = ::APP_FILE::/::APP_FILE::.entitlements; ::if DEVELOPMENT_TEAM_ID::DEVELOPMENT_TEAM = ::DEVELOPMENT_TEAM_ID::;::end:: ENABLE_BITCODE = ::if (ENABLE_BITCODE)::YES::else::NO::end::; FRAMEWORK_SEARCH_PATHS = ( diff --git a/templates/ios/template/{{app.file}}/{{app.file}}-Entitlements.plist b/templates/ios/template/{{app.file}}/{{app.file}}.entitlements similarity index 100% rename from templates/ios/template/{{app.file}}/{{app.file}}-Entitlements.plist rename to templates/ios/template/{{app.file}}/{{app.file}}.entitlements