fastlane 2.53.0.beta.20170810010003 → 2.53.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 35a5438c6cd747913c5a9cf28d576bc5a5604257
4
- data.tar.gz: 04ae63f0cce1d058af9dbe12d473540f6f30c422
3
+ metadata.gz: c9c15a4acf1735c6c63fb0f90ae44bb5ac622b49
4
+ data.tar.gz: f6b0888e333f2282c34db8e9f7cc2093bcac046a
5
5
  SHA512:
6
- metadata.gz: 545f1f6239c5c61ee479f347419427e3b39c3825f465c09d6a9cbf28b561c6fe1e68366ed057239aa17917789da028bee547690fc8999dbc96b7e91b2324b9a2
7
- data.tar.gz: cd58ec8f522573c123eb187e283b51cbd7d534690f713ff276b97c9058fd9edab45183139c8084ebc51f41c6edfc497b57cb4e7ad87e28c723a9f0dc57fc7bde
6
+ metadata.gz: b019c4d13657b8c4ec23fb62b6860cac065ece1df6fa8bbe6cb70a790eed29d0c881845c2efe553f083ad63378be785cfe7b71c27c48961ee723a1d76aa43f2f
7
+ data.tar.gz: 2964571b4bec157186b696ca1c3eff34084f96d136ba281b5b2e2e90c2d889832a559324ae7348bfe81d908754fd4b4c2334079174968b5685c446ada72fa337
@@ -277,7 +277,7 @@ module Deliver
277
277
  UI.user_error!("`app_review_information` must be a hash", show_github_issues: true) unless info.kind_of?(Hash)
278
278
 
279
279
  REVIEW_INFORMATION_VALUES.each do |key, option_name|
280
- v.send("#{key}=", info[option_name]) if info[option_name]
280
+ v.send("#{key}=", info[option_name].to_s.chomp) if info[option_name]
281
281
  end
282
282
  v.review_user_needed = (v.review_demo_user.to_s.chomp + v.review_demo_password.to_s.chomp).length > 0
283
283
  end
Binary file
@@ -22,7 +22,18 @@ module Fastlane
22
22
  # If that's the case, we won't set the provisioning profiles
23
23
  # see https://github.com/fastlane/fastlane/issues/9490
24
24
  if values[:export_options].kind_of?(Hash)
25
- values[:export_options][:provisioningProfiles] = Actions.lane_context[SharedValues::MATCH_PROVISIONING_PROFILE_MAPPING]
25
+ match_mapping = Actions.lane_context[SharedValues::MATCH_PROVISIONING_PROFILE_MAPPING].dup
26
+ existing_mapping = values[:export_options][:provisioningProfiles].dup
27
+
28
+ # Be smart about how we merge those mappings in case there are conflicts
29
+ mapping_object = Gym::CodeSigningMapping.new
30
+ hash_to_use = mapping_object.merge_profile_mapping(primary_mapping: existing_mapping,
31
+ secondary_mapping: match_mapping,
32
+ export_method: values[:export_method])
33
+
34
+ values[:export_options][:provisioningProfiles] = hash_to_use
35
+ else
36
+ self.show_xcode_9_warning
26
37
  end
27
38
  elsif Actions.lane_context[SharedValues::SIGH_PROFILE_PATHS]
28
39
  # Since Xcode 9 you need to explicitly provide the provisioning profile per app target
@@ -38,7 +49,7 @@ module Fastlane
38
49
  profile = FastlaneCore::ProvisioningProfile.parse(profile_path)
39
50
  profile_team_id = profile["TeamIdentifier"].first
40
51
  next if profile_team_id != values[:export_team_id] && !values[:export_team_id].nil?
41
- bundle_id = profile["Entitlements"]["application-identifier"].gsub "#{profile_team_id}.", ""
52
+ bundle_id = profile["Entitlements"]["application-identifier"].gsub("#{profile_team_id}.", "")
42
53
  values[:export_options][:provisioningProfiles][bundle_id] = profile["Name"]
43
54
  rescue => ex
44
55
  UI.error("Couldn't load profile at path: #{profile_path}")
@@ -46,6 +57,8 @@ module Fastlane
46
57
  UI.verbose(ex.backtrace.join("\n"))
47
58
  end
48
59
  end
60
+ else
61
+ self.show_xcode_9_warning
49
62
  end
50
63
  end
51
64
 
