fastlane 1.91.0 → 1.92.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -0
  3. data/lib/assets/Plugins.md.erb +8 -0
  4. data/lib/fastlane.rb +1 -0
  5. data/lib/fastlane/action_collector.rb +34 -2
  6. data/lib/fastlane/actions/actions_helper.rb +4 -0
  7. data/lib/fastlane/actions/copy_artifacts.rb +14 -26
  8. data/lib/fastlane/actions/jira.rb +1 -1
  9. data/lib/fastlane/actions/pod_lib_lint.rb +1 -22
  10. data/lib/fastlane/actions/push_to_git_remote.rb +1 -1
  11. data/lib/fastlane/actions/slather.rb +21 -48
  12. data/lib/fastlane/commands_generator.rb +62 -11
  13. data/lib/fastlane/lane_manager.rb +6 -2
  14. data/lib/fastlane/one_off.rb +7 -1
  15. data/lib/fastlane/plugins/plugin_fetcher.rb +59 -0
  16. data/lib/fastlane/plugins/plugin_generator.rb +109 -0
  17. data/lib/fastlane/plugins/plugin_generator_ui.rb +19 -0
  18. data/lib/fastlane/plugins/plugin_info.rb +47 -0
  19. data/lib/fastlane/plugins/plugin_info_collector.rb +120 -0
  20. data/lib/fastlane/plugins/plugin_manager.rb +333 -0
  21. data/lib/fastlane/plugins/plugin_search.rb +46 -0
  22. data/lib/fastlane/plugins/plugins.rb +7 -0
  23. data/lib/fastlane/plugins/templates/Gemfile.erb +3 -0
  24. data/lib/fastlane/plugins/templates/LICENSE.erb +21 -0
  25. data/lib/fastlane/plugins/templates/README.md.erb +31 -0
  26. data/lib/fastlane/plugins/templates/Rakefile.erb +1 -0
  27. data/lib/fastlane/plugins/templates/action.rb.erb +35 -0
  28. data/lib/fastlane/plugins/templates/action_spec.rb.erb +9 -0
  29. data/lib/fastlane/plugins/templates/assets/fastlane_logo.png +0 -0
  30. data/lib/fastlane/plugins/templates/assets/plugin-badge.svg +1 -0
  31. data/lib/fastlane/plugins/templates/dot_gitignore.erb +8 -0
  32. data/lib/fastlane/plugins/templates/dot_rspec.erb +3 -0
  33. data/lib/fastlane/plugins/templates/helper.rb.erb +12 -0
  34. data/lib/fastlane/plugins/templates/plugin.gemspec.erb +26 -0
  35. data/lib/fastlane/plugins/templates/plugin.rb.erb +16 -0
  36. data/lib/fastlane/plugins/templates/spec_helper.rb.erb +8 -0
  37. data/lib/fastlane/plugins/templates/version.rb.erb +5 -0
  38. data/lib/fastlane/runner.rb +34 -12
  39. data/lib/fastlane/version.rb +1 -1
  40. metadata +55 -18
  41. data/lib/fastlane/actions/xcake.rb +0 -35
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f1d4a4bff3477ad2e6df2b81a2ddcdfd577d7b4f
4
- data.tar.gz: 75f1a9db251bbd7662503824567d4386a81bf7f6
3
+ metadata.gz: 11c062b639b48558f8a67f695822bd1221f686cc
4
+ data.tar.gz: 2c7f32bede228b71ad947f7588fbb90504444d92
5
5
  SHA512:
