fastlane 1.20.0 → 1.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/bin/fastlane +16 -16
  3. data/lib/assets/custom_action_template.rb +2 -2
  4. data/lib/fastlane.rb +1 -0
  5. data/lib/fastlane/action.rb +5 -6
  6. data/lib/fastlane/action_collector.rb +6 -6
  7. data/lib/fastlane/actions/actions_helper.rb +12 -74
  8. data/lib/fastlane/actions/add_git_tag.rb +2 -2
  9. data/lib/fastlane/actions/appstore.rb +2 -2
  10. data/lib/fastlane/actions/backup_file.rb +2 -2
  11. data/lib/fastlane/actions/backup_xcarchive.rb +11 -12
  12. data/lib/fastlane/actions/bundle_install.rb +5 -1
  13. data/lib/fastlane/actions/chatwork.rb +12 -12
  14. data/lib/fastlane/actions/clean_build_artifacts.rb +4 -6
  15. data/lib/fastlane/actions/clipboard.rb +1 -1
  16. data/lib/fastlane/actions/commit_version_bump.rb +35 -10
  17. data/lib/fastlane/actions/crashlytics.rb +26 -26
  18. data/lib/fastlane/actions/create_keychain.rb +6 -6
  19. data/lib/fastlane/actions/default_platform.rb +1 -1
  20. data/lib/fastlane/actions/delete_keychain.rb +3 -3
  21. data/lib/fastlane/actions/deliver.rb +3 -3
  22. data/lib/fastlane/actions/deploygate.rb +19 -18
  23. data/lib/fastlane/actions/dsym_zip.rb +7 -9
  24. data/lib/fastlane/actions/ensure_git_branch.rb +2 -3
  25. data/lib/fastlane/actions/ensure_no_debug_code.rb +8 -8
  26. data/lib/fastlane/actions/fastlane_version.rb +4 -2
  27. data/lib/fastlane/actions/frameit.rb +7 -7
  28. data/lib/fastlane/actions/gcovr.rb +5 -4
  29. data/lib/fastlane/actions/get_build_number.rb +27 -30
  30. data/lib/fastlane/actions/get_github_release.rb +11 -11
  31. data/lib/fastlane/actions/get_version_number.rb +28 -30
  32. data/lib/fastlane/actions/git_branch.rb +1 -2
  33. data/lib/fastlane/actions/gym.rb +2 -2
  34. data/lib/fastlane/actions/hg_commit_version_bump.rb +28 -6
  35. data/lib/fastlane/actions/hg_push.rb +0 -1
  36. data/lib/fastlane/actions/hipchat.rb +20 -20
  37. data/lib/fastlane/actions/hockey.rb +16 -17
  38. data/lib/fastlane/actions/import.rb +1 -2
  39. data/lib/fastlane/actions/import_certificate.rb +1 -1
  40. data/lib/fastlane/actions/import_from_git.rb +6 -2
  41. data/lib/fastlane/actions/increment_build_number.rb +25 -28
  42. data/lib/fastlane/actions/increment_version_number.rb +55 -57
  43. data/lib/fastlane/actions/install_carthage.rb +10 -11
  44. data/lib/fastlane/actions/install_cocoapods.rb +3 -3
  45. data/lib/fastlane/actions/ipa.rb +8 -6
  46. data/lib/fastlane/actions/is_ci.rb +37 -0
  47. data/lib/fastlane/actions/lane_context.rb +2 -2
  48. data/lib/fastlane/actions/last_git_tag.rb +1 -1
  49. data/lib/fastlane/actions/lcov.rb +28 -31
  50. data/lib/fastlane/actions/mailgun.rb +11 -42
  51. data/lib/fastlane/actions/oclint.rb +10 -13
  52. data/lib/fastlane/actions/pem.rb +2 -2
  53. data/lib/fastlane/actions/pilot.rb +4 -2
  54. data/lib/fastlane/actions/prompt.rb +6 -6
  55. data/lib/fastlane/actions/push_git_tags.rb +38 -0
  56. data/lib/fastlane/actions/push_to_git_remote.rb +4 -1
  57. data/lib/fastlane/actions/puts.rb +1 -1
  58. data/lib/fastlane/actions/register_devices.rb +4 -3
  59. data/lib/fastlane/actions/reset_git_repo.rb +6 -6
  60. data/lib/fastlane/actions/resign.rb +4 -5
  61. data/lib/fastlane/actions/restore_file.rb +2 -2
  62. data/lib/fastlane/actions/s3.rb +19 -22
  63. data/lib/fastlane/actions/set_build_number_repository.rb +26 -36
  64. data/lib/fastlane/actions/set_changelog.rb +4 -4
  65. data/lib/fastlane/actions/set_github_release.rb +10 -11
  66. data/lib/fastlane/actions/sigh.rb +1 -1
  67. data/lib/fastlane/actions/slack.rb +85 -74
  68. data/lib/fastlane/actions/snapshot.rb +2 -2
  69. data/lib/fastlane/actions/team_id.rb +2 -1
  70. data/lib/fastlane/actions/team_name.rb +2 -1
  71. data/lib/fastlane/actions/testflight.rb +2 -2
  72. data/lib/fastlane/actions/testmunk.rb +16 -16
  73. data/lib/fastlane/actions/typetalk.rb +14 -14
  74. data/lib/fastlane/actions/update_app_group_identifiers.rb +17 -17
  75. data/lib/fastlane/actions/update_fastlane.rb +16 -14
  76. data/lib/fastlane/actions/update_info_plist.rb +14 -16
  77. data/lib/fastlane/actions/update_project_code_signing.rb +3 -3
  78. data/lib/fastlane/actions/update_project_provisioning.rb +48 -36
  79. data/lib/fastlane/actions/xcode_select.rb +4 -3
  80. data/lib/fastlane/actions/xcode_server_get_assets.rb +23 -24
  81. data/lib/fastlane/actions/xcodebuild.rb +13 -13
  82. data/lib/fastlane/actions/xctool.rb +2 -2
  83. data/lib/fastlane/actions_list.rb +27 -29
  84. data/lib/fastlane/command_line_handler.rb +13 -14
  85. data/lib/fastlane/configuration_helper.rb +18 -20
  86. data/lib/fastlane/core_ext/string.rb +2 -2
  87. data/lib/fastlane/docs_generator.rb +33 -32
  88. data/lib/fastlane/erb_template_helper.rb +1 -1
  89. data/lib/fastlane/fast_file.rb +27 -18
  90. data/lib/fastlane/fastlane_folder.rb +1 -1
  91. data/lib/fastlane/helper/git_helper.rb +27 -0
  92. data/lib/fastlane/helper/sh_helper.rb +48 -0
  93. data/lib/fastlane/junit_generator.rb +1 -1
  94. data/lib/fastlane/lane.rb +6 -6
  95. data/lib/fastlane/lane_list.rb +12 -13
  96. data/lib/fastlane/lane_manager.rb +17 -11
  97. data/lib/fastlane/new_action.rb +1 -1
  98. data/lib/fastlane/runner.rb +23 -24
  99. data/lib/fastlane/setup.rb +16 -17
  100. data/lib/fastlane/supported_platforms.rb +2 -2
  101. data/lib/fastlane/version.rb +1 -1
  102. metadata +16 -12