@@ -116,6 +129,13 @@ module Fastlane
116
129
  def self.category
117
130
  :building
118
131
  end
132
+
133
+ def self.show_xcode_9_warning
134
+ return unless Helper.xcode_at_least?("9.0")
135
+ UI.message("You passed a path to a custom plist file for exporting the binary.")
136
+ UI.message("Make sure to include information about what provisioning profiles to use with Xcode 9")
137
+ UI.message("More information: https://docs.fastlane.tools/codesigning/xcode-project/#xcode-9-and-up")
138
+ end
119
139
  end
120
140
  end
121
141
  end
@@ -35,12 +35,18 @@ module Fastlane
35
35
  # }
36
36
  #
37
37
  def self.define_provisioning_profile_mapping(params)
38
- env_variable_name = Match::Utils.environment_variable_name_profile_name(app_identifier: params[:app_identifier],
39
- type: Match.profile_type_sym(params[:type]),
40
- platform: params[:platform])
41
-
42
38
  mapping = Actions.lane_context[SharedValues::MATCH_PROVISIONING_PROFILE_MAPPING] || {}
43
- mapping[params[:app_identifier]] = ENV[env_variable_name]
39
+
40
+ # Array (...) to make sure it's an Array, Ruby is magic, try this
41
+ # Array(1) # => [1]
42
+ # Array([1, 2]) # => [1, 2]
43
+ Array(params[:app_identifier]).each do |app_identifier|
44
+ env_variable_name = Match::Utils.environment_variable_name_profile_name(app_identifier: app_identifier,
45
+ type: Match.profile_type_sym(params[:type]),
46
+ platform: params[:platform])
47
+ mapping[app_identifier] = ENV[env_variable_name]
48
+ end
49
+
44
50
  Actions.lane_context[SharedValues::MATCH_PROVISIONING_PROFILE_MAPPING] = mapping
45
51
  end
46
52
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
- VERSION = '2.53.0.beta.20170810010003'.freeze
2
+ VERSION = '2.53.0'.freeze
3
3
  DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps".freeze
4
4
  MINIMUM_XCODE_RELEASE = "7.0".freeze
5
5
  end
data/gym/lib/gym.rb CHANGED
@@ -7,6 +7,7 @@ require 'gym/error_handler'
7
7
  require 'gym/options'
8
8
  require 'gym/detect_values'
9
9
  require 'gym/xcode'
10
+ require 'gym/code_signing_mapping'
10
11
 
11
12
  require 'fastlane_core'
12
13
  require 'terminal-table'
