fastlane 2.69.0.beta.20171212010004 → 2.69.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/deliver/lib/assets/DeliverfileDefault.swift +13 -0
  3. data/deliver/lib/deliver/commands_generator.rb +2 -1
  4. data/deliver/lib/deliver/options.rb +8 -3
  5. data/deliver/lib/deliver/setup.rb +19 -3
  6. data/fastlane/lib/assets/AppfileTemplate.swift +8 -0
  7. data/fastlane/lib/assets/DefaultFastfileTemplate.swift +72 -0
  8. data/fastlane/lib/fastlane.rb +6 -0
  9. data/fastlane/lib/fastlane/.DS_Store +0 -0
  10. data/fastlane/lib/fastlane/action.rb +13 -0
  11. data/fastlane/lib/fastlane/actions/adb.rb +4 -0
  12. data/fastlane/lib/fastlane/actions/appium.rb +2 -0
  13. data/fastlane/lib/fastlane/actions/bundle_install.rb +2 -0
  14. data/fastlane/lib/fastlane/actions/carthage.rb +12 -24
  15. data/fastlane/lib/fastlane/actions/changelog_from_git_commits.rb +5 -0
  16. data/fastlane/lib/fastlane/actions/cocoapods.rb +2 -1
  17. data/fastlane/lib/fastlane/actions/commit_github_file.rb +4 -0
  18. data/fastlane/lib/fastlane/actions/environment_variable.rb +73 -0
  19. data/fastlane/lib/fastlane/actions/get_version_number.rb +4 -4
  20. data/fastlane/lib/fastlane/actions/increment_build_number.rb +4 -0
  21. data/fastlane/lib/fastlane/actions/increment_version_number.rb +4 -0
  22. data/fastlane/lib/fastlane/actions/is_ci.rb +4 -0
  23. data/fastlane/lib/fastlane/actions/last_git_commit.rb +4 -0
  24. data/fastlane/lib/fastlane/actions/last_git_tag.rb +4 -0
  25. data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +4 -0
  26. data/fastlane/lib/fastlane/actions/modify_services.rb +1 -0
  27. data/fastlane/lib/fastlane/actions/number_of_commits.rb +4 -0
  28. data/fastlane/lib/fastlane/actions/podio_item.rb +1 -0
  29. data/fastlane/lib/fastlane/actions/prompt.rb +4 -0
  30. data/fastlane/lib/fastlane/actions/read_podspec.rb +4 -0
  31. data/fastlane/lib/fastlane/actions/register_device.rb +4 -0
  32. data/fastlane/lib/fastlane/actions/register_devices.rb +1 -0
  33. data/fastlane/lib/fastlane/actions/rocket.rb +4 -0
  34. data/fastlane/lib/fastlane/actions/set_github_release.rb +4 -0
  35. data/fastlane/lib/fastlane/actions/sh.rb +5 -0
  36. data/fastlane/lib/fastlane/actions/slather.rb +14 -0
  37. data/fastlane/lib/fastlane/actions/update_urban_airship_configuration.rb +1 -0
  38. data/fastlane/lib/fastlane/actions/xcode_install.rb +4 -0
  39. data/fastlane/lib/fastlane/actions/xcode_server_get_assets.rb +4 -0
  40. data/fastlane/lib/fastlane/actions/zip.rb +4 -0
  41. data/fastlane/lib/fastlane/boolean.rb +5 -0
  42. data/fastlane/lib/fastlane/command_line_handler.rb +6 -1
  43. data/fastlane/lib/fastlane/commands_generator.rb +40 -1
  44. data/fastlane/lib/fastlane/fast_file.rb +5 -1
  45. data/fastlane/lib/fastlane/lane_list.rb +67 -4
  46. data/fastlane/lib/fastlane/lane_manager.rb +3 -69
  47. data/fastlane/lib/fastlane/lane_manager_base.rb +124 -0
  48. data/fastlane/lib/fastlane/runner.rb +2 -2
  49. data/fastlane/lib/fastlane/server/command.rb +70 -0
  50. data/fastlane/lib/fastlane/server/command_executor.rb +9 -0
  51. data/fastlane/lib/fastlane/server/socket_server.rb +212 -0
  52. data/fastlane/lib/fastlane/server/socket_server_action_command_executor.rb +100 -0
  53. data/fastlane/lib/fastlane/setup/setup.rb +7 -2
  54. data/fastlane/lib/fastlane/setup/setup_ios.rb +72 -15
  55. data/fastlane/lib/fastlane/swift_fastlane_api_generator.rb +265 -0
  56. data/fastlane/lib/fastlane/swift_fastlane_function.rb +342 -0
  57. data/fastlane/lib/fastlane/swift_lane_manager.rb +246 -0
  58. data/fastlane/lib/fastlane/tools.rb +13 -0
  59. data/fastlane/lib/fastlane/version.rb +1 -1
  60. data/fastlane_core/lib/fastlane_core.rb +3 -0
  61. data/fastlane_core/lib/fastlane_core/analytics/action_launch_context.rb +6 -3
  62. data/fastlane_core/lib/fastlane_core/analytics/analytics_session.rb +7 -0
  63. data/fastlane_core/lib/fastlane_core/configuration/commander_generator.rb +13 -0
  64. data/fastlane_core/lib/fastlane_core/configuration/config_item.rb +33 -2
  65. data/fastlane_core/lib/fastlane_core/fastlane_folder.rb +32 -0
  66. data/gym/lib/assets/GymfileTemplate.swift +13 -0
  67. data/gym/lib/gym/commands_generator.rb +14 -2
  68. data/gym/lib/gym/generators/build_command_generator.rb +2 -2
  69. data/gym/lib/gym/options.rb +11 -0
  70. data/match/lib/assets/MatchfileTemplate.swift +9 -0
  71. data/match/lib/match/commands_generator.rb +9 -3
  72. data/match/lib/match/options.rb +1 -0
  73. data/match/lib/match/setup.rb +6 -2
  74. data/precheck/lib/.DS_Store +0 -0
  75. data/precheck/lib/assets/PrecheckfileTemplate +1 -1
  76. data/precheck/lib/assets/PrecheckfileTemplate.swift +19 -0
  77. data/precheck/lib/precheck/commands_generator.rb +13 -2
  78. data/scan/lib/assets/ScanfileTemplate.swift +13 -0
  79. data/scan/lib/scan/commands_generator.rb +14 -2
  80. data/scan/lib/scan/options.rb +6 -0
  81. data/screengrab/lib/assets/ScreengrabfileTemplate.swift +15 -0
  82. data/screengrab/lib/screengrab/commands_generator.rb +2 -1
  83. data/screengrab/lib/screengrab/setup.rb +9 -3
  84. data/snapshot/lib/assets/SnapfileTemplate.swift +41 -0
  85. data/snapshot/lib/snapshot/commands_generator.rb +2 -1
  86. data/snapshot/lib/snapshot/setup.rb +9 -3
  87. data/spaceship/lib/spaceship/client.rb +4 -1
  88. metadata +38 -16