@@ -16,7 +16,7 @@ module Fastlane
16
16
  FastlaneCore::UpdateChecker.start_looking_for_update('sigh') unless Helper.is_test?
17
17
 
18
18
  Sigh.config = values # we already have the finished config
19
-
19
+
20
20
  path = Sigh::Manager.start
21
21
 
22
22
  Actions.lane_context[SharedValues::SIGH_PROFILE_PATH] = path # absolute path
@@ -1,3 +1,6 @@
1
+ # rubocop:disable Style/CaseEquality
2
+ # rubocop:disable Style/MultilineTernaryOperator
3
+ # rubocop:disable Style/NestedTernaryOperator
1
4
  module Fastlane
2
5
  module Actions
3
6
  class SlackAction < Action
@@ -44,11 +47,11 @@ module Fastlane
44
47
  icon_url: 'https://s3-eu-west-1.amazonaws.com/fastlane.tools/fastlane.png',
45
48
  attachments: [slack_attachment]
46
49
 
47
- unless result.code.to_i == 200
50
+ if result.code.to_i == 200
51
+ Helper.log.info 'Successfully sent Slack notification'.green
52
+ else
48
53
  Helper.log.debug result
49
54
  raise 'Error pushing Slack message, maybe the integration has no permission to post on this channel? Try removing the channel parameter in your Fastfile.'.red
