Use iOS .entitlements file instead of .plist for declaring app entitlements. Required by XCode 8 and newer.

This commit is contained in:
Adam
2018-05-09 15:53:47 -07:00
committed by Joshua Granick
parent 2a4142dd03
commit 8bf5f12904
6 changed files with 8 additions and 23 deletions

View File

@@ -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); initialize (project);
@@ -473,13 +473,6 @@ class IOSHelper {
var commands = [ "-s", identity, "CODE_SIGN_IDENTITY=" + identity ]; var commands = [ "-s", identity, "CODE_SIGN_IDENTITY=" + identity ];
if (entitlementsPath != null) {
commands.push ("--entitlements");
commands.push (entitlementsPath);
}
if (project.config.exists ("ios.provisioning-profile")) { if (project.config.exists ("ios.provisioning-profile")) {
commands.push ("PROVISIONING_PROFILE=" + project.config.getString ("ios.provisioning-profile")); commands.push ("PROVISIONING_PROFILE=" + project.config.getString ("ios.provisioning-profile"));

View File

@@ -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); initialize (project);
@@ -436,13 +436,6 @@ class TVOSHelper {
var commands = [ "-s", identity, "CODE_SIGN_IDENTITY=" + identity ]; var commands = [ "-s", identity, "CODE_SIGN_IDENTITY=" + identity ];
if (entitlementsPath != null) {
commands.push ("--entitlements");
commands.push (entitlementsPath);
}
if (project.config.exists ("tvos.provisioning-profile")) { if (project.config.exists ("tvos.provisioning-profile")) {
commands.push ("PROVISIONING_PROFILE=" + project.config.getString ("tvos.provisioning-profile")); commands.push ("PROVISIONING_PROFILE=" + project.config.getString ("tvos.provisioning-profile"));

View File

@@ -58,8 +58,7 @@ class IOSPlatform extends PlatformTarget {
if (!project.targetFlags.exists ("simulator")) { if (!project.targetFlags.exists ("simulator")) {
var entitlements = targetDirectory + "/" + project.app.file + "/" + project.app.file + "-Entitlements.plist"; IOSHelper.sign (project, targetDirectory + "/bin");
IOSHelper.sign (project, targetDirectory + "/bin", entitlements);
} }
@@ -606,7 +605,6 @@ class IOSPlatform extends PlatformTarget {
FileHelper.recursiveSmartCopyTemplate (project, "haxe", projectDirectory + "/haxe", context, true, false); 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/Classes", projectDirectory + "/Classes", context, true, false);
FileHelper.recursiveSmartCopyTemplate (project, "iphone/PROJ/Images.xcassets", projectDirectory + "/Images.xcassets", 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-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.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); FileHelper.recursiveSmartCopyTemplate (project, "iphone/PROJ.xcodeproj", targetDirectory + "/" + project.app.file + ".xcodeproj", context, true, false);

View File

@@ -58,8 +58,7 @@ class TVOSPlatform extends PlatformTarget {
if (!project.targetFlags.exists ("simulator")) { if (!project.targetFlags.exists ("simulator")) {
var entitlements = targetDirectory + "/" + project.app.file + "/" + project.app.file + "-Entitlements.plist"; TVOSHelper.sign (project, targetDirectory + "/bin");
TVOSHelper.sign (project, targetDirectory + "/bin", entitlements);
} }
@@ -484,7 +483,6 @@ class TVOSPlatform extends PlatformTarget {
FileHelper.recursiveSmartCopyTemplate (project, "haxe", projectDirectory + "/haxe", context); FileHelper.recursiveSmartCopyTemplate (project, "haxe", projectDirectory + "/haxe", context);
FileHelper.recursiveSmartCopyTemplate (project, "tvos/PROJ/Classes", projectDirectory + "/Classes", context); FileHelper.recursiveSmartCopyTemplate (project, "tvos/PROJ/Classes", projectDirectory + "/Classes", context);
FileHelper.recursiveSmartCopyTemplate (project, "tvos/PROJ/Images.xcassets", projectDirectory + "/Images.xcassets", 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-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.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); FileHelper.recursiveSmartCopyTemplate (project, "tvos/PROJ.xcodeproj", targetDirectory + "/" + project.app.file + ".xcodeproj", context);

View File

@@ -55,7 +55,7 @@
1EEEBAFF121BE2B30048A9DF /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 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; }; 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 = "<group>"; }; 4257533E1A5EFD8C004AA45B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = "::APP_FILE::/Images.xcassets"; sourceTree = "<group>"; };
6662F3920A0E282007F4E3E /* ::APP_FILE::.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = ::APP_FILE::.entitlements; path = ::APP_FILE::/::APP_FILE::.entitlements; sourceTree = "<group>"; };
792E75C81C6C876900D01DE0 /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = System/Library/Frameworks/GameController.framework; sourceTree = SDKROOT; }; 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; }; 792E75C81C6C876900D01DE1 /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; };
::ADDL_PBX_FILE_REFERENCE:: ::ADDL_PBX_FILE_REFERENCE::
@@ -131,6 +131,7 @@
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
6662F3920A0E282007F4E3E /* ::APP_FILE::.entitlements */,
1EEEBA99121AF18B0048A9DF /* Frameworks */, 1EEEBA99121AF18B0048A9DF /* Frameworks */,
080E96DDFE201D6D7F000001 /* Classes */, 080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */, 29B97315FDCFA39411CA2CEA /* Other Sources */,
@@ -345,6 +346,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_ENTITLEMENTS = ::APP_FILE::/::APP_FILE::.entitlements;
::if DEVELOPMENT_TEAM_ID::DEVELOPMENT_TEAM = ::DEVELOPMENT_TEAM_ID::;::end:: ::if DEVELOPMENT_TEAM_ID::DEVELOPMENT_TEAM = ::DEVELOPMENT_TEAM_ID::;::end::
ENABLE_BITCODE = ::if (ENABLE_BITCODE)::YES::else::NO::end::; ENABLE_BITCODE = ::if (ENABLE_BITCODE)::YES::else::NO::end::;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@@ -400,6 +402,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_ENTITLEMENTS = ::APP_FILE::/::APP_FILE::.entitlements;
::if DEVELOPMENT_TEAM_ID::DEVELOPMENT_TEAM = ::DEVELOPMENT_TEAM_ID::;::end:: ::if DEVELOPMENT_TEAM_ID::DEVELOPMENT_TEAM = ::DEVELOPMENT_TEAM_ID::;::end::
ENABLE_BITCODE = ::if (ENABLE_BITCODE)::YES::else::NO::end::; ENABLE_BITCODE = ::if (ENABLE_BITCODE)::YES::else::NO::end::;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (