fastlane 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/bin/fastlane +25 -7
  3. data/lib/assets/custom_action_template.rb +35 -2
  4. data/lib/fastlane.rb +1 -3
  5. data/lib/fastlane/action.rb +37 -0
  6. data/lib/fastlane/actions/{README → README.md} +1 -1
  7. data/lib/fastlane/actions/add_git_tag.rb +18 -1
  8. data/lib/fastlane/actions/cert.rb +38 -18
  9. data/lib/fastlane/actions/clean_build_artifacts.rb +9 -1
  10. data/lib/fastlane/actions/commit_version_bump.rb +16 -1
  11. data/lib/fastlane/actions/crashlytics.rb +21 -1
  12. data/lib/fastlane/actions/deliver.rb +31 -13
  13. data/lib/fastlane/actions/deploygate.rb +26 -1
  14. data/lib/fastlane/actions/ensure_git_status_clean.rb +15 -1
  15. data/lib/fastlane/actions/fastlane_version.rb +9 -1
  16. data/lib/fastlane/actions/frameit.rb +20 -10
  17. data/lib/fastlane/actions/gcovr.rb +35 -1
  18. data/lib/fastlane/actions/hipchat.rb +19 -1
  19. data/lib/fastlane/actions/hockey.rb +27 -1
  20. data/lib/fastlane/actions/increment_build_number.rb +22 -1
  21. data/lib/fastlane/actions/increment_version_number.rb +30 -1
  22. data/lib/fastlane/actions/install_carthage.rb +9 -1
  23. data/lib/fastlane/actions/install_cocapods.rb +5 -1
  24. data/lib/fastlane/actions/ipa.rb +52 -13
  25. data/lib/fastlane/actions/notify.rb +9 -1
  26. data/lib/fastlane/actions/produce.rb +50 -8
  27. data/lib/fastlane/actions/push_to_git_remote.rb +18 -1
  28. data/lib/fastlane/actions/register_devices.rb +18 -1
  29. data/lib/fastlane/actions/reset_git_repo.rb +24 -1
  30. data/lib/fastlane/actions/resign.rb +17 -1
  31. data/lib/fastlane/actions/s3.rb +30 -2
  32. data/lib/fastlane/actions/say.rb +5 -1
  33. data/lib/fastlane/actions/sigh.rb +22 -6
  34. data/lib/fastlane/actions/slack.rb +19 -4
  35. data/lib/fastlane/actions/snapshot.rb +27 -6
  36. data/lib/fastlane/actions/team_id.rb +9 -1
  37. data/lib/fastlane/actions/team_name.rb +9 -1
  38. data/lib/fastlane/actions/testmunk.rb +17 -4
  39. data/lib/fastlane/actions/typetalk.rb +19 -1
  40. data/lib/fastlane/actions/update_project_code_signing.rb +13 -1
  41. data/lib/fastlane/actions/xcode_select.rb +10 -2
  42. data/lib/fastlane/actions/xcodebuild.rb +88 -8
  43. data/lib/fastlane/actions/xctool.rb +16 -1
  44. data/lib/fastlane/actions_list.rb +130 -0
  45. data/lib/fastlane/core_ext/string.rb +8 -0
  46. data/lib/fastlane/lane_manager.rb +17 -1
  47. data/lib/fastlane/version.rb +1 -1
  48. metadata +35 -19
@@ -11,10 +11,7 @@
11
11
 
12
12
  module Fastlane
13
13
  module Actions
14
- module SharedValues
15
- end
16
-
17
- class TestmunkAction
14
+ class TestmunkAction < Action
18
15
  def self.run(_params)
19
16
  raise "Please pass your Testmunk email address using `ENV['TESTMUNK_EMAIL'] = 'value'`" unless ENV['TESTMUNK_EMAIL']
20
17
  raise "Please pass your Testmunk API Key using `ENV['TESTMUNK_API'] = 'value'`" unless ENV['TESTMUNK_API']
@@ -36,6 +33,22 @@ module Fastlane
36
33
  raise 'Something went wrong while uploading your app to Testmunk'.red
37
34
  end
38
35
  end
36
+
37
+ def self.description
38
+ "Run tests on real devices using Testmunk"
39
+ end
40
+
41
+ def self.available_options
42
+ [
43
+ ['', 'Your email address', 'TESTMUNK_EMAIL'],
44
+ ['', 'Testmunk API Key', 'TESTMUNK_API'],
45
+ ['', 'Testmunk App Name', 'TESTMUNK_APP']
46
+ ]
47
+ end
48
+
49
+ def self.author
50
+ "mposchen"
51
+ end
39
52
  end