@@ -0,0 +1,138 @@
1
+ require 'xcodeproj'
2
+
3
+ module Gym
4
+ class CodeSigningMapping
5
+ attr_accessor :project
6
+
7
+ attr_accessor :project_paths
8
+
9
+ def initialize(project: nil)
10
+ self.project = project
11
+ end
12
+
13
+ # @param primary_mapping [Hash] The preferred mapping (e.g. whatever the user provided)
14
+ # @param secondary_mapping [Hash] (optional) The secondary mapping (e.g. whatever is detected from the Xcode project)
15
+ # @param export_method [String] The method that should be preferred in case there is a conflict
16
+ def merge_profile_mapping(primary_mapping: nil, secondary_mapping: nil, export_method: nil)
17
+ final_mapping = (primary_mapping || {}).dup # for verbose output at the end of the method
18
+ secondary_mapping ||= self.detect_project_profile_mapping # default to Xcode project
19
+
20
+ # Now it's time to merge the (potentially) existing mapping
21
+ # (e.g. coming from `provisioningProfiles` of the `export_options` or from previous match calls)
22
+ # with the secondary hash we just created (or was provided as parameter).
23
+ # Both might include information about what profile to use
24
+ # This is important as it mght not be clear for the user that they have to call match for each app target
25
+ # before adding this code, we'd only either use whatever we get from match, or what's defined in the Xcode project
26
+ # With the code below, we'll make sure to take the best of it:
27
+ #
28
+ # 1) A provisioning profile is defined in the `primary_mapping`
29
+ # 2) A provisioning profile is defined in the `secondary_mapping`
30
+ # 3) On a conflict (app identifier assigned both in xcode and match)
31
+ # 3.1) we'll choose whatever matches what's defined as the `export_method`
32
+ # 3.2) If both include the right `export_method`, we'll prefer the one from `primary_mapping`
33
+ # 3.3) If none has the right export_method, we'll use whatever is defined in the Xcode project
34
+ #
35
+ # To get a better sense of this, check out code_signing_spec.rb for some test cases
36
+
37
+ secondary_mapping.each do |bundle_identifier, provisioning_profile|
38
+ if final_mapping[bundle_identifier].nil?
39
+ final_mapping[bundle_identifier] = provisioning_profile
40
+ else
41
+ if self.app_identifier_contains?(final_mapping[bundle_identifier], export_method) # 3.1 + 3.2 nothing to do in this case
42
+ elsif self.app_identifier_contains?(provisioning_profile, export_method)
43
+ # Also 3.1 (3.1 is "implemented" twice, as it could be either the primary, or the secondary being the one that matches)
44
+ final_mapping[bundle_identifier] = provisioning_profile
45
+ else
46
+ # 3.3
47
+ final_mapping[bundle_identifier] = provisioning_profile
48
+ end
49
+ end
50
+ end
51
+
52
+ UI.verbose("Merging provisioning profile mappings")
53
+ UI.verbose("-------------------------------------")
54
+ UI.verbose("Primary provisioning profile mapping:")
55
+ UI.verbose(primary_mapping)
56
+ UI.verbose("Secondary provisioning profile mapping:")
57
+ UI.verbose(secondary_mapping)
58
+ UI.verbose("Resulting in the following mapping:")
59
+ UI.verbose(final_mapping)
60
+
61
+ return final_mapping
62
+ end
63
+
64
+ # Helper method to remove "-" and " " and downcase app identifier
65
+ # and compare if an app identifier includes a certain string
66
+ # We do some `gsub`bing, because we can't really know the profile type, so we'll just look at the name and see if it includes
67
+ # the export method (which it usually does, but with different notations)
68
+ def app_identifier_contains?(str, contains)
69
+ return str.to_s.gsub("-", "").gsub(" ", "").downcase.include?(contains.to_s.gsub("-", "").gsub(" ", "").downcase)
70
+ end
71
+
72
+ # Array of paths to all project files
73
+ # (might be multiple, because of workspaces)
74
+ def project_paths
75
+ return @_project_paths if @_project_paths
76
+ if self.project.workspace?
77
+ # Find the xcodeproj file, as the information isn't included in the workspace file
78
+ # We have a reference to the workspace, let's find the xcodeproj file
79
+ # For some reason the `plist` gem can't parse the content file
80
+ # so we'll use a regex to find all group references
81
+
82
+ workspace_data_path = File.join(self.project.path, "contents.xcworkspacedata")
83
+ workspace_data = File.read(workspace_data_path)
84
+ @_project_paths = workspace_data.scan(/\"group:(.*)\"/).collect do |current_match|
85
+ # It's a relative path from the workspace file
86
+ File.join(File.expand_path("..", self.project.path), current_match.first)
87
+ end.find_all do |current_match|
88
+ # We're not interested in a `Pods` project, as it doesn't contain any relevant
89
+ # information about code signing
90
+ !current_match.end_with?("Pods/Pods.xcodeproj")
91
+ end
92
+
93
+ return @_project_paths
94
+ else
95
+ # Return the path as an array
96
+ return @_project_paths = [self.project.path]
97
+ end
98
+ end
99
+
100
+ def detect_project_profile_mapping
101
+ provisioning_profile_mapping = {}
102
+
103
+ self.project_paths.each do |project_path|
104
+ UI.verbose("Parsing project file '#{project_path}' to find selected provisioning profiles")
105
+
106
+ begin
107
+ project = Xcodeproj::Project.open(project_path)
108
+ project.targets.each do |target|
109
+ target.build_configuration_list.build_configurations.each do |build_configuration|
110
+ current = build_configuration.build_settings
111
+
112
+ bundle_identifier = current["PRODUCT_BUNDLE_IDENTIFIER"]
113
+ provisioning_profile_specifier = current["PROVISIONING_PROFILE_SPECIFIER"]
114
+ provisioning_profile_uuid = current["PROVISIONING_PROFILE"]
115
+ if provisioning_profile_specifier.to_s.length > 0
116
+ provisioning_profile_mapping[bundle_identifier] = provisioning_profile_specifier
117
+ elsif provisioning_profile_uuid.to_s.length > 0
118
+ provisioning_profile_mapping[bundle_identifier] = provisioning_profile_uuid
119
+ end
120
+ end
121
+ end
122
+ rescue => ex
123
+ # We catch errors here, as we might run into an exception on one included project
124
+ # But maybe the next project actually contains the information we need
125
+ if Helper.xcode_at_least?("9.0")
126
+ UI.error("Couldn't automatically detect the provisioning profile mapping")
127
+ UI.error("Since Xcode 9 you need to provide an explicit mapping of what")
128
+ UI.error("provisioning profile to use for each target of your app")
129
+ UI.error(ex)
130
+ UI.verbose(ex.backtrace.join("\n"))
131
+ end
132
+ end
133
+ end
134
+
135
+ return provisioning_profile_mapping
136
+ end
137
+ end
138
+ end
@@ -59,70 +59,16 @@ module Gym
59
59
  # Since Xcode 9 you need to provide the explicit mapping of what provisioning profile to use for
60
60
  # each target of your app
61
61
  def self.detect_selected_provisioning_profiles
62
- if Gym.config[:export_options] && Gym.config[:export_options].kind_of?(Hash) && Gym.config[:export_options][:provisioningProfiles]
63
- return
64
- end
65
-
66
- require 'xcodeproj'
67
-
68
- provisioning_profile_mapping = {}
69
-
70
- # Find the xcodeproj file, as the information isn't included in the workspace file
71
- if Gym.project.workspace?
72
- # We have a reference to the workspace, let's find the xcodeproj file
73
- # For some reason the `plist` gem can't parse the content file
74
- # so we'll use a regex to find all group references
75
-
76
- workspace_data_path = File.join(Gym.project.path, "contents.xcworkspacedata")
77
- workspace_data = File.read(workspace_data_path)
78
- project_paths = workspace_data.scan(/\"group:(.*)\"/).collect do |current_match|
79
- # It's a relative path from the workspace file
80
- File.join(File.expand_path("..", Gym.project.path), current_match.first)
81
- end.find_all do |current_match|
82
- !current_match.end_with?("Pods/Pods.xcodeproj")
83
- end
84
- else
85
- project_paths = [Gym.project.path]
86
- end
87
-
88
- # Because there might be multiple projects inside a workspace
89
- # we iterate over all of them (except for CocoaPods)
90
- project_paths.each do |project_path|
91
- UI.verbose("Parsing project file '#{project_path}' to find selected provisioning profiles")
92
- begin
93
- project = Xcodeproj::Project.open(project_path)
94
- project.targets.each do |target|
95
- target.build_configuration_list.build_configurations.each do |build_configuration|
96
- current = build_configuration.build_settings
97
-
98
- bundle_identifier = current["PRODUCT_BUNDLE_IDENTIFIER"]
99
- provisioning_profile_specifier = current["PROVISIONING_PROFILE_SPECIFIER"]
100
- provisioning_profile_uuid = current["PROVISIONING_PROFILE"]
101
- if provisioning_profile_specifier.to_s.length > 0
102
- provisioning_profile_mapping[bundle_identifier] = provisioning_profile_specifier
103
- elsif provisioning_profile_uuid.to_s.length > 0
104
- provisioning_profile_mapping[bundle_identifier] = provisioning_profile_uuid
105
- end
106
- end
107
- end
108
- rescue => ex
109
- # We catch errors here, as we might run into an exception on one included project
110
- # But maybe the next project actually contains the information we need
111
- if Helper.xcode_at_least?("9.0")
112
- UI.error("Couldn't automatically detect the provisioning profile mapping")
113
- UI.error("Since Xcode 9 you need to provide an explicit mapping of what")
114
- UI.error("provisioning profile to use for each target of your app")
115
- UI.error(ex)
116
- UI.verbose(ex.backtrace.join("\n"))
117
- end
118
- end
119
- end
62
+ Gym.config[:export_options] ||= {}
63
+ hash_to_use = (Gym.config[:export_options][:provisioningProfiles] || {}).dup || {} # dup so we can show the original values in `verbose` mode
120
64
 
121
- return if provisioning_profile_mapping.count == 0
65
+ mapping_object = CodeSigningMapping.new(project: Gym.project)
66
+ hash_to_use = mapping_object.merge_profile_mapping(primary_mapping: hash_to_use,
67
+ export_method: Gym.config[:export_method])
122
68
 
123
- Gym.config[:export_options] ||= {}
124
- Gym.config[:export_options][:provisioningProfiles] = provisioning_profile_mapping
125
- UI.message("Detected provisioning profile mapping: #{provisioning_profile_mapping}")
69
+ return if hash_to_use.count == 0 # We don't want to set a mapping if we don't have one
70
+ Gym.config[:export_options][:provisioningProfiles] = hash_to_use
71
+ UI.message("Detected provisioning profile mapping: #{hash_to_use}")
126
72
  rescue => ex
127
73
  # We don't want to fail the build if the automatic detection doesn't work
128
74
  # especially since the mapping is optional for pre Xcode 9 setups
@@ -250,7 +250,7 @@ module Gym
250
250
 
251
251
  next if matching_type.to_s == selected_export_method
252
252
  UI.message("")
253
- UI.error("There is a mismatch between your provided `export_method` in gym")
253
+ UI.error("There seems to be a mismatch between your provided `export_method` in gym")
254
254
  UI.error("and the selected provisioning profiles. You passed the following options:")
255
255
  UI.important(" export_method: #{selected_export_method}")
256
256
  UI.important(" Bundle identifier: #{current_bundle_identifier}")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.53.0.beta.20170810010003
4
+ version: 2.53.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -830,6 +830,7 @@ files:
830
830
  - fastlane/lib/assets/s3_plist_template.erb
831
831
  - fastlane/lib/assets/s3_version_template.erb
832
832
  - fastlane/lib/fastlane.rb
833
+ - fastlane/lib/fastlane/.DS_Store
833
834
  - fastlane/lib/fastlane/action.rb
834
835
  - fastlane/lib/fastlane/action_collector.rb
835
836
  - fastlane/lib/fastlane/actions/README.md
@@ -1160,6 +1161,7 @@ files:
1160
1161
  - gym/lib/assets/GymfileTemplate
1161
1162
  - gym/lib/assets/wrap_xcodebuild/xcbuild-safe.sh
1162
1163
  - gym/lib/gym.rb
1164
+ - gym/lib/gym/code_signing_mapping.rb
1163
1165
  - gym/lib/gym/commands_generator.rb
1164
1166
  - gym/lib/gym/detect_values.rb
1165
1167
  - gym/lib/gym/error_handler.rb
@@ -1406,24 +1408,24 @@ metadata:
1406
1408
  post_install_message:
1407
1409
  rdoc_options: []
1408
1410
  require_paths:
1409
- - spaceship/lib
1410
- - scan/lib
1411
- - sigh/lib
1412
- - snapshot/lib
1413
- - screengrab/lib
1414
- - fastlane/lib
1415
1411
  - cert/lib
1416
- - pem/lib
1417
- - gym/lib
1418
- - produce/lib
1412
+ - credentials_manager/lib
1419
1413
  - deliver/lib
1420
- - supply/lib
1421
- - match/lib
1414
+ - fastlane/lib
1415
+ - fastlane_core/lib
1422
1416
  - frameit/lib
1423
- - credentials_manager/lib
1417
+ - gym/lib
1418
+ - match/lib
1419
+ - pem/lib
1424
1420
  - pilot/lib
1425
1421
  - precheck/lib
1426
- - fastlane_core/lib
1422
+ - produce/lib
1423
+ - scan/lib
1424
+ - screengrab/lib
1425
+ - sigh/lib
1426
+ - snapshot/lib
1427
+ - spaceship/lib
1428
+ - supply/lib
1427
1429
  required_ruby_version: !ruby/object:Gem::Requirement
1428
1430
  requirements:
1429
1431
  - - ">="
@@ -1431,14 +1433,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
1431
1433
  version: 2.0.0
1432
1434
  required_rubygems_version: !ruby/object:Gem::Requirement
1433
1435
  requirements:
1434
- - - ">"
1436
+ - - ">="
1435
1437
  - !ruby/object:Gem::Version
1436
- version: 1.3.1
1438
+ version: '0'
1437
1439
  requirements: []
1438
1440
  rubyforge_project:
1439
- rubygems_version: 2.4.5.1
1441
+ rubygems_version: 2.6.8
1440
1442
  signing_key:
1441
1443
  specification_version: 4
1442
1444
  summary: The easiest way to automate beta deployments and releases for your iOS and
1443
1445
  Android apps
1444
1446
  test_files: []
1447
+ has_rdoc: