fastlane 2.179.0 → 2.183.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +82 -82
  3. data/cert/lib/cert/commands_generator.rb +2 -1
  4. data/deliver/lib/assets/summary.html.erb +10 -10
  5. data/deliver/lib/deliver/commands_generator.rb +2 -1
  6. data/deliver/lib/deliver/languages.rb +1 -1
  7. data/deliver/lib/deliver/options.rb +2 -2
  8. data/deliver/lib/deliver/submit_for_review.rb +3 -3
  9. data/deliver/lib/deliver/upload_metadata.rb +1 -1
  10. data/fastlane/lib/fastlane/actions/actions_helper.rb +2 -2
  11. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +1 -1
  12. data/fastlane/lib/fastlane/actions/backup_xcarchive.rb +1 -1
  13. data/fastlane/lib/fastlane/actions/clipboard.rb +3 -6
  14. data/fastlane/lib/fastlane/actions/danger.rb +7 -1
  15. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +1 -1
  16. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +18 -1
  17. data/fastlane/lib/fastlane/actions/ensure_env_vars.rb +2 -6
  18. data/fastlane/lib/fastlane/actions/get_managed_play_store_publishing_rights.rb +3 -1
  19. data/fastlane/lib/fastlane/actions/git_branch.rb +1 -1
  20. data/fastlane/lib/fastlane/actions/git_commit.rb +3 -1
  21. data/fastlane/lib/fastlane/actions/git_pull.rb +4 -10
  22. data/fastlane/lib/fastlane/actions/git_submodule_update.rb +16 -8
  23. data/fastlane/lib/fastlane/actions/hipchat.rb +2 -1
  24. data/fastlane/lib/fastlane/actions/import_from_git.rb +5 -5
  25. data/fastlane/lib/fastlane/actions/jira.rb +61 -14
  26. data/fastlane/lib/fastlane/actions/notarize.rb +98 -51
  27. data/fastlane/lib/fastlane/actions/notification.rb +1 -1
  28. data/fastlane/lib/fastlane/actions/slack.rb +155 -133
  29. data/fastlane/lib/fastlane/actions/sourcedocs.rb +164 -0
  30. data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +4 -2
  31. data/fastlane/lib/fastlane/actions/xcodebuild.rb +5 -5
  32. data/fastlane/lib/fastlane/cli_tools_distributor.rb +1 -1
  33. data/fastlane/lib/fastlane/commands_generator.rb +2 -1
  34. data/fastlane/lib/fastlane/fast_file.rb +10 -2
  35. data/fastlane/lib/fastlane/fastlane_require.rb +7 -1
  36. data/fastlane/lib/fastlane/helper/git_helper.rb +9 -1
  37. data/fastlane/lib/fastlane/lane_manager.rb +3 -2
  38. data/fastlane/lib/fastlane/notification/slack.rb +56 -0
  39. data/fastlane/lib/fastlane/plugins/plugin_info.rb +2 -2
  40. data/fastlane/lib/fastlane/plugins/template/%gem_name%.gemspec.erb +7 -6
  41. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +30 -35
  42. data/fastlane/lib/fastlane/plugins/template/spec/spec_helper.rb.erb +1 -1
  43. data/fastlane/lib/fastlane/setup/setup.rb +23 -10
  44. data/fastlane/lib/fastlane/swift_fastlane_function.rb +35 -14
  45. data/fastlane/lib/fastlane/swift_runner_upgrader.rb +2 -0
  46. data/fastlane/lib/fastlane/version.rb +2 -2
  47. data/fastlane/swift/Deliverfile.swift +1 -1
  48. data/fastlane/swift/DeliverfileProtocol.swift +1 -1
  49. data/fastlane/swift/Fastlane.swift +6672 -3787
  50. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj +4 -0
  51. data/fastlane/swift/Gymfile.swift +1 -1
  52. data/fastlane/swift/GymfileProtocol.swift +1 -1
  53. data/fastlane/swift/LaneFileProtocol.swift +9 -3
  54. data/fastlane/swift/Matchfile.swift +1 -1
  55. data/fastlane/swift/MatchfileProtocol.swift +1 -1
  56. data/fastlane/swift/OptionalConfigValue.swift +131 -0
  57. data/fastlane/swift/Precheckfile.swift +1 -1
  58. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  59. data/fastlane/swift/RubyCommand.swift +1 -1
  60. data/fastlane/swift/Scanfile.swift +1 -1
  61. data/fastlane/swift/ScanfileProtocol.swift +5 -1
  62. data/fastlane/swift/Screengrabfile.swift +1 -1
  63. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  64. data/fastlane/swift/Snapshotfile.swift +1 -1
  65. data/fastlane/swift/SnapshotfileProtocol.swift +5 -1
  66. data/fastlane/swift/SocketClient.swift +2 -1
  67. data/fastlane/swift/SocketResponse.swift +4 -2
  68. data/fastlane/swift/formatting/Brewfile.lock.json +18 -16
  69. data/fastlane/swift/upgrade_manifest.json +1 -1
  70. data/fastlane_core/lib/fastlane_core.rb +22 -21
  71. data/fastlane_core/lib/fastlane_core/build_watcher.rb +65 -11
  72. data/fastlane_core/lib/fastlane_core/clipboard.rb +20 -0
  73. data/fastlane_core/lib/fastlane_core/device_manager.rb +1 -1
  74. data/fastlane_core/lib/fastlane_core/helper.rb +4 -4
  75. data/fastlane_core/lib/fastlane_core/languages.rb +2 -2
  76. data/fastlane_core/lib/fastlane_core/queue_worker.rb +2 -2
  77. data/fastlane_core/lib/fastlane_core/swag.rb +1 -1
  78. data/fastlane_core/lib/fastlane_core/ui/help.erb +35 -0
  79. data/fastlane_core/lib/fastlane_core/ui/help_formatter.rb +16 -0
  80. data/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb +16 -2
  81. data/frameit/lib/frameit/commands_generator.rb +2 -1
  82. data/frameit/lib/frameit/config_parser.rb +2 -2
  83. data/frameit/lib/frameit/frame_downloader.rb +2 -1
  84. data/gym/lib/gym/code_signing_mapping.rb +2 -2
  85. data/gym/lib/gym/commands_generator.rb +2 -1
  86. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +6 -5
  87. data/gym/lib/gym/runner.rb +5 -1
  88. data/match/lib/match/change_password.rb +1 -1
  89. data/match/lib/match/commands_generator.rb +2 -1
  90. data/pem/lib/pem/commands_generator.rb +2 -1
  91. data/pilot/lib/pilot/build_manager.rb +3 -3
  92. data/pilot/lib/pilot/commands_generator.rb +2 -1
  93. data/pilot/lib/pilot/options.rb +2 -2
  94. data/pilot/lib/pilot/tester_exporter.rb +0 -1
  95. data/pilot/lib/pilot/tester_manager.rb +0 -1
  96. data/precheck/lib/precheck/commands_generator.rb +2 -1
  97. data/produce/lib/produce/commands_generator.rb +2 -1
  98. data/scan/lib/scan/commands_generator.rb +2 -1
  99. data/scan/lib/scan/options.rb +10 -5
  100. data/scan/lib/scan/runner.rb +54 -1
  101. data/scan/lib/scan/test_command_generator.rb +10 -8
  102. data/screengrab/lib/screengrab/commands_generator.rb +2 -1
  103. data/sigh/lib/sigh/commands_generator.rb +2 -1
  104. data/snapshot/lib/assets/SnapfileTemplate +1 -1
  105. data/snapshot/lib/assets/SnapshotHelper.swift +1 -1
  106. data/snapshot/lib/snapshot/commands_generator.rb +3 -1
  107. data/snapshot/lib/snapshot/options.rb +5 -0
  108. data/snapshot/lib/snapshot/reports_generator.rb +4 -0
  109. data/snapshot/lib/snapshot/simulator_launchers/launcher_configuration.rb +2 -0
  110. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher.rb +1 -1
  111. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +8 -4
  112. data/spaceship/README.md +2 -12
  113. data/spaceship/lib/spaceship/base.rb +2 -2
  114. data/spaceship/lib/spaceship/commands_generator.rb +4 -2
  115. data/spaceship/lib/spaceship/connect_api/model.rb +1 -1
  116. data/{gym/lib/gym/.runner.rb.swp → spaceship/lib/spaceship/connect_api/models/.app.rb.swp} +0 -0
  117. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +1 -1
  118. data/spaceship/lib/spaceship/connect_api/models/profile.rb +6 -0
  119. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +6 -2
  120. data/spaceship/lib/spaceship/connect_api/token.rb +7 -1
  121. data/spaceship/lib/spaceship/spaceauth_runner.rb +19 -9
  122. data/spaceship/lib/spaceship/tunes/members.rb +1 -1
  123. data/spaceship/lib/spaceship/ui.rb +2 -2
  124. data/supply/lib/supply/client.rb +3 -1
  125. data/supply/lib/supply/commands_generator.rb +2 -1
  126. data/supply/lib/supply/options.rb +2 -2
  127. data/supply/lib/supply/uploader.rb +1 -0
  128. metadata +75 -86
  129. data/pilot/lib/pilot/tester_util.rb +0 -0
@@ -13,7 +13,7 @@ module Fastlane
13
13
  app_icon: :appIcon,
14
14
  content_image: :contentImage
15
15
  }
16
- options = Hash[options.map { |k, v| [option_map.fetch(k, k), v] }]
16
+ options = options.transform_keys { |k| option_map.fetch(k, k) }
17
17
  TerminalNotifier.notify(message, options)
18
18
  end
19
19
 
@@ -1,70 +1,178 @@
1
+ require 'fastlane/notification/slack'
2
+
1
3
  # rubocop:disable Style/CaseEquality
2
4
  # rubocop:disable Style/MultilineTernaryOperator
3
5
  # rubocop:disable Style/NestedTernaryOperator
4
6
  module Fastlane
5
7
  module Actions
6
8
  class SlackAction < Action
7
- def self.is_supported?(platform)
8
- true
9
- end
9
+ class Runner
10
+ def initialize(slack_url)
11
+ @notifier = Fastlane::Notification::Slack.new(slack_url)
12
+ end
10
13
 
11
- # As there is a text limit in the notifications, we are
12
- # usually interested in the last part of the message
13
- # e.g. for tests
14
- def self.trim_message(message)
15
- # We want the last 7000 characters, instead of the first 7000, as the error is at the bottom
16
- start_index = [message.length - 7000, 0].max
17
- message = message[start_index..-1]
18
- # We want line breaks to be shown on slack output so we replace
19
- # input non-interpreted line break with interpreted line break
20
- message.gsub('\n', "\n")
21
- end
14
+ def run(options)
15
+ options[:message] = self.class.trim_message(options[:message].to_s || '')
16
+ options[:message] = Fastlane::Notification::Slack::LinkConverter.convert(options[:message])
22
17
 
23
- def self.run(options)
24
- require 'slack-notifier'
18
+ options[:pretext] = options[:pretext].gsub('\n', "\n") unless options[:pretext].nil?
25
19
 
26
- options[:message] = self.trim_message(options[:message].to_s || '')
27
- options[:message] = Slack::Notifier::Util::LinkFormatter.format(options[:message])
20
+ if options[:channel].to_s.length > 0
21
+ channel = options[:channel]
22
+ channel = ('#' + options[:channel]) unless ['#', '@'].include?(channel[0]) # send message to channel by default
23
+ end
28
24
 
29
- options[:pretext] = options[:pretext].gsub('\n', "\n") unless options[:pretext].nil?
25
+ username = options[:use_webhook_configured_username_and_icon] ? nil : options[:username]
30
26
 
31
- if options[:channel].to_s.length > 0
32
- channel = options[:channel]
33
- channel = ('#' + options[:channel]) unless ['#', '@'].include?(channel[0]) # send message to channel by default
27
+ slack_attachment = self.class.generate_slack_attachments(options)
28
+ link_names = options[:link_names]
29
+ icon_url = options[:use_webhook_configured_username_and_icon] ? nil : options[:icon_url]
30
+
31
+ post_message(
32
+ channel: channel,
33
+ username: username,
34
+ attachments: [slack_attachment],
35
+ link_names: link_names,
36
+ icon_url: icon_url,
37
+ fail_on_error: options[:fail_on_error]
38
+ )
34
39
  end
35
40
 