50
- else
51
- Helper.log.info 'Successfully sent Slack notification'.green
52
55
  end
53
56
  end
54
57
 
@@ -69,8 +72,8 @@ module Fastlane
69
72
  FastlaneCore::ConfigItem.new(key: :slack_url,
70
73
  env_name: "SLACK_URL",
71
74
  description: "Create an Incoming WebHook for your Slack group",
72
- verify_block: Proc.new do |value|
73
- raise "Invalid URL, must start with https://" unless value.start_with?"https://"
75
+ verify_block: proc do |value|
76
+ raise "Invalid URL, must start with https://" unless value.start_with? "https://"
74
77
  end),
75
78
  FastlaneCore::ConfigItem.new(key: :payload,
76
79
  env_name: "FL_SLACK_PAYLOAD",
@@ -92,7 +95,7 @@ module Fastlane
92
95
  description: "Was this build successful? (true/false)",
93
96
  optional: true,
94
97
  default_value: true,
95
- is_string: false),
98
+ is_string: false)
96
99
  ]
97
100
  end
98
101
 
@@ -100,87 +103,95 @@ module Fastlane
100
103
  "KrauseFx"
101
104
  end
102
105
 
103
- private
104
- def self.generate_slack_attachments(options)
105
- color = (options[:success] ? 'good' : 'danger')
106
- should_add_payload = ->(payload_name) { options[:default_payloads].nil? || options[:default_payloads].include?(payload_name) }
107
-
108
- slack_attachment = {
109
- fallback: options[:message],
110
- text: options[:message],
111
- color: color,
112
- fields: []
106
+ #####################################################
107
+ # @!group Helper
108
+ #####################################################
109
+
110
+ def self.generate_slack_attachments(options)
111
+ color = (options[:success] ? 'good' : 'danger')
112
+ should_add_payload = ->(payload_name) { options[:default_payloads].nil? || options[:default_payloads].include?(payload_name) }
113
+
114
+ slack_attachment = {
115
+ fallback: options[:message],
116
+ text: options[:message],
117
+ color: color,
118
+ fields: []
119
+ }
120
+
121
+ # custom user payloads
122
+ slack_attachment[:fields] += options[:payload].map do |k, v|
123
+ {
124
+ title: k.to_s,
125
+ value: Slack::Notifier::LinkFormatter.format(v.to_s),
126
+ short: false
113
127
  }
128
+ end
114
129
 
115
- # custom user payloads
116
- slack_attachment[:fields] += options[:payload].map do |k, v|
117
- {
118
- title: k.to_s,
119
- value: Slack::Notifier::LinkFormatter.format(v.to_s),
120
- short: false
121
- }
122
- end
130
+ # lane
131
+ if should_add_payload[:lane]
132
+ slack_attachment[:fields] << {
133
+ title: 'Lane',
134
+ value: Actions.lane_context[Actions::SharedValues::LANE_NAME],
135
+ short: true
136
+ }
137
+ end
123
138
 
124
- # lane
125
- if should_add_payload[:lane]
126
- slack_attachment[:fields] << {
127
- title: 'Lane',
128
- value: Actions.lane_context[Actions::SharedValues::LANE_NAME],
129
- short: true
130
- }
131
- end
139
+ # test_result
140
+ if should_add_payload[:test_result]
141
+ slack_attachment[:fields] << {
142
+ title: 'Result',
143
+ value: (options[:success] ? 'Success' : 'Error'),
144
+ short: true
145
+ }
146
+ end
132
147
 
133
- # test_result
134
- if should_add_payload[:test_result]
135
- slack_attachment[:fields] << {
136
- title: 'Result',
137
- value: (options[:success] ? 'Success' : 'Error'),
138
- short: true
139
- }
140
- end
148
+ # git branch
149
+ if Actions.git_branch && should_add_payload[:git_branch]
150
+ slack_attachment[:fields] << {
151
+ title: 'Git Branch',
152
+ value: Actions.git_branch,
153
+ short: true
154
+ }
155
+ end
141
156
 
142
- # git branch
143
- if Actions.git_branch && should_add_payload[:git_branch]
157
+ # git_author
158
+ if Actions.git_author && should_add_payload[:git_author]
159
+ if ENV['FASTLANE_SLACK_HIDE_AUTHOR_ON_SUCCESS'] && options[:success]
160
+ # We only show the git author if the build failed
161
+ else
144
162
  slack_attachment[:fields] << {
145
- title: 'Git Branch',
146
- value: Actions.git_branch,
163
+ title: 'Git Author',
164
+ value: Actions.git_author,
147
165
  short: true
148
166
  }
149
167
  end
168
+ end
150
169
 
151
- # git_author
152
- if Actions.git_author && should_add_payload[:git_author]
153
- if ENV['FASTLANE_SLACK_HIDE_AUTHOR_ON_SUCCESS'] && options[:success]
154
- # We only show the git author if the build failed
155
- else
156
- slack_attachment[:fields] << {
157
- title: 'Git Author',
158
- value: Actions.git_author,
159
- short: true
160
- }
161
- end
162
- end
163
-
164
- # last_git_commit
165
- if Actions.last_git_commit && should_add_payload[:last_git_commit]
166
- slack_attachment[:fields] << {
167
- title: 'Git Commit',
168
- value: Actions.last_git_commit,
169
- short: false
170
- }
171
- end
172
-
173
- # merge additional properties
174
- deep_merge(slack_attachment, options[:attachment_properties])
170
+ # last_git_commit
171
+ if Actions.last_git_commit && should_add_payload[:last_git_commit]
172
+ slack_attachment[:fields] << {
173
+ title: 'Git Commit',
174
+ value: Actions.last_git_commit,
175
+ short: false
176
+ }
175
177
  end
176
178
 
177
- # Adapted from http://stackoverflow.com/a/30225093/158525
178
- def self.deep_merge(a, b)
179
- merger = proc { |key, v1, v2| Hash === v1 && Hash === v2 ?
180
- v1.merge(v2, &merger) : Array === v1 && Array === v2 ?
181
- v1 | v2 : [:undefined, nil, :nil].include?(v2) ? v1 : v2 }
182
- a.merge(b, &merger)
179
+ # merge additional properties
180
+ deep_merge(slack_attachment, options[:attachment_properties])
181
+ end
182
+
183
+ # Adapted from http://stackoverflow.com/a/30225093/158525
184
+ def self.deep_merge(a, b)
185
+ merger = proc do |key, v1, v2|
186
+ Hash === v1 && Hash === v2 ?
187
+ v1.merge(v2, &merger) : Array === v1 && Array === v2 ?
188
+ v1 | v2 : [:undefined, nil, :nil].include?(v2) ? v1 : v2
183
189
  end
190
+ a.merge(b, &merger)
191
+ end
184
192
  end
185
193
  end
186
194
  end
195
+ # rubocop:enable Style/CaseEquality
196
+ # rubocop:enable Style/MultilineTernaryOperator
197
+ # rubocop:enable Style/NestedTernaryOperator
@@ -55,8 +55,8 @@ module Fastlane
55
55
  env_name: "FL_SNAPSHOT_CONFIG_PATH",
56
56
  description: "Specify a path to the directory containing the Snapfile",
57
57
  default_value: FastlaneFolder.path || Dir.pwd, # defaults to fastlane folder
58
- verify_block: Proc.new do |value|
59
- raise "Couldn't find folder '#{value}'. Make sure to pass the path to the directory not the file!".red unless File.directory?(value)
58
+ verify_block: proc do |value|
59
+ raise "Couldn't find folder '#{value}'. Make sure to pass the path to the directory not the file!".red unless File.directory?(value)
60
60
  end),