6
- metadata.gz: 012b1ca9c1e9f7c9734db2beb69b4e6379b88efd676a6278a1a129388c7f06b837939fb75f2af592b267721f416ee84bc7b62f50fc8e506c32a7b7d1c87f5362
7
- data.tar.gz: 600f5e8c1ca9f9309eda91fef62f47a2d9dbe66d10555eab8f99f9764067d1e5c76ef4bbaa52b145fdde4b69d992c86cbd733cbdd7f9c56e2d5f5784aacb93de
6
+ metadata.gz: 3c00514d3fa235fd2f1122437f5607d789cfa9d1155aade0843091b3c274307a967cb0fa7789d99a498cfef1277804b69d1986d8571d366e14d5c672e4f7a536
7
+ data.tar.gz: 34fa8b804fd61537df2d9a51ffe0270a3a58d6083b82bd1e25b2cb391546f2a734d2060ad684810b7a63bebe0cd64fad71ef580fadccced3385f3526a34eea1b
data/README.md CHANGED
@@ -173,6 +173,8 @@ See how [Wikipedia](https://github.com/fastlane/examples#wikipedia-by-wikimedia-
173
173
 
174
174
  You can easily opt-out by adding `opt_out_usage` to your `Fastfile` or by setting the environment variable `FASTLANE_OPT_OUT_USAGE`. To also disable update checks, set the `FASTLANE_SKIP_UPDATE_CHECK` variable.
175
175
 
176
+ You can optionally submit crash reports, run `fastlane enable_crash_reporting` to get started. This makes resolving issues much easier and helps improve fastlane. [More information](https://github.com/fastlane/fastlane/releases/tag/1.33.3)
177
+
176
178
  ## Credentials
177
179
  A detailed description about how `fastlane` stores your credentials is available on a [separate repo](https://github.com/fastlane/fastlane/tree/master/credentials_manager).
178
180
 
@@ -0,0 +1,8 @@
1
+ ### Available Plugins
2
+
3
+ | Plugin Name | Description | Downloads
4
+ --------------|-------------|----------|----------
5
+ <% @plugins.each do |current| %>
6
+ <%= current.linked_title %> | <%= current.info %> | <%= current.downloads %>
7
+
8
+ <% end %>
@@ -18,6 +18,7 @@ require 'fastlane/one_off'
18
18
  require 'fastlane/command_line_handler'
19
19
  require 'fastlane/documentation/docs_generator'
20
20
  require 'fastlane/other_action'
21
+ require 'fastlane/plugins/plugins'
21
22
 
22
23
  module Fastlane
23
24
  Helper = FastlaneCore::Helper # you gotta love Ruby: Helper.* should use the Helper class contained in FastlaneCore
@@ -1,8 +1,19 @@
1
1
  module Fastlane
2
2
  class ActionCollector < FastlaneCore::ToolCollector
3
+ # Is this an official fastlane action, that is bundled with fastlane?
3
4
  def is_official?(name)
4
5
  return true if name == :lane_switch
5
- Actions.get_all_official_actions.include? name
6
+ Actions.get_all_official_actions.include?(name)
7
+ end
8
+
9
+ def name_to_track(name)
10
+ return name if is_official?(name)
11
+
12
+ PluginManager.plugin_references.each do |plugin_name, value|
13
+ return "#{plugin_name}/#{name}" if value[:actions].include?(name)
14
+ end
15
+
16
+ return nil
6
17
  end
7
18
 
8
19
  def show_message
@@ -15,7 +26,28 @@ module Fastlane
15
26
  end
16
27
 
17
28
  def determine_version(name)
18
- super(name) || Fastlane::VERSION
29
+ self.class.determine_version(name)
30
+ end
31
+
32
+ # e.g.
33
+ # :gym
34
+ # :xcversion
35
+ # "fastlane-plugin-my_plugin/xcversion"
36
+ def self.determine_version(name)
37
+ return super(name) if super(name)
38
+
39
+ if name.to_s.include?(PluginManager.plugin_prefix)
40
+ # That's an action from a plugin, we need to fetch its version number
41
+ begin
42
+ plugin_name = name.split("/").first.gsub(PluginManager.plugin_prefix, '')
43
+ return Fastlane.const_get(plugin_name.fastlane_class)::VERSION
44
+ rescue => ex
45
+ UI.verbose(ex)
46
+ return "undefined"
47
+ end
48
+ end
49
+
50
+ return Fastlane::VERSION # that's the case for all built-in actions
19
51
  end
20
52
  end
21
53
  end
@@ -101,5 +101,9 @@ module Fastlane
101
101
  end
102
102
  end
103
103
  end
104
+
105
+ def self.formerly_bundled_actions
106
+ ["xcake"]
107
+ end
104
108
  end
105
109
  end
@@ -1,38 +1,26 @@
1
- require 'fileutils'
2
- require 'shellwords'
3
-
4
1
  module Fastlane
5
2
  module Actions
6
3
  class CopyArtifactsAction < Action
7
4
  def self.run(params)
8
5
  # we want to make sure that our target folder exist already
9
- FileUtils.mkdir_p(params[:target_path])
10
-
11
- # Ensure that artifacts is an array
12
- artifacts_to_search = [params[:artifacts]].flatten
6
+ target_folder_command = 'mkdir -p ' + params[:target_path]
7
+ Actions.sh(target_folder_command)
13
8
 
14
- # If any of the paths include "*", we assume that we are referring to the Unix entries
15
- # e.g /tmp/fastlane/* refers to all the files in /tmp/fastlane
16
- # We use Dir.glob to expand all those paths, this would create an array of arrays though, so flatten
17
- # Lastly, we shell escape everything in case they contain incompatible symbols (e.g. spaces)
18
- artifacts = artifacts_to_search.map { |f| f.include?("*") ? Dir.glob(f) : f }.flatten.map(&:shellescape)
9
+ # construct the main command that will do the copying/moving for us
10
+ base_command = params[:keep_original] ? 'cp' : 'mv'
11
+ options = []
12
+ options << '-f'
13
+ options << '-R' if params[:keep_original] # we only want the -R flag for the cp command, which we get when the user asks to keep the original
14
+ options << params[:artifacts].map { |e| e.tr(' ', '\ ') }
15
+ options << params[:target_path]
19
16
 
20
- UI.verbose("Copying artifacts #{artifacts.join(', ')} to #{params[:target_path]}")
21
- UI.verbose(params[:keep_original] ? "Keeping original files" : "Not keeping original files")
17
+ command = ([base_command] + options).join(' ')
22
18
 
23
- if params[:fail_on_missing]
24
- missing = artifacts.select { |a| !File.exist?(a) }
25
- UI.user_error! "Not all files were present in copy artifacts. Missing #{missing.join(', ')}" unless missing.empty?
26
- else
27
- # If we don't fail on non-existant files, don't try to copy non-existant files
28
- artifacts.reject! { |artifact| !File.exist?(artifact) }
29
- end
19
+ # if we don't want to fail on missing files, then we need to swallow the error from our command, by ORing with the nil command, guaranteeing a 0 status code
20
+ command += ' || :' unless params[:fail_on_missing]
30
21
 
31
- if params[:keep_original]
32
- FileUtils.cp_r(artifacts, params[:target_path], remove_destination: true)
33
- else
34
- FileUtils.mv(artifacts, params[:target_path], force: true)
35
- end
22
+ # call our command
23
+ Actions.sh(command)
36
24
 
37
25
  UI.success('Build artifacts successfully copied!')
38
26
  end
@@ -3,7 +3,7 @@ module Fastlane
3
3
  class JiraAction < Action
4
4
 
5
5
  def self.run(params)
6
- Actions.verify_gem!('jira-ruby')
6
+ Actions.verify_gem!('jira')
7
7
  require 'jira'
8
8
 
9
9
  site = params[:url]
@@ -23,11 +23,6 @@ module Fastlane
23
23
  command << "--allow-warnings"
24
24
  end
25
25
 
26
- command << "--use-libraries" if params[:use_libraries]
27
- command << "--fail-fast" if params[:fail_fast]
28
- command << "--private" if params[:private]
29
- command << "--quick" if params[:quick]
30
-
31
26
  result = Actions.sh(command.join(' '))
32
27
  UI.success("Pod lib lint Successfully ⬆️ ")
33
28
  return result
@@ -65,23 +60,7 @@ module Fastlane
65
60
  is_string: false,
66
61
  verify_block: proc do |value|
67
62
  UI.user_error!("Sources must be an array.") unless value.kind_of?(Array)
68
- end),
69
- FastlaneCore::ConfigItem.new(key: :use_libraries,
70
- description: "Lint uses static libraries to install the spec",
71
- is_string: false,
72
- default_value: false),
73
- FastlaneCore::ConfigItem.new(key: :fail_fast,
74
- description: "Lint stops on the first failing platform or subspec",
75
- is_string: false,
76
- default_value: false),
77
- FastlaneCore::ConfigItem.new(key: :private,
78
- description: "Lint skips checks that apply only to public specs",
79
- is_string: false,
80
- default_value: false),
81
- FastlaneCore::ConfigItem.new(key: :quick,
82
- description: "Lint skips checks that would require to download and build the spec",
83
- is_string: false,
84
- default_value: false)
63
+ end)
85
64
  ]
86
65
  end
87
66
 
@@ -1,6 +1,6 @@
1
1
  module Fastlane
2
2
  module Actions
3
- # Push local changes to the remote branch
3
+ # Adds a git tag to the current commit
4
4
  class PushToGitRemoteAction < Action
5
5
  def self.run(params)
6
6
  local_branch = params[:local_branch]
@@ -5,34 +5,27 @@ module Fastlane
5
5
  end
6
6
 
7
7
  class SlatherAction < Action
8
- # https://github.com/SlatherOrg/slather/blob/cbc5099cd25beb43fd978b7a3e5428f02230122d/lib/slather/command/coverage_command.rb#L24
8
+
9
9
  ARGS_MAP = {
10
- travis: '--travis',
11
- circleci: '--circleci',
12
- jenkins: '--jenkins',
13
- buildkite: '--buildkite',
14
- teamcity: '--teamcity',
15
-
16
- coveralls: '--coveralls',
17
- simple_output: '--simple-output',
18
- gutter_json: '--gutter-json',
19
- cobertura_xml: '--cobertura-xml',
20
- html: '--html',
21
- show: '--show',
22
-
23
- build_directory: '--build-directory',
24
- source_directory: '--source-directory',
25
- output_directory: '--output-directory',
26
- ignore: '--ignore',
27
- verbose: '--verbose',
28
-
29
- input_format: '--input-format',
30
- scheme: '--scheme',
31
- workspace: '--workspace',
32
- binary_file: '--binary-file',
33
- binary_basename: '--binary-basename',
34
- source_files: '--source-files',
35
- decimals: '--decimals'
10
+ build_directory: "--build-directory",
11
+ input_format: "--input-format",
12
+ scheme: "--scheme",
13
+ buildkite: "--buildkite",
14
+ jenkins: "--jenkins",
15
+ travis: "--travis",
16
+ circleci: "--circleci",
17
+ coveralls: "--coveralls",
18
+ simple_output: "--simple-output",
19
+ gutter_json: "--gutter-json",
20
+ cobertura_xml: "--cobertura-xml",
21
+ html: "--html",
22
+ show: "--show",
23
+ source_directory: "--source-directory",
24
+ output_directory: "--output-directory",
25
+ binary_basename: "--binary-basename",
26
+ binary_file: "--binary-file",
27
+ ignore: "--ignore",
28
+ workspace: "--workspace"
36
29
  }.freeze