36
- username = options[:use_webhook_configured_username_and_icon] ? nil : options[:username]
41
+ def post_message(channel:, username:, attachments:, link_names:, icon_url:, fail_on_error:)
42
+ @notifier.post_to_legacy_incoming_webhook(
43
+ channel: channel,
44
+ username: username,
45
+ link_names: link_names,
46
+ icon_url: icon_url,
47
+ attachments: attachments
48
+ )
49
+ UI.success('Successfully sent Slack notification')
50
+ rescue => error
51
+ UI.error("Exception: #{error}")
52
+ message = "Error pushing Slack message, maybe the integration has no permission to post on this channel? Try removing the channel parameter in your Fastfile, this is usually caused by a misspelled or changed group/channel name or an expired SLACK_URL"
53
+ if fail_on_error
54
+ UI.user_error!(message)
55
+ else
56
+ UI.error(message)
57
+ end
58
+ end
37
59
 
38
- notifier = Slack::Notifier.new(options[:slack_url], channel: channel, username: username)
60
+ # As there is a text limit in the notifications, we are
61
+ # usually interested in the last part of the message
62
+ # e.g. for tests
63
+ def self.trim_message(message)
64
+ # We want the last 7000 characters, instead of the first 7000, as the error is at the bottom
65
+ start_index = [message.length - 7000, 0].max
66
+ message = message[start_index..-1]
67
+ # We want line breaks to be shown on slack output so we replace
68
+ # input non-interpreted line break with interpreted line break
69
+ message.gsub('\n', "\n")
70
+ end
39
71
 
40
- link_names = options[:link_names]
72
+ def self.generate_slack_attachments(options)
73
+ color = (options[:success] ? 'good' : 'danger')
74
+ should_add_payload = ->(payload_name) { options[:default_payloads].map(&:to_sym).include?(payload_name.to_sym) }
41
75
 
42
- icon_url = options[:use_webhook_configured_username_and_icon] ? nil : options[:icon_url]
76
+ slack_attachment = {
77
+ fallback: options[:message],
78
+ text: options[:message],
79
+ pretext: options[:pretext],
80
+ color: color,
81
+ mrkdwn_in: ["pretext", "text", "fields", "message"],
82
+ fields: []
83
+ }
43
84
 
44
- slack_attachment = generate_slack_attachments(options)
85
+ # custom user payloads
86
+ slack_attachment[:fields] += options[:payload].map do |k, v|
87
+ {
88
+ title: k.to_s,
89
+ value: Fastlane::Notification::Slack::LinkConverter.convert(v.to_s),
90
+ short: false
91
+ }
92
+ end
45
93
 
46
- return [notifier, slack_attachment] if Helper.test? # tests will verify the slack attachments and other properties
94
+ # Add the lane to the Slack message
95
+ # This might be nil, if slack is called as "one-off" action
96
+ if should_add_payload[:lane] && Actions.lane_context[Actions::SharedValues::LANE_NAME]
97
+ slack_attachment[:fields] << {
98
+ title: 'Lane',
99
+ value: Actions.lane_context[Actions::SharedValues::LANE_NAME],
100
+ short: true
101
+ }
102
+ end
47
103
 
48
- begin
49
- results = notifier.ping('', link_names: link_names, icon_url: icon_url, attachments: [slack_attachment])
50
- rescue => exception
51
- UI.error("Exception: #{exception}")
52
- ensure
53
- result = results.first if results
54
- if !result.nil? && result.code.to_i == 200
55
- UI.success('Successfully sent Slack notification')
56
- else
57
- UI.verbose(result) unless result.nil?
58
- message = "Error pushing Slack message, maybe the integration has no permission to post on this channel? Try removing the channel parameter in your Fastfile, this is usually caused by a misspelled or changed group/channel name or an expired SLACK_URL"
59
- if options[:fail_on_error]
60
- UI.user_error!(message)
104
+ # test_result
105
+ if should_add_payload[:test_result]
106
+ slack_attachment[:fields] << {
107
+ title: 'Result',
108
+ value: (options[:success] ? 'Success' : 'Error'),
109
+ short: true
110
+ }
111
+ end
112
+
113
+ # git branch
114
+ if Actions.git_branch && should_add_payload[:git_branch]
115
+ slack_attachment[:fields] << {
116
+ title: 'Git Branch',
117
+ value: Actions.git_branch,
118
+ short: true
119
+ }
120
+ end
121
+
122
+ # git_author
123
+ if Actions.git_author_email && should_add_payload[:git_author]
124
+ if FastlaneCore::Env.truthy?('FASTLANE_SLACK_HIDE_AUTHOR_ON_SUCCESS') && options[:success]
125
+ # We only show the git author if the build failed
61
126
  else