61
61
  FastlaneCore::ConfigItem.new(key: :nobuild,
62
62
  env_name: "FL_SNAPSHOT_NO_BUILD",
@@ -5,7 +5,8 @@ module Fastlane
5
5
 
6
6
  class TeamIdAction < Action
7
7
  def self.run(params)
8
- team = (params.first rescue nil)
8
+ params = nil unless params.kind_of? Array
9
+ team = (params || []).first
9
10
  raise "Please pass your Team ID (e.g. team_id 'Q2CBPK58CA')".red unless team.to_s.length > 0
10
11
 
11
12
  Helper.log.info "Setting Team ID to '#{team}' for all build steps"
@@ -5,7 +5,8 @@ module Fastlane
5
5
 
6
6
  class TeamNameAction < Action
7
7
  def self.run(params)
8
- team = (params.first rescue nil)
8
+ params = nil unless params.kind_of? Array
9
+ team = (params || []).first
9
10
  raise "Please pass your Team Name (e.g. team_name 'Felix Krause')".red unless team.to_s.length > 0
10
11
 
11
12
  Helper.log.info "Setting Team Name to '#{team}' for all build steps"
@@ -40,8 +40,8 @@ module Fastlane
40
40
  end
41
41
 
42
42
  def self.is_supported?(platform)
43
- Actions::DeliverAction.is_supported?platform
43
+ Actions::DeliverAction.is_supported? platform
44
44
  end
45
45
  end
46
46
  end
47
- end
47
+ end
@@ -14,16 +14,16 @@ module Fastlane
14
14
  class TestmunkAction < Action
15
15
  def self.run(config)
16
16
  Helper.log.info 'Testmunk: Uploading the .ipa and starting your tests'.green
17
-
17
+
18
18
  Helper.log.info 'Zipping features/ to features.zip'.green
19
19
  zipped_features_path = File.expand_path('features.zip')
20
- Actions.sh(%Q[zip -r "features" "features/"])
20
+ Actions.sh(%(zip -r "features" "features/"))
21
21
 
22
- response = system("#{"curl -H 'Accept: application/vnd.testmunk.v1+json'" +
23
- " -F 'file=@#{config[:ipa]}' -F 'autoStart=true'" +
24
- " -F 'testcases=@#{zipped_features_path}'" +
25
- " -F 'email=#{config[:email]}'" +
26
- " https://#{config[:api]}@api.testmunk.com/apps/#{config[:app]}/testruns"}")
22
+ response = system("curl -H 'Accept: application/vnd.testmunk.v1+json'" \
23
+ " -F 'file=@#{config[:ipa]}' -F 'autoStart=true'" \
24
+ " -F 'testcases=@#{zipped_features_path}'" \
25
+ " -F 'email=#{config[:email]}'" \
26
+ " https://#{config[:api]}@api.testmunk.com/apps/#{config[:app]}/testruns")
27
27
 
28
28
  if response
29
29
  Helper.log.info 'Your tests are being executed right now. Please wait for the mail with results and decide if you want to continue.'.green
@@ -42,26 +42,26 @@ module Fastlane
42
42
  env_name: "TESTMUNK_IPA",
43
43
  description: "Path to IPA",
44
44
  default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH],
45
- verify_block: Proc.new do |value|
46
- raise "Please pass to existing ipa" unless File.exists?value
45
+ verify_block: proc do |value|
46
+ raise "Please pass to existing ipa" unless File.exist? value
47
47
  end),
48
48
  FastlaneCore::ConfigItem.new(key: :email,
49
49
  env_name: "TESTMUNK_EMAIL",
50
50
  description: "Your email address",
51
- verify_block: Proc.new do |value|
52
- raise "Please pass your Testmunk email address using `ENV['TESTMUNK_EMAIL'] = 'value'`" unless value
51
+ verify_block: proc do |value|
52
+ raise "Please pass your Testmunk email address using `ENV['TESTMUNK_EMAIL'] = 'value'`" unless value
53
53
  end),
54
54
  FastlaneCore::ConfigItem.new(key: :api,
55
55
  env_name: "TESTMUNK_API",
56
56
  description: "Testmunk API Key",
57
- verify_block: Proc.new do |value|
58
- raise "Please pass your Testmunk API Key using `ENV['TESTMUNK_API'] = 'value'`" unless value
57
+ verify_block: proc do |value|
58
+ raise "Please pass your Testmunk API Key using `ENV['TESTMUNK_API'] = 'value'`" unless value
59
59
  end),
60
60
  FastlaneCore::ConfigItem.new(key: :app,
61
61
  env_name: "TESTMUNK_APP",
62
62
  description: "Testmunk App Name",
63
- verify_block: Proc.new do |value|
64
- raise "Please pass your Testmunk app name using `ENV['TESTMUNK_APP'] = 'value'`" unless value
63
+ verify_block: proc do |value|
64
+ raise "Please pass your Testmunk app name using `ENV['TESTMUNK_APP'] = 'value'`" unless value
65
65
  end)
66
66
  ]
67
67
  end
@@ -75,4 +75,4 @@ module Fastlane
75
75
  end
76
76
  end
77
77
  end
78
- end
78
+ end
@@ -6,16 +6,16 @@ module Fastlane
6
6
  message: nil,
7
7
  note_path: nil,
8
8
  success: true,
9
- topicId: nil,
10
- typetalk_token: nil,
9
+ topic_id: nil,
10
+ typetalk_token: nil
11
11
  }.merge(params || {})
12
12
 
13
- [:message, :topicId, :typetalk_token].each { |key|
13
+ [:message, :topic_id, :typetalk_token].each do |key|
14
14
  raise "No #{key} given.".red unless options[key]
15
- }
15
+ end
16
16
 
17
17
  emoticon = (options[:success] ? ':smile:' : ':rage:')
18
- message = "#{emoticon} #{options[:message].to_s}"
18
+ message = "#{emoticon} #{options[:message]}"
19
19
 
20
20
  note_path = File.expand_path(options[:note_path]) if options[:note_path]
21
21
  if note_path and File.exist?(note_path)
@@ -23,19 +23,19 @@ module Fastlane
23
23
  message += "\n\n```\n#{contents}\n```"
24
24
  end
25
25
 
26
- topicId = options[:topicId]
26
+ topic_id = options[:topic_id]
27
27
  typetalk_token = options[:typetalk_token]
28
28
 
29
- self.post_to_typetalk(message, topicId, typetalk_token)
29
+ self.post_to_typetalk(message, topic_id, typetalk_token)
30
30
 
31
31
  Helper.log.info 'Successfully sent Typetalk notification'.green
32
32
  end
33
33
 
34
- def self.post_to_typetalk(message, topicId, typetalk_token)
34
+ def self.post_to_typetalk(message, topic_id, typetalk_token)
35
35
  require 'net/http'
36
36
  require 'uri'
37
37
 
38
- uri = URI.parse("https://typetalk.in/api/v1/topics/#{topicId}")
38
+ uri = URI.parse("https://typetalk.in/api/v1/topics/#{topic_id}")
39
39
  response = Net::HTTP.post_form(uri, {'message' => message,
40
40
  'typetalkToken' => typetalk_token})
41
41
 
@@ -44,10 +44,10 @@ module Fastlane
44
44
 
45
45
  def self.check_response(response)
46
46
  case response.code.to_i
47
- when 200, 204
48
- true
49
- else
50
- raise "Could not sent Typetalk notification".red
47
+ when 200, 204
48
+ true
49
+ else
50
+ raise "Could not sent Typetalk notification".red
51
51
  end
52
52
  end
53
53
 
@@ -59,7 +59,7 @@ module Fastlane
59
59
  [
60
60
  ['message', 'The message to post'],
61
61
  ['note_path', 'Path to an additional note'],
62
- ['topicId', 'Typetalk topic id'],
62
+ ['topic_id', 'Typetalk topic id'],
63
63
  ['success', 'Successful build?'],
64
64
  ['typetalk_token', 'typetalk token']
65
65
  ]
@@ -12,10 +12,10 @@ module Fastlane
12
12
  Helper.log.info "New App Group Identifiers: #{params[:app_group_identifiers]}"
13
13
 
14
14
  entitlements_file = params[:entitlements_file]
15
- raise "Could not find entitlements file at path '#{entitlements_file}'".red unless File.exists?(entitlements_file)
15
+ raise "Could not find entitlements file at path '#{entitlements_file}'".red unless File.exist?(entitlements_file)
16
16
 
17
17
  # parse entitlements
18
- result = Plist::parse_xml(entitlements_file)
18
+ result = Plist.parse_xml(entitlements_file)
19
19
  raise "Entitlements file at '#{entitlements_file}' cannot be parsed.".red unless result
20
20
 
21
21
  # get app group field
@@ -39,20 +39,20 @@ module Fastlane
39
39
 
40
40
  def self.available_options
41
41
  [
42
- FastlaneCore::ConfigItem.new(key: :entitlements_file,
43
- env_name: "FL_UPDATE_APP_GROUP_IDENTIFIER_ENTITLEMENTS_FILE_PATH", # The name of the environment variable
44
- description: "The path to the entitlement file which contains the app group identifiers", # a short description of this parameter
45
- verify_block: Proc.new do |value|
46
- raise "Please pass a path to an entitlements file. ".red unless value.include? ".entitlements"
47
- raise "Could not find entitlements file".red if (not File.exists?(value) and not Helper.is_test?)
48
- end),
49
- FastlaneCore::ConfigItem.new(key: :app_group_identifiers,
50
- env_name: "FL_UPDATE_APP_GROUP_IDENTIFIER_APP_GROUP_IDENTIFIERS",
51
- description: "An Array of unique identifiers for the app groups. Eg. ['group.com.test.testapp']",
52
- is_string: false,
53
- verify_block: Proc.new do |value|
54
- raise "The parameter app_group_identifiers need to be an Array.".red unless value.is_a? Array
55
- end)
42
+ FastlaneCore::ConfigItem.new(key: :entitlements_file,
43
+ env_name: "FL_UPDATE_APP_GROUP_IDENTIFIER_ENTITLEMENTS_FILE_PATH", # The name of the environment variable
44
+ description: "The path to the entitlement file which contains the app group identifiers", # a short description of this parameter
45
+ verify_block: proc do |value|
46
+ raise "Please pass a path to an entitlements file. ".red unless value.include? ".entitlements"
47
+ raise "Could not find entitlements file".red if !File.exist?(value) and !Helper.is_test?
48
+ end),
49
+ FastlaneCore::ConfigItem.new(key: :app_group_identifiers,
50
+ env_name: "FL_UPDATE_APP_GROUP_IDENTIFIER_APP_GROUP_IDENTIFIERS",
51
+ description: "An Array of unique identifiers for the app groups. Eg. ['group.com.test.testapp']",
52
+ is_string: false,
53
+ verify_block: proc do |value|
54
+ raise "The parameter app_group_identifiers need to be an Array.".red unless value.kind_of? Array
55
+ end)
56
56
  ]
57
57
  end
58
58
 