@@ -115,10 +115,10 @@ module Fastlane
115
115
  end),
116
116
  FastlaneCore::ConfigItem.new(key: :scheme,
117
117
  env_name: "FL_VERSION_NUMBER_SCHEME",
118
- description: "Specify a specific scheme if you have multiple per project, optional.
119
- This parameter is deprecated and will be removed in a future release.
120
- Please use the 'target' parameter instead. The behavior of this parameter
121
- is currently undefined if your scheme name doesn't match your target name",
118
+ description: "Specify a specific scheme if you have multiple per project, optional. " \
119
+ "This parameter is deprecated and will be removed in a future release. " \
120
+ "Please use the 'target' parameter instead. The behavior of this parameter " \
121
+ "is currently undefined if your scheme name doesn't match your target name",
122
122
  optional: true,
123
123
  deprecated: true),
124
124
  FastlaneCore::ConfigItem.new(key: :target,
@@ -89,6 +89,10 @@ module Fastlane
89
89
  "The new build number"
90
90
  end
91
91
 
92
+ def self.return_type
93
+ :string
94
+ end
95
+
92
96
  def self.author
93
97
  "KrauseFx"
94
98
  end
@@ -116,6 +116,10 @@ module Fastlane
116
116
  ]
117
117
  end
118
118
 
119
+ def self.return_type
120
+ :string
121
+ end
122
+
119
123
  def self.return_value
120
124
  "The new version number"
121
125
  end
@@ -24,6 +24,10 @@ module Fastlane
24
24
  []
25
25
  end
26
26
 
27
+ def self.return_type
28
+ :bool
29
+ end
30
+
27
31
  def self.authors
28
32
  ["KrauseFx"]
29
33
  end
@@ -17,6 +17,10 @@ module Fastlane
17
17
  "Returns the following dict: {commit_hash: \"commit hash\", abbreviated_commit_hash: \"abbreviated commit hash\" author: \"Author\", message: \"commit message\"}"
18
18
  end
19
19
 
20
+ def self.return_type
21
+ :hash_of_strings
22
+ end
23
+
20
24
  def self.author
21
25
  "ngutman"
22
26
  end
@@ -21,6 +21,10 @@ module Fastlane
21
21
  []
22
22
  end
23
23
 
24
+ def self.return_type
25
+ :string
26
+ end
27
+
24
28
  def self.authors
25
29
  ["KrauseFx"]
26
30
  end
@@ -100,6 +100,10 @@ module Fastlane
100
100
  "Integer representation of the latest build number uploaded to TestFlight"
101
101
  end
102
102
 
103
+ def self.return_type
104
+ :int
105
+ end
106
+
103
107
  def self.authors
104
108
  ["daveanderson"]
105
109
  end
@@ -99,6 +99,7 @@ module Fastlane
99
99
  env_name: "PRODUCE_ENABLE_SERVICES",
100
100
  description: "Array with Spaceship App Services (e.g. #{allowed_services_description})",
101
101
  is_string: false,
102
+ type: Hash,
102
103
  default_value: {},
103
104
  verify_block: proc do |value|
104
105
  allowed_keys = Produce::DeveloperCenter::ALLOWED_SERVICES.keys
@@ -33,6 +33,10 @@ module Fastlane
33
33
  "The total number of all commits in current git branch"
34
34
  end
35
35
 
36
+ def self.return_type
37
+ :int
38
+ end
39
+
36
40
  def self.available_options
37
41
  [
38
42
  FastlaneCore::ConfigItem.new(key: :all,
@@ -80,6 +80,7 @@ module Fastlane
80
80
  FastlaneCore::ConfigItem.new(key: :other_fields,
81
81
  description: 'Dictionary of your app fields. Podio supports several field types, see https://developers.podio.com/doc/items',
82
82
  is_string: false,
83
+ type: Hash,
83
84
  optional: true)
84
85
  ]
85
86
  end
@@ -87,6 +87,10 @@ module Fastlane
87
87
  "User Content\nWithNewline"
88
88
  end
89
89
 
90
+ def self.return_type
91
+ :string
92
+ end
93
+
90
94
  def self.category
91
95
  :misc
92
96
  end
@@ -79,6 +79,10 @@ module Fastlane
79
79
  }
80
80
  end
81
81
 
82
+ def self.return_type
83
+ :hash_of_strings
84
+ end
85
+
82
86
  def self.category
83
87
  :misc
84
88
  end
@@ -91,6 +91,10 @@ module Fastlane
91
91
  ]
92
92
  end
93
93
 
94
+ def self.return_type
95
+ :string
96
+ end
97
+
94
98
  def self.category
95
99
  :code_signing
96
100
  end
@@ -62,6 +62,7 @@ module Fastlane
62
62
  env_name: "FL_REGISTER_DEVICES_DEVICES",
63
63
  description: "A hash of devices, with the name as key and the UDID as value",
64
64
  is_string: false,
65
+ type: Hash,
65
66
  optional: true),
66
67
  FastlaneCore::ConfigItem.new(key: :devices_file,
67
68
  env_name: "FL_REGISTER_DEVICES_FILE",
@@ -71,6 +71,10 @@ module Fastlane
71
71
  ]
72
72
  end
73
73
 
74
+ def self.return_type
75
+ :string
76
+ end
77
+
74
78
  def self.category
75
79
  :misc
76
80
  end
@@ -236,6 +236,10 @@ module Fastlane
236
236
  ].join("\n")
237
237
  end
238
238
 
239
+ def self.return_type
240
+ :hash_of_strings
241
+ end
242
+
239
243
  def self.authors
240
244
  ["czechboy0", "tommeier"]
241
245
  end
@@ -35,6 +35,7 @@ module Fastlane
35
35
  description: 'A callback invoked with the command output if there is a non-zero exit status',
36
36
  optional: true,
37
37
  is_string: false,
38
+ type: :string_callback,
38
39
  default_value: nil)
39
40
  ]
40
41
  end
@@ -43,6 +44,10 @@ module Fastlane
43
44
  'Outputs the string and executes it. When running in tests, it returns the actual command instead of executing it'
44
45
  end
45
46
 
47
+ def self.return_type
48
+ :string
49
+ end
50
+
46
51
  def self.authors
47
52
  ["KrauseFx"]
48
53
  end
@@ -148,61 +148,73 @@ Slather is available at https://github.com/SlatherOrg/slather
148
148
  env_name: "FL_SLATHER_BUILDKITE_ENABLED", # The name of the environment variable
149
149
  description: "Tell slather that it is running on Buildkite",
150
150
  is_string: false,
151
+ type: Boolean,
151
152
  optional: true),
152
153
  FastlaneCore::ConfigItem.new(key: :teamcity,
153
154
  env_name: "FL_SLATHER_TEAMCITY_ENABLED", # The name of the environment variable
154
155
  description: "Tell slather that it is running on TeamCity",
155
156
  is_string: false,
157
+ type: Boolean,
156
158
  optional: true),
157
159
  FastlaneCore::ConfigItem.new(key: :jenkins,
158
160
  env_name: "FL_SLATHER_JENKINS_ENABLED", # The name of the environment variable
159
161
  description: "Tell slather that it is running on Jenkins",
160
162
  is_string: false,
163
+ type: Boolean,
161
164
  optional: true),
162
165
  FastlaneCore::ConfigItem.new(key: :travis,
163
166
  env_name: "FL_SLATHER_TRAVIS_ENABLED", # The name of the environment variable
164
167
  description: "Tell slather that it is running on TravisCI",
165
168
  is_string: false,
169
+ type: Boolean,
166
170
  optional: true),
167
171
  FastlaneCore::ConfigItem.new(key: :travis_pro,
168
172
  env_name: "FL_SLATHER_TRAVIS_PRO_ENABLED", # The name of the environment variable
169
173
  description: "Tell slather that it is running on TravisCI Pro",
170
174
  is_string: false,
175
+ type: Boolean,
171
176
  optional: true),
172
177
  FastlaneCore::ConfigItem.new(key: :circleci,
173
178
  env_name: "FL_SLATHER_CIRCLECI_ENABLED",
174
179
  description: "Tell slather that it is running on CircleCI",
175
180
  is_string: false,
181
+ type: Boolean,
176
182
  optional: true),
177
183
  FastlaneCore::ConfigItem.new(key: :coveralls,
178
184
  env_name: "FL_SLATHER_COVERALLS_ENABLED",
179
185
  description: "Tell slather that it should post data to Coveralls",
180
186
  is_string: false,
187
+ type: Boolean,
181
188
  optional: true),
182
189
  FastlaneCore::ConfigItem.new(key: :simple_output,
183
190
  env_name: "FL_SLATHER_SIMPLE_OUTPUT_ENABLED",
184
191
  description: "Tell slather that it should output results to the terminal",
185
192
  is_string: false,
193
+ type: Boolean,
186
194
  optional: true),
187
195
  FastlaneCore::ConfigItem.new(key: :gutter_json,
188
196
  env_name: "FL_SLATHER_GUTTER_JSON_ENABLED",
189
197
  description: "Tell slather that it should output results as Gutter JSON format",
190
198
  is_string: false,
199
+ type: Boolean,
191
200
  optional: true),
192
201
  FastlaneCore::ConfigItem.new(key: :cobertura_xml,
193
202
  env_name: "FL_SLATHER_COBERTURA_XML_ENABLED",
194
203
  description: "Tell slather that it should output results as Cobertura XML format",
195
204
  is_string: false,
205
+ type: Boolean,
196
206
  optional: true),
197
207
  FastlaneCore::ConfigItem.new(key: :html,
198
208
  env_name: "FL_SLATHER_HTML_ENABLED",
199
209
  description: "Tell slather that it should output results as static HTML pages",
200
210
  is_string: false,
211
+ type: Boolean,
201
212
  optional: true),
202
213
  FastlaneCore::ConfigItem.new(key: :show,
203
214
  env_name: "FL_SLATHER_SHOW_ENABLED",
204
215
  description: "Tell slather that it should open static html pages automatically",
205
216
  is_string: false,
217
+ type: Boolean,
206
218
  default_value: false),
207
219
  FastlaneCore::ConfigItem.new(key: :source_directory,
208
220
  env_name: "FL_SLATHER_SOURCE_DIRECTORY",
@@ -221,11 +233,13 @@ Slather is available at https://github.com/SlatherOrg/slather
221
233
  env_name: "FL_SLATHER_VERBOSE",
222
234
  description: "Tell slather to enable verbose mode",
223
235
  is_string: false,
236
+ type: Boolean,
224
237
  optional: true),
225
238
  FastlaneCore::ConfigItem.new(key: :use_bundle_exec,
226
239
  env_name: "FL_SLATHER_USE_BUNDLE_EXEC",
227
240
  description: "Use bundle exec to execute slather. Make sure it is in the Gemfile",
228
241
  is_string: false,
242
+ type: Boolean,
229
243
  default_value: false),
230
244
  FastlaneCore::ConfigItem.new(key: :binary_basename,
231
245
  env_name: "FL_SLATHER_BINARY_BASENAME",
@@ -59,6 +59,7 @@ module Fastlane
59
59
  FastlaneCore::ConfigItem.new(key: :detect_provisioning_mode,
60
60
  env_name: "URBAN_AIRSHIP_DETECT_PROVISIONING_MODE",
61
61
  is_string: false,
62
+ type: Boolean,
62
63
  optional: true,
63
64
  description: "Automatically detect provisioning mode")
64
65
  ]
@@ -76,6 +76,10 @@ module Fastlane
76
76
  "The path to the newly installed Xcode version"
77
77
  end
78
78
 
79
+ def self.return_type
80
+ :string
81
+ end
82
+
79
83
  def self.authors
80
84
  ["Krausefx"]
81
85
  end
@@ -283,6 +283,10 @@ module Fastlane
283
283
  ]
284
284
  end
285
285
 
286
+ def self.return_type
287
+ :array_of_strings
288
+ end
289
+
286
290
  def self.authors
287
291
  ["czechboy0"]
288
292
  end
@@ -84,6 +84,10 @@ module Fastlane
84
84
  "The path to the output zip file"
85
85
  end
86
86
 
87
+ def self.return_type
88
+ :string
89
+ end
90
+
87
91
  def self.authors
88
92
  ["KrauseFx"]
89
93
  end
@@ -0,0 +1,5 @@
1
+ module Fastlane
2
+ class Boolean
3
+ # Used in config item generation
4
+ end
5
+ end
@@ -27,7 +27,12 @@ module Fastlane
27
27
  end
28
28
 
29
29
  dot_env = Helper.is_test? ? nil : options.env