62
- UI.error(message)
127
+ slack_attachment[:fields] << {
128
+ title: 'Git Author',
129
+ value: Actions.git_author_email,
130
+ short: true
131
+ }
63
132
  end
64
133
  end
134
+
135
+ # last_git_commit
136
+ if Actions.last_git_commit_message && should_add_payload[:last_git_commit]
137
+ slack_attachment[:fields] << {
138
+ title: 'Git Commit',
139
+ value: Actions.last_git_commit_message,
140
+ short: false
141
+ }
142
+ end
143
+
144
+ # last_git_commit_hash
145
+ if Actions.last_git_commit_hash(true) && should_add_payload[:last_git_commit_hash]
146
+ slack_attachment[:fields] << {
147
+ title: 'Git Commit Hash',
148
+ value: Actions.last_git_commit_hash(short: true),
149
+ short: false
150
+ }
151
+ end
152
+
153
+ # merge additional properties
154
+ deep_merge(slack_attachment, options[:attachment_properties])
155
+ end
156
+
157
+ # Adapted from https://stackoverflow.com/a/30225093/158525
158
+ def self.deep_merge(a, b)
159
+ merger = proc do |key, v1, v2|
160
+ Hash === v1 && Hash === v2 ?
161
+ v1.merge(v2, &merger) : Array === v1 && Array === v2 ?
162
+ v1 | v2 : [:undefined, nil, :nil].include?(v2) ? v1 : v2
163
+ end
164
+ a.merge(b, &merger)
65
165
  end
66
166
  end
67
167
 
168
+ def self.is_supported?(platform)
169
+ true
170
+ end
171
+
172
+ def self.run(options)
173
+ Runner.new(options[:slack_url]).run(options)
174
+ end
175
+
68
176
  def self.description
69
177
  "Send a success/error message to your [Slack](https://slack.com) group"
70
178
  end
@@ -185,99 +293,13 @@ module Fastlane
185
293
  # @!group Helper
186
294
  #####################################################
187
295
 
188
- def self.generate_slack_attachments(options)
189
- color = (options[:success] ? 'good' : 'danger')
190
- should_add_payload = ->(payload_name) { options[:default_payloads].map(&:to_sym).include?(payload_name.to_sym) }
191
-
192
- slack_attachment = {
193
- fallback: options[:message],
194
- text: options[:message],
195
- pretext: options[:pretext],
196
- color: color,
197
- mrkdwn_in: ["pretext", "text", "fields", "message"],
198
- fields: []
199
- }
200
-
201
- # custom user payloads
202
- slack_attachment[:fields] += options[:payload].map do |k, v|
203
- {
204
- title: k.to_s,
205
- value: Slack::Notifier::Util::LinkFormatter.format(v.to_s),
206
- short: false
207
- }
208
- end
209
-
210
- # Add the lane to the Slack message
211
- # This might be nil, if slack is called as "one-off" action
212
- if should_add_payload[:lane] && Actions.lane_context[Actions::SharedValues::LANE_NAME]
213
- slack_attachment[:fields] << {
214
- title: 'Lane',
215
- value: Actions.lane_context[Actions::SharedValues::LANE_NAME],
216
- short: true
217
- }
218
- end
219
-
220
- # test_result
221
- if should_add_payload[:test_result]
222
- slack_attachment[:fields] << {
223
- title: 'Result',
224
- value: (options[:success] ? 'Success' : 'Error'),
225
- short: true
226
- }
227
- end
228
-
229
- # git branch
230
- if Actions.git_branch && should_add_payload[:git_branch]
231
- slack_attachment[:fields] << {
232
- title: 'Git Branch',
233
- value: Actions.git_branch,
234
- short: true
235
- }
236
- end
237
-
238
- # git_author
239
- if Actions.git_author_email && should_add_payload[:git_author]
240
- if FastlaneCore::Env.truthy?('FASTLANE_SLACK_HIDE_AUTHOR_ON_SUCCESS') && options[:success]
241
- # We only show the git author if the build failed
242
- else
243
- slack_attachment[:fields] << {
244
- title: 'Git Author',
245
- value: Actions.git_author_email,
246
- short: true
247
- }
248
- end
249
- end
250
-
251
- # last_git_commit
252
- if Actions.last_git_commit_message && should_add_payload[:last_git_commit]
253
- slack_attachment[:fields] << {
254
- title: 'Git Commit',
255
- value: Actions.last_git_commit_message,
256
- short: false
257
- }
258
- end
259
-
260
- # last_git_commit_hash
261
- if Actions.last_git_commit_hash(true) && should_add_payload[:last_git_commit_hash]
262
- slack_attachment[:fields] << {
263
- title: 'Git Commit Hash',
264
- value: Actions.last_git_commit_hash(short: true),
265
- short: false
266
- }
267
- end
268
-
269
- # merge additional properties
270
- deep_merge(slack_attachment, options[:attachment_properties])
296
+ def self.trim_message(message)
297
+ Runner.trim_message(message)
271
298
  end
