From 29fda1c54547a3a1f34ab8287a5fbbd72f347b3d Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Thu, 15 Sep 2016 15:08:47 -0700 Subject: [PATCH] Add support (Xcode 8 signing) --- lime/project/Keystore.hx | 7 +++++-- lime/project/ProjectXMLParser.hx | 15 +++++++++++++-- lime/tools/platforms/IOSPlatform.hx | 9 +++++++-- templates/iphone/PROJ.xcodeproj/project.pbxproj | 9 +++++++++ 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/lime/project/Keystore.hx b/lime/project/Keystore.hx index 26a69042a..5c16d39f8 100644 --- a/lime/project/Keystore.hx +++ b/lime/project/Keystore.hx @@ -8,21 +8,23 @@ class Keystore { public var identity:String; public var password:String; public var path:String; + public var teamID:String; public var type:String; - public function new (path:String = null, password:String = null, alias:String = null, aliasPassword:String = null, identity:String = null) { + public function new (path:String = null, password:String = null, alias:String = null, aliasPassword:String = null, identity:String = null, teamID:String = null) { this.path = path; this.password = password; this.alias = alias; this.aliasPassword = aliasPassword; this.identity = identity; + this.teamID = teamID; } public function clone ():Keystore { - return new Keystore (path, password, alias, aliasPassword, identity); + return new Keystore (path, password, alias, aliasPassword, identity, teamID); } @@ -35,6 +37,7 @@ class Keystore { if (keystore.alias != null) path = keystore.alias; if (keystore.aliasPassword != null) path = keystore.aliasPassword; if (keystore.identity != null) identity = keystore.identity; + if (keystore.teamID != null) teamID = keystore.teamID; } diff --git a/lime/project/ProjectXMLParser.hx b/lime/project/ProjectXMLParser.hx index a6614f759..5c2fbf421 100644 --- a/lime/project/ProjectXMLParser.hx +++ b/lime/project/ProjectXMLParser.hx @@ -1472,10 +1472,21 @@ class ProjectXMLParser extends HXProject { } - } else if (element.has.identity) { + } else if (element.has.identity || element.has.resolve ("team-id")) { certificate = new Keystore (); - certificate.identity = substitute (element.att.identity); + + if (element.has.identity) { + + certificate.identity = substitute (element.att.identity); + + } + + if (element.has.resolve ("team-id")) { + + certificate.teamID = substitute (element.att.resolve ("team-id")); + + } } diff --git a/lime/tools/platforms/IOSPlatform.hx b/lime/tools/platforms/IOSPlatform.hx index 0b7626142..7ddef3c15 100644 --- a/lime/tools/platforms/IOSPlatform.hx +++ b/lime/tools/platforms/IOSPlatform.hx @@ -106,9 +106,8 @@ class IOSPlatform extends PlatformTarget { project.sources = PathHelper.relocatePaths (project.sources, PathHelper.combine (targetDirectory, project.app.file + "/haxe")); //project.dependencies.push ("stdc++"); - if (project.certificate == null || project.certificate.identity == null) { + if (project.certificate != null && project.certificate.identity == null) { - project.certificate = new Keystore (); project.certificate.identity = "iPhone Developer"; } @@ -131,6 +130,12 @@ class IOSPlatform extends PlatformTarget { context.HAS_LAUNCH_IMAGE = false; context.OBJC_ARC = false; + if (project.certificate != null) { + + context.DEVELOPMENT_TEAM_ID = project.certificate.teamID; + + } + context.linkedLibraries = []; for (dependency in project.dependencies) { diff --git a/templates/iphone/PROJ.xcodeproj/project.pbxproj b/templates/iphone/PROJ.xcodeproj/project.pbxproj index dd4e0cffa..1935eb81f 100644 --- a/templates/iphone/PROJ.xcodeproj/project.pbxproj +++ b/templates/iphone/PROJ.xcodeproj/project.pbxproj @@ -197,6 +197,13 @@ /* Begin PBXProject section */ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; + attributes = { + TargetAttributes = { + 1D6058900D05DD3D006BFB54 = { + ::if DEVELOPMENT_TEAM_ID::DevelopmentTeam = ::DEVELOPMENT_TEAM_ID::;::end:: + }; + }; + }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "::APP_TITLE::" */; compatibilityVersion = "Xcode 3.2"; hasScannedForEncodings = 1; @@ -307,6 +314,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + ::if DEVELOPMENT_TEAM_ID::DEVELOPMENT_TEAM = ::DEVELOPMENT_TEAM_ID::;::end:: ENABLE_BITCODE = ::if (ENABLE_BITCODE)::YES::else::NO::end::; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -360,6 +368,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + ::if DEVELOPMENT_TEAM_ID::DEVELOPMENT_TEAM = ::DEVELOPMENT_TEAM_ID::;::end:: ENABLE_BITCODE = ::if (ENABLE_BITCODE)::YES::else::NO::end::; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)",