40
53
  end
41
54
  end
@@ -1,6 +1,6 @@
1
1
  module Fastlane
2
2
  module Actions
3
- class TypetalkAction
3
+ class TypetalkAction < Action
4
4
  def self.run(params)
5
5
  options = {
6
6
  message: nil,
@@ -50,6 +50,24 @@ module Fastlane
50
50
  raise "Could not sent Typetalk notification".red
51
51
  end
52
52
  end
53
+
54
+ def self.description
55
+ "Post a message to Typetalk"
56
+ end
57
+
58
+ def self.available_options
59
+ [
60
+ ['message', 'The message to post'],
61
+ ['note_path', 'Path to a md file'],
62
+ ['topicId', ''],
63
+ ['success', 'Successful build?'],
64
+ ['typetalk_token', 'API token']
65
+ ]
66
+ end
67
+
68
+ def self.author
69
+ "dataich"
70
+ end
53
71
  end
54
72
  end
55
73
  end
@@ -3,7 +3,7 @@ module Fastlane
3
3
  module SharedValues
4
4
  end
5
5
 
6
- class UpdateProjectCodeSigningAction
6
+ class UpdateProjectCodeSigningAction < Action
7
7
  def self.run(params)
8
8
  path = params.first
9
9
  path = File.join(path, "project.pbxproj")
@@ -19,6 +19,18 @@ module Fastlane
19
19
 
20
20
  Helper.log.info("Successfully updated project settings to use UDID '#{udid}'".green)
21
21
  end
22
+
23
+ def self.description
24
+ "Updated code signing settings from 'Automatic' to a specific profile"
25
+ end
26
+
27
+ def self.details
28
+ "This feature is not yet 100% finished"
29
+ end
30
+
31
+ def self.author
32
+ "KrauseFx"
33
+ end
22
34
  end
23
35
  end
24
36
  end
@@ -17,7 +17,7 @@ module Fastlane
17
17
  # Xcode application directory -- the xcode-select provided shims will automatically convert the
18
18
  # environment variable into the full Developer content path.
19
19
  #
20
- class XcodeSelectAction
20
+ class XcodeSelectAction < Action
21
21
  def self.run(params)
22
22
  xcode_path = params.first
23
23
 
@@ -25,12 +25,20 @@ module Fastlane
25
25
  raise "Path to Xcode application required (e.x. \"/Applications/Xcode.app\")".red unless xcode_path.to_s.length > 0
26
26
 
27
27
  # Verify that a path to a directory was passed in
28
- raise "Nonexistent path provided".red unless Dir.exists? xcode_path
28
+ raise "Path '#{xcode_path}' doesn't exist".red unless Dir.exists?(xcode_path)
29
29
 
30
30
  Helper.log.info "Setting Xcode version to #{xcode_path} for all build steps"
31
31
 
32
32
  ENV["DEVELOPER_DIR"] = xcode_path + "/Contents/Developer"
33
33
  end
34
+
35
+ def self.description
36
+ "Change the xcode-path to use. Useful for beta versions of Xcode"
37
+ end
38
+
39
+ def self.author
40
+ "dtrenz"
41
+ end
34
42
  end
35
43
  end
36
44
  end
@@ -7,7 +7,7 @@ module Fastlane
7
7
  # xcodebuild man page:
8
8
  # https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html
9
9
 
10
- class XcodebuildAction
10
+ class XcodebuildAction < Action
11
11
  ARGS_MAP = {
12
12
  # actions
13
13
  analyze: "analyze",
@@ -117,8 +117,20 @@ module Fastlane
117
117
  xcpretty_args = [ "--color" ]
118
118
 
119
119
  if testing
120
- # Test report file format
121
- if params[:report_formats]
120
+ if params[:reports]
121
+ # New report options format
122
+ reports = params[:reports].map do |report|
123
+ unless report[:screenshots]
124
+ "--report #{report[:report]} --output #{report[:output]}"
125
+ else
126
+ "--report #{report[:report]} --output #{report[:output]} --screenshots"
127
+ end
128
+ end
129
+
130
+ xcpretty_args.push reports.join(" ")
131
+
132
+ elsif params[:report_formats]
133
+ # Test report file format
122
134
  report_formats = params[:report_formats].map do |format|
123
135
  "--report #{format}"
124
136
  end.sort().join(" ")
@@ -187,46 +199,114 @@ module Fastlane
187
199
 
188
200
  return workspace
189
201
  end
202
+
203
+ def self.description
204
+ "Use the `xcodebuild` command to build and sign your app"
205
+ end
206
+
207
+ def self.available_options
208
+ [
209
+ ['archive', 'Set to true to build archive'],
210
+ ['archive_path', 'The path to archive the to. Must contain `.xcarchive`'],
211
+ ['workspace', 'The workspace to use'],
212
+ ['scheme', 'The scheme to build'],
213
+ ['build_settings', 'Hash of additional build information']
214
+ ]
215
+ end
216
+
217
+ def self.details
218
+ "More infomration on GitHub: https://github.com/KrauseFx/fastlane/blob/master/docs/Actions.md#xcodebuild"
219
+ end
220
+
221
+ def self.author
222
+ "dtrenz"
223
+ end
190
224
  end
191
225
 
192
- class XcarchiveAction
226
+ class XcarchiveAction < Action
193
227
  def self.run(params)
194
228
  params_hash = params.first || {}
195
229
  params_hash[:archive] = true
196
230
  XcodebuildAction.run([params_hash])
197
231
  end
232
+
233
+ def self.description
234
+ "Builds the project using `xcodebuild`"
235
+ end
236
+
237
+ def self.author
238
+ "dtrenz"
239
+ end
198
240
  end
199
241
 
200
- class XcbuildAction
242
+ class XcbuildAction < Action
201
243
  def self.run(params)
202
244
  params_hash = params.first || {}
203
245
  params_hash[:build] = true
204
246
  XcodebuildAction.run([params_hash])
205
247
  end
248
+
249
+ def self.description
250
+ "Builds the project using `xcodebuild`"
251
+ end
252
+
253
+ def self.author
254
+ "dtrenz"
255
+ end
206
256
  end
207
257
 
208
- class XccleanAction
258
+ class XccleanAction < Action
209
259
  def self.run(params)
210
260
  params_hash = params.first || {}
211
261
  params_hash[:clean] = true
212
262
  XcodebuildAction.run([params_hash])
213
263
  end
264
+
265
+ def self.description
266
+ "Builds the project using `xcodebuild`"
267
+ end
268
+
269
+ def self.author
270
+ "dtrenz"
271
+ end
214
272
  end
215
273
 
216
- class XcexportAction
274
+ class XcexportAction < Action
217
275
  def self.run(params)
218
276
  params_hash = params.first || {}
219
277
  params_hash[:export_archive] = true
220
278
  XcodebuildAction.run([params_hash])
221
279
  end
280
+
281
+ def self.description
282
+ "Builds the project using `xcodebuild`"
283
+ end
284
+
285
+ def self.author
286
+ "dtrenz"
287
+ end
222
288
  end
223
289
 
224
- class XctestAction
290
+ class XctestAction < Action
225
291
  def self.run(params)
226
292
  params_hash = params.first || {}
227
293
  params_hash[:test] = true
228
294
  XcodebuildAction.run([params_hash])
229
295
  end
296
+
297
+ def self.description
298
+ "Runs tests on the given simulator"
299
+ end
300
+
301
+ def available_options
302
+ [
303
+ ['destination', 'The simulator to use, e.g. "name=iPhone 5s,OS=8.1"']
304
+ ]
305
+ end
306
+
307
+ def self.author
308
+ "dtrenz"
309
+ end
230
310
  end
231
311
  end
232
312
  end
@@ -1,6 +1,6 @@
1
1
  module Fastlane
2
2
  module Actions
3
- class XctoolAction
3
+ class XctoolAction < Action
4
4
  def self.run(params)
5
5
  unless Helper.test?
6
6
  raise 'xctool not installed, please install using `brew install xctool`'.red if `which xctool`.length == 0
@@ -8,6 +8,21 @@ module Fastlane
8
8
 
9
9
  Actions.sh('xctool ' + params.join(' '))
10
10
  end
11
+
12
+ def self.description
13
+ "Run tests using xctool"
14
+ end
15
+
16
+ def self.details
17
+ [
18
+ "It is recommended to store the build configuration in the `.xctool-args` file.",
19
+ "More information available on GitHub: https://github.com/KrauseFx/fastlane/blob/master/docs/Actions.md#xctool"
20
+ ].join(' ')
21
+ end
22
+
23
+ def self.author
24
+ "KrauseFx"
25
+ end
11
26
  end
12
27
  end
13
28
  end
@@ -0,0 +1,130 @@
1
+ module Fastlane
2
+ class ActionsList
3
+ def self.run(filter)
4
+ require 'terminal-table'
5
+ print_all unless filter
6
+ show_details(filter) if filter
7
+ end
8
+
9
+ def self.print_all
10
+ rows = []
11
+ all_actions do |action, name|
12
+ current = []
13
+ current << name.yellow
14
+
15
+ if action < Action
16
+ current << action.description if action.description
17
+ current << action.author.green if action.author
18
+
19
+ l = (action.description || '').length
20
+ else
21
+ Helper.log.error "Please update your action file #{name} to be a subclass of `Action` by adding ` < Action` after your class name.".red
22
+ current << "Please update action file".red
23
+ end
24
+ rows << current
25
+ end
26
+
27
+ table = Terminal::Table.new(
28
+ title: "Available fastlane actions".green,
29
+ headings: ['Action', 'Description', 'Author'],
30
+ rows: rows
31
+ )
32
+ puts table
33
+
34
+ puts "Get more information for one specific action using `fastlane action [name]`"
35
+ end
36
+
37
+ def self.show_details(filter)
38
+ puts "Loading documentation for #{filter}:".green
39
+
40
+ puts ""
41
+
42
+ all_actions do |action, name|
43
+ next unless name == filter.strip
44
+
45
+ rows = []
46
+ rows << [action.description] if action.description
47
+ rows << [' ']
48
+ if action.details
49
+ rows << [action.details]
50
+ rows << [' ']
51
+ end
52
+ rows << ["Created by #{action.author.green}"] if action.author
53
+
54
+ puts Terminal::Table.new(
55
+ title: filter.green,
56
+ rows: rows
57
+ )
58
+
59
+ puts "\n"
60
+
61
+ options = parse_options(action.available_options) if action.available_options
62
+
63
+ if options
64
+ puts Terminal::Table.new(
65
+ title: filter.green,
66
+ headings: ['Key', 'Description', 'Env Var'],
67
+ rows: options
68
+ )
69
+ else
70
+ puts "No available options".yellow
71
+ end
72
+ puts "\n"
73
+
74
+ output = parse_options(action.output, false) if action.output
75
+ if output
76
+ puts Terminal::Table.new(
77
+ title: filter.green,
78
+ headings: ['Key', 'Description'],
79
+ rows: output
80
+ )
81
+ puts "Access the output values using `Actions.lane_context[VARIABLE_NAME]`"
82
+ puts ""
83
+ end
84
+
85
+
86
+
87
+ puts "More information can be found on https://github.com/KrauseFx/fastlane/blob/master/docs/Actions.md"
88
+ puts "\n"
89
+
90
+ return # our job is done here
91
+ end
92
+
93
+ puts "Couldn't find action for the given filter.".red
94
+ puts "==========================================\n".red
95
+ print_all # show all available actions instead
96
+ end
97
+
98
+
99
+ # Iterates through all available actions and yields from there
100
+ def self.all_actions
101
+ all_actions = Fastlane::Actions.constants.select {|c| Class === Fastlane::Actions.const_get(c)}
102
+ all_actions.each do |symbol|
103
+ action = Fastlane::Actions.const_get(symbol)
104
+ name = symbol.to_s.gsub('Action', '').fastlane_underscore
105
+ yield action, name
106
+ end
107
+ end
108
+
109
+ private
110
+ def self.parse_options(options, fill_three = true)
111
+ rows = []
112
+ rows << [options] if options.kind_of?String
113
+
114
+ if options.kind_of?Array
115
+ options.each do |current|
116
+ if current.kind_of?FastlaneCore::ConfigItem
117
+ rows << [current.key.to_s.yellow, current.description, current.env_name]
118
+ elsif current.kind_of?Array
119
+ raise "Invalid number of elements in this row: #{current}. Must be 2 or 3".red unless ([2, 3].include?current.count)
120
+ rows << current
121
+ rows.last[0] = rows.last.first.yellow # color it yellow :)
122
+ rows.last << nil if (fill_three and rows.last.count == 2) # to have a nice border in the table
123
+ end
124
+ end
125
+ end
126
+
127
+ rows
128
+ end
129
+ end
130
+ end
@@ -2,4 +2,12 @@ class String
2
2
  def fastlane_class
3
3
  split('_').collect!(&:capitalize).join
4
4
  end
5
+
6
+ def fastlane_underscore
7
+ self.gsub(/::/, '/').
8
+ gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
9
+ gsub(/([a-z\d])([A-Z])/,'\1_\2').
10
+ tr("-", "_").
11
+ downcase
12
+ end
5
13
  end