272
299
 
273
- # Adapted from https://stackoverflow.com/a/30225093/158525
274
- def self.deep_merge(a, b)
275
- merger = proc do |key, v1, v2|
276
- Hash === v1 && Hash === v2 ?
277
- v1.merge(v2, &merger) : Array === v1 && Array === v2 ?
278
- v1 | v2 : [:undefined, nil, :nil].include?(v2) ? v1 : v2
279
- end
280
- a.merge(b, &merger)
300
+ def self.generate_slack_attachments(options)
301
+ UI.deprecated('`Fastlane::Actions::Slack.generate_slack_attachments` is subject to be removed as Slack recommends migrating `attachments` to Block Kit. fastlane will also follow the same direction.')
302
+ Runner.generate_slack_attachments(options)
281
303
  end
282
304
  end
283
305
  end
@@ -0,0 +1,164 @@
1
+ module Fastlane
2
+ module Actions
3
+ class SourcedocsAction < Action
4
+ def self.run(params)
5
+ UI.user_error!("You have to install sourcedocs using `brew install sourcedocs`") if `which sourcedocs`.to_s.length == 0 && !Helper.test?
6
+
7
+ command = "sourcedocs generate"
8
+ command << " --all-modules" if params[:all_modules]
9
+ command << " --spm-module #{params[:spm_module]}" unless params[:spm_module].nil?
10
+ command << " --module-name #{params[:module_name]}" unless params[:module_name].nil?
11
+ command << " --link-beginning #{params[:link_beginning]}" unless params[:link_beginning].nil?
12
+ command << " --link-ending #{params[:link_ending]}" unless params[:link_ending].nil?
13
+ command << " --output-folder #{params[:output_folder]}" unless params[:output_folder].nil?
14
+ command << " --min-acl #{params[:min_acl]}" unless params[:min_acl].nil?
15
+ command << " --module-name-path" if params[:module_name_path]
16
+ command << " --clean" if params[:clean]
17
+ command << " --collapsible" if params[:collapsible]
18
+ command << " --table-of-contents" if params[:table_of_contents]
19
+ command << " --reproducible-docs" if params[:reproducible]
20
+ unless params[:scheme].nil?
21
+ command << " -- -scheme #{params[:scheme]}"
22
+ command << " -sdk #{params[:sdk_platform]}" unless params[:sdk_platform].nil?
23
+ end
24
+ Actions.sh(command)
25
+ end
26
+
27
+ #####################################################
28
+ # @!group Documentation
29
+ #####################################################
30
+
31
+ def self.description
32
+ "Generate docs using SourceDocs"
33
+ end
34
+
35
+ def self.available_options
36
+ [
37
+ FastlaneCore::ConfigItem.new(
38
+ key: :all_modules,
39
+ env_name: 'FL_SOURCEDOCS_OUTPUT_ALL_MODULES',
40
+ description: 'Generate documentation for all modules in a Swift package',
41
+ type: Boolean,
42
+ optional: true
43
+ ),
44
+ FastlaneCore::ConfigItem.new(
45
+ key: :spm_module,
46
+ env_name: 'FL_SOURCEDOCS_SPM_MODULE',
47
+ description: 'Generate documentation for Swift Package Manager module',
48
+ type: String,
49
+ optional: true
50
+ ),
51
+ FastlaneCore::ConfigItem.new(
52
+ key: :module_name,
53
+ env_name: 'FL_SOURCEDOCS_MODULE_NAME',
54
+ description: 'Generate documentation for a Swift module',
55
+ type: String,
56
+ optional: true
57
+ ),
58
+ FastlaneCore::ConfigItem.new(
59
+ key: :link_beginning,
60
+ env_name: 'FL_SOURCEDOCS_LINK_BEGINNING',
61
+ description: 'The text to begin links with',
62
+ type: String,
63
+ optional: true
64
+ ),
65
+ FastlaneCore::ConfigItem.new(
66
+ key: :link_ending,
67
+ env_name: 'FL_SOURCEDOCS_LINK_ENDING',
68
+ description: 'The text to end links with (default: .md)',
69
+ type: String,
70
+ optional: true
71
+ ),
72
+ FastlaneCore::ConfigItem.new(
73
+ key: :output_folder,
74
+ env_name: 'FL_SOURCEDOCS_OUTPUT_FOLDER',
75
+ description: 'Output directory to clean (default: Documentation/Reference)',
76
+ type: String,
77
+ optional: false
78
+ ),
79
+ FastlaneCore::ConfigItem.new(
80
+ key: :min_acl,
81
+ env_name: 'FL_SOURCEDOCS_MIN_ACL',
82
+ description: 'Access level to include in documentation [private, fileprivate, internal, public, open] (default: public)',
83
+ type: String,
84
+ optional: true
85
+ ),
86
+ FastlaneCore::ConfigItem.new(
87
+ key: :module_name_path,
88
+ env_name: 'FL_SOURCEDOCS_MODULE_NAME_PATH',
89
+ description: 'Include the module name as part of the output folder path',
90
+ type: Boolean,
91
+ optional: true
92
+ ),
93
+ FastlaneCore::ConfigItem.new(
94
+ key: :clean,
95
+ env_name: 'FL_SOURCEDOCS_CLEAN',
96
+ description: 'Delete output folder before generating documentation',
97
+ type: Boolean,
98
+ optional: true
99
+ ),
100
+ FastlaneCore::ConfigItem.new(
101
+ key: :collapsible,
102
+ env_name: 'FL_SOURCEDOCS_COLLAPSIBLE',
103
+ description: 'Put methods, properties and enum cases inside collapsible blocks',
104
+ type: Boolean,
105
+ optional: true
106
+ ),
107
+ FastlaneCore::ConfigItem.new(
108
+ key: :table_of_contents,
109
+ env_name: 'FL_SOURCEDOCS_TABLE_OF_CONTENT',
110
+ description: 'Generate a table of contents with properties and methods for each type',
111
+ type: Boolean,
112
+ optional: true
113
+ ),
114
+ FastlaneCore::ConfigItem.new(
115
+ key: :reproducible,
116
+ env_name: 'FL_SOURCEDOCS_REPRODUCIBLE',
117
+ description: 'Generate documentation that is reproducible: only depends on the sources',
118
+ type: Boolean,
119
+ optional: true
120
+ ),
121
+ FastlaneCore::ConfigItem.new(
122
+ key: :scheme,
123
+ env_name: 'FL_SOURCEDOCS_SCHEME',
124
+ description: 'Create documentation for specific scheme',
125
+ type: String,
126
+ optional: true
127
+ ),
128
+ FastlaneCore::ConfigItem.new(
129
+ key: :sdk_platform,
130
+ env_name: 'FL_SOURCEDOCS_SDK_PlATFORM',
131
+ description: 'Create documentation for specific sdk platform',
132
+ type: String,
133
+ optional: true
134
+ )
135
+ ]
136
+ end
137
+
138
+ def self.output
139
+ end
140
+
141
+ def self.return_value
142
+ end
143
+
144
+ def self.authors
145
+ ["Kukurijek"]
146
+ end
147
+
148
+ def self.is_supported?(platform)
149
+ [:ios, :mac].include?(platform)
150
+ end
151
+
152
+ def self.example_code
153
+ [
154
+ "sourcedocs(output_folder: 'docs')",
155
+ "sourcedocs(output_folder: 'docs', clean: true, reproducible: true, scheme: 'MyApp')"
156
+ ]
157
+ end
158
+
159
+ def self.category
160
+ :documentation
161
+ end
162
+ end
163
+ end
164
+ end