37
30
 
38
31
  def self.run(params)
@@ -134,11 +127,6 @@ Slather is available at https://github.com/SlatherOrg/slather
134
127
  description: "Tell slather that it is running on Buildkite",
135
128
  is_string: false,
136
129
  optional: true),
137
- FastlaneCore::ConfigItem.new(key: :teamcity,
138
- env_name: "FL_SLATHER_TEAMCITY_ENABLED", # The name of the environment variable
139
- description: "Tell slather that it is running on TeamCity",
140
- is_string: false,
141
- optional: true),
142
130
  FastlaneCore::ConfigItem.new(key: :jenkins,
143
131
  env_name: "FL_SLATHER_JENKINS_ENABLED", # The name of the environment variable
144
132
  description: "Tell slather that it is running on Jenkins",
@@ -197,11 +185,6 @@ Slather is available at https://github.com/SlatherOrg/slather
197
185
  description: "Tell slather to ignore files matching a path or any path from an array of paths",
198
186
  is_string: false,
199
187
  optional: true),
200
- FastlaneCore::ConfigItem.new(key: :verbose,
201
- env_name: "FL_SLATHER_VERBOSE",
202
- description: "Tell slather to enable verbose mode",
203
- is_string: false,
204
- optional: true),
205
188
  FastlaneCore::ConfigItem.new(key: :use_bundle_exec,
206
189
  env_name: "FL_SLATHER_USE_BUNDLE_EXEC",
207
190
  description: "Use bundle exec to execute slather. Make sure it is in the Gemfile",
@@ -214,17 +197,7 @@ Slather is available at https://github.com/SlatherOrg/slather
214
197
  FastlaneCore::ConfigItem.new(key: :binary_file,
215
198
  env_name: "FL_SLATHER_BINARY_FILE",
216
199
  description: "Binary file name to be used for code coverage",
217
- default_value: false),
218
- FastlaneCore::ConfigItem.new(key: :source_files,
219
- env_name: "FL_SLATHER_SOURCE_FILES",
220
- description: "A Dir.glob compatible pattern used to limit the lookup to specific source files. Ignored in gcov mode",
221
- default_value: false,
222
- optional: true),
223
- FastlaneCore::ConfigItem.new(key: :decimals,
224
- env_name: "FL_SLATHER_DECIMALS",
225
- description: "The amount of decimals to use for % coverage reporting",
226
- default_value: false,
227
- optional: true)
200
+ default_value: false)
228
201
  ]