30
- Fastlane::LaneManager.cruise_lane(platform, lane, lane_parameters, dot_env)
30
+
31
+ if FastlaneCore::FastlaneFolder.swift?
32
+ Fastlane::SwiftLaneManager.cruise_lane(lane, lane_parameters, dot_env)
33
+ else
34
+ Fastlane::LaneManager.cruise_lane(platform, lane, lane_parameters, dot_env)
35
+ end
31
36
  end
32
37
 
33
38
  # Helper to convert into the right data type
@@ -119,11 +119,22 @@ module Fastlane
119
119
  beta_info = CrashlyticsBetaCommandLineHandler.info_from_options(options)
120
120
  Fastlane::CrashlyticsBeta.new(beta_info, Fastlane::CrashlyticsBetaUi.new).run
121
121
  else
122
- Fastlane::Setup.new.run(user: options.user)
122
+ is_swift_fastfile = args.include?("swift")
123
+ Fastlane::Setup.new.run(user: options.user, is_swift_fastfile: is_swift_fastfile)
123
124
  end
124
125
  end
125
126
  end
126
127
 
128
+ command :init_swift do |c|
129
+ c.syntax = 'fastlane init_swift'
130
+ c.description = 'Helps you with your initial fastlane setup for Swift'
131
+ c.option '-u STRING', '--user STRING', String, 'iOS projects only: Your Apple ID'
132
+
133
+ c.action do |args, options|
134
+ Fastlane::Setup.new.run(user: options.user, is_swift_fastfile: true)
135
+ end
136
+ end
137
+
127
138
  command :new_action do |c|
128
139
  c.syntax = 'fastlane new_action'
129
140
  c.description = 'Create a new custom action for fastlane.'
@@ -135,6 +146,34 @@ module Fastlane
135
146
  end
136
147
  end
137
148
 
149
+ command :socket_server do |c|
150
+ c.syntax = 'fastlane start_server'
151
+ c.description = 'Starts local socket server and enables only a single local connection'
152
+ c.option '-s', '--stay_alive', 'Keeps socket server up even after error or disconnects, requires CTRL-C to kill.'
153
+ c.option '-c seconds', '--connection_timeout', 'Sets connection established timeout'
154
+ c.action do |args, options|
155
+ default_connection_timeout = 5
156
+ stay_alive = options.stay_alive || false
157
+ connection_timeout = options.connection_timeout || default_connection_timeout
158
+
159
+ if stay_alive && options.connection_timeout.nil?
160
+ UI.important("stay_alive is set, but the connection timeout is not, this will give you #{default_connection_timeout} seconds to (re)connect")
161
+ end
162
+
163
+ require 'fastlane/server/socket_server'
164
+ require 'fastlane/server/socket_server_action_command_executor'
165
+
166
+ command_executor = SocketServerActionCommandExecutor.new
167
+ server = Fastlane::SocketServer.new(
168
+ command_executor: command_executor,
169
+ connection_timeout: connection_timeout,
170
+ stay_alive: stay_alive
171
+ )
172
+ result = server.start
173
+ UI.success "Result: #{result}" if result
174
+ end
175
+ end
176
+
138
177
  command :lanes do |c|
139
178
  c.syntax = 'fastlane lanes'
140
179
  c.description = 'Lists all available lanes and shows their description'
@@ -175,6 +175,10 @@ module Fastlane
175
175
 
176
176
  # Execute shell command
177
177
  def sh(*command, log: true, error_callback: nil, &b)
178
+ FastFile.sh(*command, log: log, error_callback: error_callback, &b)
179
+ end
180
+
181
+ def self.sh(*command, log: true, error_callback: nil, &b)
178
182
  command_header = log ? Actions.shell_command_from_args(*command) : "shell command"
179
183
  Actions.execute_action(command_header) do
180
184
  Actions.sh_no_action(*command, log: log, error_callback: error_callback, &b)
@@ -392,7 +396,7 @@ module Fastlane
392
396
  end
393
397
 
394
398
  def action_launched(action_name)
395
- action_launch_context = FastlaneCore::ActionLaunchContext.context_for_action_name(action_name, args: ARGV)
399
+ action_launch_context = FastlaneCore::ActionLaunchContext.context_for_action_name(action_name, configuration_language: "ruby", args: ARGV)
396
400
  FastlaneCore.session.action_launched(launch_context: action_launch_context)
397
401
  end
398
402
 
@@ -1,27 +1,90 @@
1
1
  module Fastlane
2
2
  class LaneList
3
3
  # Print out the result of `generate`
4
+ SWIFT_FUNCTION_REGEX = /\s*func\s*(\w*)\s*\(\s*\)\s*/
5
+ SWIFT_DESC_REGEX = /\s*desc\s*\(\s*"(.*)"\s*\)\s*/
4
6
  def self.output(path)
5
7
  puts generate(path)
6
8
 
7
9
  puts "Execute using `fastlane [lane_name]`".yellow
8
10
  end
9
11
 
12
+ def self.generate_swift_lanes(path)
13
+ return unless (path || '').length > 0
14
+ UI.user_error!("Could not find Fastfile.swift at path '#{path}'") unless File.exist?(path)
15
+ path = File.expand_path(path)
16
+ lane_content = File.read(path)
17
+
18
+ current_lane_name = nil
19
+ lanes_by_name = {}
20
+
21
+ lane_content.split("\n").reject(&:empty?).each do |line|
22
+ line.strip!
23
+ if line.start_with?("func")
24
+ current_lane_name = self.lane_name_from_swift_line(potential_lane_line: line)
25
+ elsif line.start_with?("desc")
26
+ lane_description = self.desc_entry_for_swift_lane(named: current_lane_name, potential_desc_line: line)
27
+ unless lane_description
28
+ next
29
+ end
30
+
31
+ lanes_by_name[current_lane_name] = Fastlane::Lane.new(platform: nil, name: current_lane_name.to_sym, description: [lane_description])
32
+ current_lane_name = nil
33
+ end
34
+ end
35
+ # "" because that will be interpreted as general platform
36
+ # (we don't detect platform right now)
37
+ return { "" => lanes_by_name }
38
+ end
39
+
40
+ def self.desc_entry_for_swift_lane(named: nil, potential_desc_line: nil)
41
+ unless named
42
+ return nil
43
+ end
44
+
45
+ desc_match = SWIFT_DESC_REGEX.match(potential_desc_line)
46
+ unless desc_match
47
+ return nil
48
+ end
49
+
50
+ return desc_match[1]
51
+ end
52
+
53
+ def self.lane_name_from_swift_line(potential_lane_line: nil)
54
+ function_name_match = SWIFT_FUNCTION_REGEX.match(potential_lane_line)
55
+ unless function_name_match
56
+ return nil
57
+ end
58
+
59
+ unless function_name_match[1].downcase.end_with?("lane")
60
+ return nil
61
+ end
62
+
63
+ return function_name_match[1]
64
+ end
65
+
10
66
  def self.generate(path)
11
- ff = Fastlane::FastFile.new(path)
67
+ lanes = {}
68
+ if FastlaneCore::FastlaneFolder.swift?
69
+ lanes = generate_swift_lanes(path)
70
+ else
71
+ ff = Fastlane::FastFile.new(path)
72
+ lanes = ff.runner.lanes
73
+ end
74
+
12
75
  output = ""
13
76
 
14
- all_keys = ff.runner.lanes.keys.reject(&:nil?)
77
+ all_keys = lanes.keys.reject(&:nil?)
15
78
  all_keys.unshift(nil) # because we want root elements on top. always! They have key nil
16
79
 
17
80
  all_keys.each do |platform|
18
- next if (ff.runner.lanes[platform] || []).count == 0
81
+ next if (lanes[platform] || []).count == 0
19
82
 
20
83
  plat_text = platform
21
84
  plat_text = "general" if platform.to_s.empty?
22
85
  output += "\n--------- #{plat_text}---------\n".yellow
23
86
 
24
- value = ff.runner.lanes[platform]
87
+ value = lanes[platform]
25
88
  next unless value
26
89
 
27
90
  value.each do |lane_name, lane|