@@ -69,4 +69,4 @@ module Fastlane
69
69
  end
70
70
  end
71
71
  end
72
- end
72
+ end
@@ -1,9 +1,10 @@
1
+ # rubocop:disable Metrics/AbcSize
1
2
  require 'rubygems/spec_fetcher'
2
3
  require 'rubygems/command_manager'
3
4
 
4
5
  module Fastlane
5
6
  module Actions
6
- # Makes sure fastlane tools are up-to-date when running fastlane
7
+ # Makes sure fastlane tools are up-to-date when running fastlane
7
8
  class UpdateFastlaneAction < Action
8
9
 
9
10
  ALL_TOOLS = [
@@ -56,7 +57,7 @@ module Fastlane
56
57
  # suppress updater output - very noisy
57
58
  Gem::DefaultUserInteraction.ui = Gem::SilentUI.new
58
59
 
59
- update_needed.each do |tool_info|
60
+ update_needed.each do |tool_info|
60
61
  tool = tool_info[0]
61
62
  local_version = Gem::Version.new(highest_versions[tool].version)
62
63
  latest_version = FastlaneCore::UpdateChecker.fetch_latest(tool)
@@ -64,7 +65,7 @@ module Fastlane
64
65
 
65
66
  # Approximate_recommendation will create a string like "~> 0.10" from a version 0.10.0, e.g. one that is valid for versions >= 0.10 and <1.0
66
67
  updater.update_gem tool, Gem::Requirement.new(local_version.approximate_recommendation)
67
-
68
+
68
69
  Helper.log.info "Finished updating #{tool}"
69
70
  end
70
71
 
@@ -72,21 +73,21 @@ module Fastlane
72
73
  updated_tool.version > highest_versions[updated_tool.name].version
73
74
  end
74
75
 
75
- unless all_updated_tools.empty?
76
+ if all_updated_tools.empty?
77
+ Helper.log.info "All fastlane tools are up-to-date!"
78
+ else
76
79
  Helper.log.info "Cleaning up old versions..."
77
- cleaner.options[:args] = all_updated_tools.map {|t| t.name }
80
+ cleaner.options[:args] = all_updated_tools.map(&:name)
78
81
  cleaner.execute
79
82
  Helper.log.info "fastlane.tools succesfully updated! I will now restart myself... 😴"
80
-
83
+
81
84
  # Set no_update to true so we don't try to update again
82
85
  exec "FL_NO_UPDATE=true #{$PROGRAM_NAME} #{ARGV.join ' '}"
83
- else
84
- Helper.log.info "All fastlane tools are up-to-date!"
85
86
  end
86
87
  end
87
88
 
88
89
  def self.all_installed_tools
89
- Gem::Specification.select { |s| ALL_TOOLS.include? s.name }.map {|s| s.name}.uniq
90
+ Gem::Specification.select { |s| ALL_TOOLS.include? s.name }.map(&:name).uniq
90
91
  end
91
92
 
92
93
  def self.description
@@ -99,11 +100,11 @@ module Fastlane
99
100
  env_name: "FL_TOOLS_TO_UPDATE",
100
101
  description: "Comma separated list of fastlane tools to update (e.g. fastlane,deliver,sigh). If not specified, all currently installed fastlane-tools will be updated",
101
102
  optional: true),
102
- FastlaneCore::ConfigItem.new(key: :no_update,
103
- env_name: "FL_NO_UPDATE",
104
- description: "Don't update during this run. Defaults to false",
105
- is_string: false,
106
- default_value: false),
103
+ FastlaneCore::ConfigItem.new(key: :no_update,
104
+ env_name: "FL_NO_UPDATE",
105
+ description: "Don't update during this run. Defaults to false",
106
+ is_string: false,
107
+ default_value: false)
107
108
  ]
108
109
  end
109
110
 
@@ -117,3 +118,4 @@ module Fastlane
117
118
  end
118
119
  end
119
120
  end
121
+ # rubocop:enable Metrics/AbcSize