229
202
  end
230
203
 
@@ -10,6 +10,7 @@ module Fastlane
10
10
  def self.start
11
11
  FastlaneCore::UpdateChecker.start_looking_for_update('fastlane')
12
12
  Fastlane.load_actions
13
+ Fastlane::PluginManager.load_plugins
13
14
  self.new.run
14
15
  ensure
15
16
  FastlaneCore::UpdateChecker.show_update_status('fastlane', Fastlane::VERSION)
@@ -146,17 +147,17 @@ module Fastlane
146
147
 
147
148
  command :enable_crash_reporting do |c|
148
149
  c.syntax = 'fastlane enable_crash_reporting'
149
- c.description = "Deprecated: fastlane doesn't use a crash reporter any more"
150
+ c.description = 'Enable crash reporting to improve fastlane'
150
151
  c.action do |args, options|
151
- show_crashreporter_note
152
+ FastlaneCore::CrashReporting.enable
152
153
  end
153
154
  end
154
155
 
155
156
  command :disable_crash_reporting do |c|
156
157
  c.syntax = 'fastlane disable_crash_reporting'
157
- c.description = "Deprecated: fastlane doesn't use a crash reporter any more"
158
+ c.description = 'Disable crash reporting'
158
159
  c.action do |args, options|
159
- show_crashreporter_note
160
+ FastlaneCore::CrashReporting.disable
160
161
  end
161
162
  end
162
163
 
@@ -170,8 +171,64 @@ module Fastlane
170
171
  end
171
172
  end
172
173
 
173
- default_command :trigger
174
+ #####################################################
175
+ # @!group Plugins
176
+ #####################################################
177
+
178
+ command :new_plugin do |c|
179
+ c.syntax = 'fastlane create_plugin [plugin_name]'
180
+ c.description = 'Create a new plugin that can be used with fastlane'
181
+
182
+ c.action do |args, options|
183
+ PluginGenerator.new.generate args.shift
184
+ end
185
+ end
186
+
187
+ command :add_plugin do |c|
188
+ c.syntax = 'fastlane add_plugin [plugin_name]'
189
+ c.description = 'Add a new plugin to your fastlane setup'
190
+
191
+ c.action do |args, options|
192
+ pm = PluginManager.new
193
+ args << UI.input("Enter the name of the plugin to install: ") if args.empty?
194
+ args.each do |plugin_name|
195
+ pm.add_dependency(plugin_name)
196
+ end
197
+
198
+ UI.important("Make sure to commit your Gemfile, Gemfile.lock and #{PluginManager::PLUGINFILE_NAME} to version control")
199
+ pm.install_dependencies!
200
+ end
201
+ end
202
+
203
+ command :install_plugins do |c|
204
+ c.syntax = 'fastlane install_plugins'
205
+ c.description = 'Install all plugins for this project'
174
206
 
207
+ c.action do |args, options|
208
+ PluginManager.new.install_dependencies!
209
+ end
210
+ end
211
+
212
+ command :update_plugins do |c|
213
+ c.syntax = 'fastlane update_plugins'
214
+ c.description = 'Update all plugin dependencies'
215
+
216
+ c.action do |args, options|
217
+ PluginManager.new.update_dependencies!
218
+ end
219
+ end
220
+
221
+ command :search_plugins do |c|
222
+ c.syntax = 'fastlane search_plugins [search_query]'
223
+ c.description = 'Search for plugins, search query is optional'
224
+
225
+ c.action do |args, options|
226
+ search_query = args.last
227
+ PluginSearch.print_plugins(search_query: search_query)
228
+ end
229
+ end
230
+
231
+ default_command :trigger
175
232
  run!
176
233
  end
177
234
 
@@ -187,12 +244,6 @@ module Fastlane
187
244
  return false
188
245
  end
189
246
 
190
- def show_crashreporter_note
191
- UI.important("fastlane doesn't use a crash reporter any more")
192
- UI.important("Instead please submit an issue on GitHub: https://github.com/fastlane/fastlane/issues")
193
- UI.important("This command will be removed in one of the next releases")
194
- end
195
-
196
247
  # rubocop:enable Metrics/AbcSize
197
248
  # rubocop:enable Metrics/MethodLength
198
249
  end
@@ -44,10 +44,14 @@ module Fastlane
44
44
  e = nil
45
45
  begin
46
46
  ff.runner.execute(lane, platform, parameters)
47
- rescue => ex
47
+ rescue Exception => ex # rubocop:disable Lint/RescueException
48
+ # We also catch Exception, since the implemented action might send a SystemExit signal
49
+ # (or similar). We still want to catch that, since we want properly finish running fastlane
50
+ # Tested with `xcake`, which throws a `Xcake::Informative` object
51
+
48
52
  UI.important 'Variable Dump:'.yellow
49
53
  UI.message Actions.lane_context
50
- UI.error ex.to_s
54
+ UI.error ex.to_s if ex.kind_of?(StandardError) # we don't want to print things like 'system exit'
51
55
  e = ex
52
56
  end
53
57
 
@@ -29,7 +29,13 @@ module Fastlane
29
29
  begin
30
30
  class_ref = Fastlane::Actions.const_get(class_name)
31
31
  rescue NameError
32
- UI.user_error!("Action '#{action}' not available, run `fastlane actions` to get a full list")
32
+ if Fastlane::Actions.formerly_bundled_actions.include?(action)
33
+ # This was a formerly bundled action which is now a plugin.
34
+ UI.verbose(caller.join("\n"))
35
+ UI.user_error!("The action '#{action}' is no longer bundled with fastlane. You can install it using `fastlane add_plugin #{action}`")
36
+ else
37
+ UI.user_error!("Action '#{action}' not available, run `fastlane actions` to get a full list")
38
+ end
33
39
  end
34
40
 
35
41
  r = Runner.new