Skip to content

Commit

Permalink
iOS: support latest XCode(8.3.x) provisioning
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrys committed May 26, 2017
1 parent a52b40d commit 4d6f963
Show file tree
Hide file tree
Showing 6 changed files with 883 additions and 12 deletions.
17 changes: 14 additions & 3 deletions platform/iphone/rbuild/iphone.rake
Expand Up @@ -375,7 +375,7 @@ def update_plist_procedure
end
end

def set_signing_identity(identity,profile,entitlements)
def set_signing_identity(identity,profile,entitlements,provisioning_style,development_team)

appname = $app_config["name"] ? $app_config["name"] : "rhorunner"
appname_fixed = appname.split(/[^a-zA-Z0-9]/).map { |w| (w.capitalize) }.join("")
Expand All @@ -387,6 +387,13 @@ def set_signing_identity(identity,profile,entitlements)
if entitlements != nil
line.gsub!(/CODE_SIGN_ENTITLEMENTS = .*;/,"CODE_SIGN_ENTITLEMENTS = \"#{entitlements}\";")
end
if provisioning_style != nil
line.gsub!(/ProvisioningStyle = .*;/,"ProvisioningStyle = \"#{provisioning_style}\";")
end
if development_team != nil
line.gsub!(/DevelopmentTeam = .*;/,"DevelopmentTeam = \"#{development_team}\";")
line.gsub!(/DEVELOPMENT_TEAM = .*;/,"DEVELOPMENT_TEAM = \"#{development_team}\";")
end
line.gsub!(/CODE_SIGN_IDENTITY = .*;/,"CODE_SIGN_IDENTITY = \"#{identity}\";")
line.gsub!(/"CODE_SIGN_IDENTITY\[sdk=iphoneos\*\]" = .*;/,"\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"#{identity}\";")
if profile and profile.to_s != ""
Expand Down Expand Up @@ -1081,13 +1088,17 @@ namespace "config" do
if $app_config["iphone"].nil?
$signidentity = $config["env"]["iphone"]["codesignidentity"]
$provisionprofile = $config["env"]["iphone"]["provisionprofile"]
$provisioning_style = $config["env"]["iphone"]["provisioning_style"]
$development_team = $config["env"]["iphone"]["development_team"]
$entitlements = $config["env"]["iphone"]["entitlements"]
$configuration = $config["env"]["iphone"]["configuration"]
$sdk = $config["env"]["iphone"]["sdk"]
$emulatortarget = 'iphone'
else
$signidentity = $app_config["iphone"]["codesignidentity"]
$provisionprofile = $app_config["iphone"]["provisionprofile"]
$provisioning_style = $app_config["iphone"]["provisioning_style"]
$development_team = $app_config["iphone"]["development_team"]
$entitlements = $app_config["iphone"]["entitlements"]
$configuration = $app_config["iphone"]["configuration"]
$sdk = $app_config["iphone"]["sdk"]
Expand Down Expand Up @@ -2229,7 +2240,7 @@ namespace "build" do

update_plist_procedure

set_signing_identity($signidentity,$provisionprofile,$entitlements) #if $signidentity.to_s != ""
set_signing_identity($signidentity,$provisionprofile,$entitlements,$provisioning_style,$development_team) #if $signidentity.to_s != ""
end


Expand Down Expand Up @@ -2267,7 +2278,7 @@ namespace "build" do
end
end

set_signing_identity($signidentity,$provisionprofile,$entitlements) #if $signidentity.to_s != ""
set_signing_identity($signidentity,$provisionprofile,$entitlements,$provisioning_style,$development_team) #if $signidentity.to_s != ""
copy_entitlements_file_from_app

Rake::Task['build:bundle:prepare_native_generated_files'].invoke
Expand Down
3 changes: 3 additions & 0 deletions res/generators/rhogen.rb
Expand Up @@ -741,6 +741,9 @@ def get_xcode_version
if xcode_version[0].to_i >= 7
template.source = 'Bremen7.xcodeproj/project.pbxproj'
end
if xcode_version[0].to_i >= 8
template.source = 'Bremen8.xcodeproj/project.pbxproj'
end
template.destination = "project/iphone/#{namecamelcase}.xcodeproj/project.pbxproj"
if File.exists?(template.destination)
#puts '$$$$$$$$$$$$$$$$ EXIST'+template.destination
Expand Down
22 changes: 19 additions & 3 deletions res/generators/templates/application/build.yml
Expand Up @@ -51,9 +51,25 @@ iphone:
## simulator or device detect by rake command for "rake run:iphone" is simulator, for "rake device:iphone:production" is device
## sdk also can be defined exactly like: iphonesimulator10.2 or iphoneos10.2
sdk: latest
## Note: provisionprofile can be defined as name or UUID - if you defined provisionprofile then codesignidentity defined automatically if you not defined it in this build.yml
#provisionprofile:
#codesignidentity:
## Note: Provisioning
## There are two provisioning type for modern XCode: Automatic and Manual
## development_team must be configured for any type provisioning
## you see team code by run this command:
## $ security find-identity -p codesigning -v
## you will see list of certificates and you should copy code from "iPhone Distribution" line like this (code is PNQRMU3LPM):
## 5) D6D5EE35B3F8D9C04E85C7015539F04B38403DA3 "iPhone Distribution: Vasya Pupkin (PNQRMU3LPM)"
##
## Note: This is Automatic provisioning configuration:
#provisioning_style: Automatic
#development_team: "PNQRMU3LPM"
##
## Note: This is Manual provisioning configuration:
## provisionprofile can be defined as name or UUID - if you defined provisionprofile then codesignidentity defined automatically if you not defined it in this build.yml
#provisionprofile: "Current WildCart 05"
#provisioning_style: Manual
#development_team: "PNQRMU3LPM"
#codesignidentity: "iPhone Developer"
##
#entitlements:
BundleIdentifier: com.rhomobile.<%=@app_name_cleared%>
BundleURLScheme: <%=@app_name_cleared%>
Expand Down
26 changes: 23 additions & 3 deletions res/generators/templates/application/javascript_build.yml
Expand Up @@ -8,9 +8,29 @@ applog: rholog.txt
javascript_application: true
iphone:
configuration: Release
sdk: iphonesimulator10.0
#provisionprofile:
#codesignidentity:
## Note: sdk can be 3 predefined value : latest, latest_simulator, latest_device
## simulator or device detect by rake command for "rake run:iphone" is simulator, for "rake device:iphone:production" is device
## sdk also can be defined exactly like: iphonesimulator10.2 or iphoneos10.2
sdk: latest
## Note: Provisioning
## There are two provisioning type for modern XCode: Automatic and Manual
## development_team must be configured for any type provisioning
## you see team code by run this command:
## $ security find-identity -p codesigning -v
## you will see list of certificates and you should copy code from "iPhone Distribution" line like this (code is PNQRMU3LPM):
## 5) D6D5EE35B3F8D9C04E85C7015539F04B38403DA3 "iPhone Distribution: Vasya Pupkin (PNQRMU3LPM)"
##
## Note: This is Automatic provisioning configuration:
#provisioning_style: Automatic
#development_team: "PNQRMU3LPM"
##
## Note: This is Manual provisioning configuration:
## provisionprofile can be defined as name or UUID - if you defined provisionprofile then codesignidentity defined automatically if you not defined it in this build.yml
#provisionprofile: "Current WildCart 05"
#provisioning_style: Manual
#development_team: "PNQRMU3LPM"
#codesignidentity: "iPhone Developer"
##
#entitlements:
BundleIdentifier: com.rhomobile.<%=@app_name_cleared%>
BundleURLScheme: <%=@app_name_cleared%>
Expand Down
22 changes: 19 additions & 3 deletions res/generators/templates/application/nodejs_build.yml
Expand Up @@ -43,9 +43,25 @@ iphone:
## simulator or device detect by rake command for "rake run:iphone" is simulator, for "rake device:iphone:production" is device
## sdk also can be defined exactly like: iphonesimulator10.2 or iphoneos10.2
sdk: latest
## Note: provisionprofile can be defined as name or UUID - if you defined provisionprofile then codesignidentity defined automatically if you not defined it in this build.yml
#provisionprofile:
#codesignidentity:
## Note: Provisioning
## There are two provisioning type for modern XCode: Automatic and Manual
## development_team must be configured for any type provisioning
## you see team code by run this command:
## $ security find-identity -p codesigning -v
## you will see list of certificates and you should copy code from "iPhone Distribution" line like this (code is PNQRMU3LPM):
## 5) D6D5EE35B3F8D9C04E85C7015539F04B38403DA3 "iPhone Distribution: Vasya Pupkin (PNQRMU3LPM)"
##
## Note: This is Automatic provisioning configuration:
#provisioning_style: Automatic
#development_team: "PNQRMU3LPM"
##
## Note: This is Manual provisioning configuration:
## provisionprofile can be defined as name or UUID - if you defined provisionprofile then codesignidentity defined automatically if you not defined it in this build.yml
#provisionprofile: "Current WildCart 05"
#provisioning_style: Manual
#development_team: "PNQRMU3LPM"
#codesignidentity: "iPhone Developer"
##
#entitlements:
BundleIdentifier: com.rhomobile.<%=@app_name_cleared%>
BundleURLScheme: <%=@app_name_cleared%>
Expand Down

0 comments on commit 4d6f963

Please sign in to comment.