fastlane 1.81.0 → 1.82.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ce27a7eea1711d18517af6a465e48f9551cd68c6
4
- data.tar.gz: f254ce5d163818c4587d04ca6edd71c131ac11a9
3
+ metadata.gz: 7998aae1e3621d16b14ded685f639a0859638eb1
4
+ data.tar.gz: 0faeced9da7bf89dc50e8b18f78ee54caf1cb851
5
5
  SHA512:
6
- metadata.gz: 1a7cfa1bf3dc1f17ffac8c53bbbe6b8ee2028d7908c9ba0ac974799736103e1e963944f0e7b0f87282c3dde7fe10e7ecdccdd71d265773edf7291e7ef9c9cba9
7
- data.tar.gz: 152866a9bfa4cdcf5cd00eabf387bf46d6e75e81d1c458361cedb25ae2ea4cf277ec363488b3b2cfe530050d4b29facaba634c647e8c2f5f6f8b294dd2e6d2a3
6
+ metadata.gz: 45b6291fd8d7d746de441e7f6fb2abbaf199ec94f7689229d1519c16aaaee0b7a407175868cf1692d5860452b4750d8801c3bc250da267fda8c11ac56a7ed8b4
7
+ data.tar.gz: 034587e5406780a3cc5837e8ff85b37a54967fdad129a6ffd5baaf743b4a42bc169fb87df4d448f26995e22c35397882c0fc5b150365b94908714e47b37071f6
@@ -1,5 +1,5 @@
1
1
  # Customise this file, documentation can be found here:
2
- # https://github.com/fastlane/fastlane/tree/master/docs
2
+ # https://github.com/fastlane/fastlane/tree/master/fastlane/docs
3
3
  # All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md
4
4
  # can also be listed using the `fastlane actions` command
5
5
 
@@ -66,7 +66,7 @@ platform :ios do
66
66
  end
67
67
 
68
68
 
69
- # More information about multiple platforms in fastlane: https://github.com/fastlane/fastlane/blob/master/docs/Platforms.md
69
+ # More information about multiple platforms in fastlane: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
70
70
  # All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md
71
71
 
72
72
  # fastlane reports which actions are used
@@ -1,5 +1,5 @@
1
1
  # Customise this file, documentation can be found here:
2
- # https://github.com/fastlane/fastlane/tree/master/docs
2
+ # https://github.com/fastlane/fastlane/tree/master/fastlane/docs
3
3
  # All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md
4
4
  # can also be listed using the `fastlane actions` command
5
5
 
@@ -44,7 +44,7 @@ platform :android do
44
44
 
45
45
  after_all do |lane|
46
46
  # This block is called, only if the executed lane was successful
47
-
47
+
48
48
  # slack(
49
49
  # message: "Successfully deployed new App Update."
50
50
  # )
@@ -59,7 +59,7 @@ platform :android do
59
59
  end
60
60
 
61
61
 
62
- # More information about multiple platforms in fastlane: https://github.com/fastlane/fastlane/blob/master/docs/Platforms.md
62
+ # More information about multiple platforms in fastlane: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
63
63
  # All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md
64
64
 
65
65
  # fastlane reports which actions are used
@@ -8,6 +8,8 @@ _fastlane_complete() {
8
8
  file="Fastfile"
9
9
  elif [[ -e "fastlane/Fastfile" ]]; then
10
10
  file="fastlane/Fastfile"
11
+ elif [[ -e ".fastlane/Fastfile" ]] then
12
+ file=".fastlane/Fastfile"
11
13
  fi
12
14
 
13
15
  # parse 'beta' out of 'lane :beta do', etc
@@ -7,6 +7,8 @@ _fastlane_complete() {
7
7
  file="Fastfile"
8
8
  elif [[ -e "fastlane/Fastfile" ]] then
9
9
  file="fastlane/Fastfile"
10
+ elif [[ -e ".fastlane/Fastfile" ]] then
11
+ file=".fastlane/Fastfile"
10
12
  fi
11
13
 
12
14
  # parse 'beta' out of 'lane :beta do', etc
@@ -15,12 +15,11 @@ module Fastlane
15
15
  end
16
16
 
17
17
  def self.available_options
18
- # Return an array of 2-3 element arrays, like:
19
18
  # [
20
- # ['app_identifier', 'This value is responsible for X', 'ENVIRONMENT_VARIABLE'],
21
- # ['app_identifier', 'This value is responsible for X']
19
+ # FastlaneCore::ConfigItem.new(key: :ipa_path,
20
+ # env_name: "CRASHLYTICS_IPA_PATH",
21
+ # description: "Value Description")
22
22
  # ]
23
- # Take a look at sigh.rb if you're using the config manager of fastlane
24
23
  nil
25
24
  end
26
25
 
@@ -0,0 +1,41 @@
1
+ module Fastlane
2
+ module Actions
3
+ class DangerAction < Action
4
+ def self.run(params)
5
+ Actions.verify_gem!('danger')
6
+ cmd = []
7
+
8
+ cmd << ['bundle exec'] if File.exist?('Gemfile') && params[:use_bundle_exec]
9
+ cmd << ['danger']
10
+
11
+ Actions.sh(cmd.join(' '))
12
+ end
13
+
14
+ def self.description
15
+ "Runs `danger` for the project"
16
+ end
17
+
18
+ def self.details
19
+ "More information: https://github.com/danger/danger"
20
+ end
21
+
22
+ def self.available_options
23
+ [
24
+ FastlaneCore::ConfigItem.new(key: :use_bundle_exec,
25
+ env_name: "FL_DANGER_USE_BUNDLE_EXEC",
26
+ description: "Use bundle exec when there is a Gemfile presented",
27
+ is_string: false,
28
+ default_value: true)
29
+ ]
30
+ end
31
+
32
+ def self.is_supported?(platform)
33
+ true
34
+ end
35
+
36
+ def self.authors
37
+ ["KrauseFx"]
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,63 @@
1
+ module Fastlane
2
+ module Actions
3
+ class FlockAction < Action
4
+ BASE_URL = 'https://api.flock.co/hooks/sendMessage'.freeze
5
+
6
+ def self.run(options)
7
+ require 'net/http'
8
+ require 'uri'
9
+ require 'json'
10
+
11
+ notify_incoming_message_webhook(options[:base_url], options[:message], options[:token])
12
+ end
13
+
14
+ def self.notify_incoming_message_webhook(base_url, message, token)
15
+ uri = URI.join(base_url + '/', token)
16
+ response = Net::HTTP.start(
17
+ uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
18
+ request = Net::HTTP::Post.new uri.path
19
+ request.content_type = 'application/json'
20
+ request.body = JSON.generate("text" => message)
21
+ http.request request
22
+ end
23
+ if response.kind_of? Net::HTTPSuccess
24
+ UI.success 'Message sent to Flock.'
25
+ else
26
+ UI.error "HTTP request to '#{uri}' with message '#{message}' failed with a #{response.code} response."
27
+ UI.user_error! 'Error sending message to Flock. Please verify the Flock webhook token.'
28
+ end
29
+ end
30
+
31
+ def self.description
32
+ "Send a message to a Flock group"
33
+ end
34
+
35
+ def self.available_options
36
+ [
37
+ FastlaneCore::ConfigItem.new(key: :message,
38
+ env_name: 'FL_FLOCK_MESSAGE',
39
+ description: 'Message text'),
40
+ FastlaneCore::ConfigItem.new(key: :token,
41
+ env_name: 'FL_FLOCK_TOKEN',
42
+ description: 'Token for the Flock incoming webhook'),
43
+ FastlaneCore::ConfigItem.new(key: :base_url,
44
+ env_name: 'FL_FLOCK_BASE_URL',
45
+ description: 'Base URL of the Flock incoming message webhook',
46
+ optional: true,
47
+ default_value: BASE_URL,
48
+ verify_block: proc do |value|
49
+ UI.user_error! 'Invalid https URL' unless value.start_with? 'https://'
50
+ end)
51
+ ]
52
+ end
53
+
54
+ def self.author
55
+ "Manav"
56
+ end
57
+
58
+ def self.is_supported?(platform)
59
+ true
60
+ end
61
+ end
62
+ end
63
+ end
@@ -24,10 +24,17 @@ module Fastlane
24
24
  '&&'
25
25
  ].join(' ')
26
26
 
27
+ command_suffix = [
28
+ '&&',
29
+ 'cd',
30
+ '-'
31
+ ].join(' ')
32
+
27
33
  command = [
28
34
  command_prefix,
29
35
  'agvtool',
30
- params[:build_number] ? "new-version -all #{params[:build_number]}" : 'next-version -all'
36
+ params[:build_number] ? "new-version -all #{params[:build_number]}" : 'next-version -all',
37
+ command_suffix
31
38
  ].join(' ')
32
39
 
33
40
  if Helper.test?
@@ -4,24 +4,17 @@ module Fastlane
4
4
  def self.run(params)
5
5
  require 'terminal-notifier'
6
6
 
7
- if params[:subtitle] && params[:sound]
8
- TerminalNotifier.notify(params[:message],
9
- title: params[:title],
10
- subtitle: params[:subtitle],
11
- sound: params[:sound])
12
- elsif params[:subtitle]
13
- TerminalNotifier.notify(params[:message],
14
- title: params[:title],
15
- subtitle: params[:subtitle])
16
- elsif params[:sound]
17
- TerminalNotifier.notify(params[:message],
18
- title: params[:title],
19
- sound: params[:sound])
20
- else
21
- # It should look nice without a subtitle too
22
- TerminalNotifier.notify(params[:message],
23
- title: params[:title])
24
- end
7
+ options = params.values
8
+ # :message is non-optional
9
+ message = options.delete :message
10
+ # remove nil keys, since `notify` below does not ignore them and instead translates them into empty strings in output, which looks ugly
11
+ options = options.select { |_, v| v }
12
+ option_map = {
13
+ app_icon: :appIcon,
14
+ content_image: :contentImage
15
+ }
16
+ options = Hash[options.map { |k, v| [option_map.fetch(k, k), v] }]
17
+ TerminalNotifier.notify(message, options)
25
18
  end
26
19
 
27
20
  def self.description
@@ -29,7 +22,7 @@ module Fastlane
29
22
  end
30
23
 
31
24
  def self.author
32
- ["champo", "cbowns", "KrauseFx", "amarcadet"]
25
+ ["champo", "cbowns", "KrauseFx", "amarcadet", "dusek"]
33
26
  end
34
27
 
35
28
  def self.available_options
@@ -45,6 +38,21 @@ module Fastlane
45
38
  optional: false),
46
39
  FastlaneCore::ConfigItem.new(key: :sound,
47
40
  description: "The name of a sound to play when the notification appears (names are listed in Sound Preferences)",
41
+ optional: true),
42
+ FastlaneCore::ConfigItem.new(key: :activate,
43
+ description: "Bundle identifier of application to be opened when the notification is clicked",
44
+ optional: true),
45
+ FastlaneCore::ConfigItem.new(key: :app_icon,
46
+ description: "The URL of an image to display instead of the application icon (Mavericks+ only)",
47
+ optional: true),
48
+ FastlaneCore::ConfigItem.new(key: :content_image,
49
+ description: "The URL of an image to display attached to the notification (Mavericks+ only)",
50
+ optional: true),
51
+ FastlaneCore::ConfigItem.new(key: :open,
52
+ description: "URL of the resource to be opened when the notification is clicked",
53
+ optional: true),
54
+ FastlaneCore::ConfigItem.new(key: :execute,
55
+ description: "Shell command to run when the notification is clicked",
48
56
  optional: true)
49
57
  ]
50
58
  end
@@ -24,7 +24,8 @@ module Fastlane
24
24
  output_directory: "--output-directory",
25
25
  binary_basename: "--binary-basename",
26
26
  binary_file: "--binary-file",
27
- ignore: "--ignore"
27
+ ignore: "--ignore",
28
+ workspace: "--workspace"
28
29
  }.freeze
29
30
 
30
31
  def self.run(params)
@@ -91,6 +92,11 @@ Slather is available at https://github.com/SlatherOrg/slather
91
92
  verify_block: proc do |value|
92
93
  UI.user_error!("No project file specified, pass using `proj: 'Project.xcodeproj'`") unless value and !value.empty?
93
94
  end),
95
+ FastlaneCore::ConfigItem.new(key: :workspace,
96
+ env_name: "FL_SLATHER_WORKSPACE",
97
+ description: "The workspace that slather looks at",
98
+ optional: true
99
+ ),
94
100
  FastlaneCore::ConfigItem.new(key: :scheme,
95
101
  env_name: "FL_SLATHER_SCHEME", # The name of the environment variable
96
102
  description: "Scheme to use when calling slather",
@@ -148,7 +154,7 @@ Slather is available at https://github.com/SlatherOrg/slather
148
154
  optional: true),
149
155
  FastlaneCore::ConfigItem.new(key: :show,
150
156
  env_name: "FL_SLATHER_SHOW_ENABLED",
151
- description: "Tell slather that it should oupen static html pages automatically",
157
+ description: "Tell slather that it should open static html pages automatically",
152
158
  is_string: false,
153
159
  default_value: false),
154
160
  FastlaneCore::ConfigItem.new(key: :source_directory,
@@ -6,8 +6,8 @@ module Fastlane
6
6
  class UpdateProjectCodeSigningAction < Action
7
7
  def self.run(params)
8
8
  UI.message("You shouldn't use update_project_code_signing")
9
- UI.message("Have you considered using the recommended way to do code sining?")
10
- UI.message("https://github.com/fastlane/fastlane/blob/master/docs/CodeSigning.md")
9
+ UI.message("Have you considered using the recommended way to do code signing?")
10
+ UI.message("https://github.com/fastlane/fastlane/blob/master/fastlane/docs/CodeSigning.md")
11
11
 
12
12
  path = params[:path]
13
13
  path = File.join(path, "project.pbxproj")
@@ -1,3 +1,4 @@
1
+ # coding: utf-8
1
2
  # rubocop:disable Metrics/AbcSize
2
3
  module Fastlane
3
4
  module Actions
@@ -8,7 +9,7 @@ module Fastlane
8
9
  ROOT_CERTIFICATE_URL = "http://www.apple.com/appleca/AppleIncRootCertificate.cer"
9
10
  def self.run(params)
10
11
  UI.message("You’re updating provisioning profiles directly in your project, but have you considered easier ways to do code signing?")
11
- UI.message("https://github.com/fastlane/fastlane/blob/master/docs/CodeSigning.md")
12
+ UI.message("https://github.com/fastlane/fastlane/blob/master/fastlane/docs/CodeSigning.md")
12
13
 
13
14
  # assign folder from parameter or search for xcodeproj file
14
15
  folder = params[:xcodeproj] || Dir["*.xcodeproj"].first
@@ -52,7 +52,7 @@ module Fastlane
52
52
  def self.upload_dsym(params, path)
53
53
  UI.message("Uploading '#{path}'...")
54
54
  command = []
55
- command << params[:binary_path]
55
+ command << params[:binary_path].shellescape
56
56
  command << "-a #{params[:api_token]}"
57
57
  command << "-p #{params[:platform]}"
58
58
  command << File.expand_path(path).shellescape
@@ -1,3 +1,5 @@
1
+ require 'shellwords'
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  module SharedValues
@@ -5,31 +7,58 @@ module Fastlane
5
7
 
6
8
  class VerifyXcodeAction < Action
7
9
  def self.run(params)
8
- UI.success("Verifying your Xcode installation at path '#{params[:xcode_path]}'...")
10
+ UI.message("Verifying your Xcode installation at path '#{params[:xcode_path]}'...")
9
11
 
10
12
  # Check 1/2
13
+ verify_codesign(params)
11
14
 
12
- UI.success("Verifying Xcode was signed by Apple Inc.")
13
- command = "codesign --display --verbose=4 '#{params[:xcode_path]}'"
15
+ # Check 2/2
16
+ # More information https://developer.apple.com/news/?id=09222015a
17
+ verify_gatekeeper(params)
14
18
 
15
- must_includes = [
16
- "Identifier=com.apple.dt.Xcode",
17
- "Authority=Apple Mac OS Application Signing",
18
- "Authority=Apple Worldwide Developer Relations Certification Authority",
19
- "Authority=Apple Root CA",
20
- "TeamIdentifier=59GAB85EFG"
19
+ true
20
+ end
21
+
22
+ def self.verify_codesign(params)
23
+ UI.message("Verifying Xcode was signed by Apple Inc.")
24
+
25
+ codesign_output = Actions.sh("codesign --display --verbose=4 #{params[:xcode_path].shellescape}")
26
+
27
+ # If the returned codesign info contains all entries for any one of these sets, we'll consider it valid
28
+ accepted_codesign_detail_sets = [
29
+ [ # Found on App Store installed Xcode installations
30
+ "Identifier=com.apple.dt.Xcode",
31
+ "Authority=Apple Mac OS Application Signing",
32
+ "Authority=Apple Worldwide Developer Relations Certification Authority",
33
+ "Authority=Apple Root CA",
34
+ "TeamIdentifier=59GAB85EFG"
35
+ ],
36
+ [ # Found on Xcode installations downloaded from developer.apple.com
37
+ "Identifier=com.apple.dt.Xcode",
38
+ "Authority=Software Signing",
39
+ "Authority=Apple Code Signing Certification Authority",
40
+ "Authority=Apple Root CA",
41
+ "TeamIdentifier=not set"
42
+ ]
21
43
  ]
22
44
 
23
- verify(command: command, must_includes: must_includes, params: params)
45
+ # Map the accepted details sets into an equal number of sets collecting the details for which
46
+ # the output of codesign did not have matches
47
+ missing_details_sets = accepted_codesign_detail_sets.map do |accepted_details_set|
48
+ accepted_details_set.reject { |detail| codesign_output.include?(detail) }
49
+ end
50
+
51
+ # If any of the sets is empty, it means that all details were matched, and the check is successful
52
+ show_and_raise_error(nil, params[:xcode_path]) unless missing_details_sets.any?(&:empty?)
24
53
 
25
- UI.success("Successfully verified the code signature")
54
+ UI.success("Successfully verified the code signature")
55
+ end
26
56
 
27
- # Check 2/2
28
- # More information https://developer.apple.com/news/?id=09222015a
57
+ def self.verify_gatekeeper(params)
29
58
  UI.message("Verifying Xcode using GateKeeper...")
30
- UI.success("This will take up to a few minutes, now is a great time to go for a coffee ☕...")
59
+ UI.message("This will take up to a few minutes, now is a great time to go for a coffee ☕...")
31
60
 
32
- command = "/usr/sbin/spctl --assess --verbose '#{params[:xcode_path]}'"
61
+ command = "/usr/sbin/spctl --assess --verbose #{params[:xcode_path].shellescape}"
33
62
  must_includes = ['accepted']
34
63
 
35
64
  output = verify(command: command, must_includes: must_includes, params: params)
@@ -39,8 +68,6 @@ module Fastlane
39
68
  else
40
69
  show_and_raise_error("Invalid Download Source of Xcode: #{output}", params[:xcode_path])
41
70
  end
42
-
43
- true
44
71
  end
45
72
 
46
73
  def self.verify(command: nil, must_includes: nil, params: nil)
@@ -60,11 +87,13 @@ module Fastlane
60
87
  end
61
88
 
62
89
  def self.show_and_raise_error(error, xcode_path)
63
- UI.error("Attention: Your Xcode Installation might be hacked.")
64
- UI.error("This might be a false alarm, if so, please submit an issue on GitHub")
65
- UI.error("The following information couldn't be found:")
66
- UI.error(error)
67
- UI.user_error!("The Xcode installation at path '#{xcode_path}' might be compromised.")
90
+ UI.error("Attention: Your Xcode Installation could not be verified.")
91
+ UI.error("If you believe that your Xcode is valid, please submit an issue on GitHub")
92
+ if error
93
+ UI.error("The following information couldn't be found:")
94
+ UI.error(error)
95
+ end
96
+ UI.user_error!("The Xcode installation at path '#{xcode_path}' could not be verified.")
68
97
  end
69
98
 
70
99
  #####################################################
@@ -77,7 +106,7 @@ module Fastlane
77
106
 
78
107
  def self.details
79
108
  [
80
- "This action was implemented after the recent Xcode attacked to make sure",
109
+ "This action was implemented after the recent Xcode attack to make sure",
81
110
  "you're not using a hacked Xcode installation.",
82
111
  "http://researchcenter.paloaltonetworks.com/2015/09/novel-malware-xcodeghost-modifies-xcode-infects-apple-ios-apps-and-hits-app-store/"
83
112
  ].join("\n")
@@ -1,5 +1,3 @@
1
- # rubocop:disable Metrics/AbcSize
2
- # rubocop:disable Metrics/MethodLength
3
1
  module Fastlane
4
2
  class ActionsList
5
3
  def self.run(filter: nil, platform: nil)
@@ -24,18 +22,18 @@ module Fastlane
24
22
  current << authors.first.green if authors.count == 1
25
23
  current << "Multiple".green if authors.count > 1
26
24
  else
27
- UI.error("Please update your action file #{name} to be a subclass of `Action` by adding ` < Action` after your class name.")
25
+ UI.error action_subclass_error(name)
28
26
  current << "Please update action file".red
27
+ current << ' '
29
28
  end
30
29
  rows << current
31
30
  end
32
31
 
33
- table = Terminal::Table.new(
32
+ puts Terminal::Table.new(
34
33
  title: "Available fastlane actions".green,
35
34
  headings: ['Action', 'Description', 'Author'],
36
35
  rows: rows
37
36
  )
38
- puts table
39
37
  puts " Platform filter: #{platform}".magenta if platform
40
38
  puts " Total of #{rows.count} actions"
41
39
 
@@ -44,100 +42,119 @@ module Fastlane
44
42
 
45
43
  def self.show_details(filter: nil)
46
44
  puts "Loading documentation for #{filter}:".green
47
-
48
45
  puts ""
49
46
 
50
- all_actions do |action, name|
51
- next unless name == filter.strip
47
+ action = find_action_named(filter)
52
48
 
53
- rows = []
54
- rows << [action.description] if action.description
55
- rows << [' ']
56
- if action.details
57
- rows << [action.details]
58
- rows << [' ']
49
+ if action
50
+ unless action < Action
51
+ UI.user_error! action_subclass_error(filter)
59
52
  end
60
53
 
61
- authors = Array(action.author || action.authors)
54
+ print_summary(action, filter)
55
+ print_options(action, filter)
56
+ print_output_variables(action, filter)
57
+ print_return_value(action, filter)
62
58
 
63
- rows << ["Created by #{authors.join(', ').green}"] if authors.count > 0
59
+ puts "More information can be found on https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md"
60
+ puts ""
61
+ else
62
+ puts "Couldn't find action for the given filter.".red
63
+ puts "==========================================\n".red
64
+ print_all # show all available actions instead
65
+ end
66
+ end
64
67
 
65
- puts Terminal::Table.new(
66
- title: filter.green,
67
- rows: rows
68
- )
68
+ def self.action_subclass_error(name)
69
+ "Please update your action '#{name}' to be a subclass of `Action` by adding ` < Action` after your class name."
70
+ end
69
71
 
70
- puts "\n"
71
-
72
- options = parse_options(action.available_options) if action.available_options
73
-
74
- if options
75
- puts Terminal::Table.new(
76
- title: filter.green,
77
- headings: ['Key', 'Description', 'Env Var'],
78
- rows: options
79
- )
80
- required_count = action.available_options.count do |o|
81
- if o.kind_of?(FastlaneCore::ConfigItem)
82
- o.optional == false
83
- else
84
- false
85
- end
86
- end
72
+ def self.print_summary(action, name)
73
+ rows = []
87
74
 
88
- if required_count > 0
89
- puts "#{required_count} of the available parameters are required".magenta
90
- puts "They are marked with an asterisk *".magenta
91
- end
92
- else
93
- puts "No available options".yellow
94
- end
95
- puts "\n"
96
-
97
- output = parse_options(action.output, false) if action.output
98
- if output and output.count > 0
99
- puts Terminal::Table.new(
100
- title: [filter, "| Output Variables"].join(" ").green,
101
- headings: ['Key', 'Description'],
102
- rows: output
103
- )
104
- puts "Access the output values using `lane_context[SharedValues::VARIABLE_NAME]`"
105
- puts ""
75
+ if action.description
76
+ rows << [action.description]
77
+ rows << [' ']
78
+ end
79
+
80
+ if action.details
81
+ rows << [action.details]
82
+ rows << [' ']
83
+ end
84
+
85
+ authors = Array(action.author || action.authors)
86
+ rows << ["Created by #{authors.join(', ').green}"] unless authors.empty?
87
+
88
+ puts Terminal::Table.new(title: name.green, rows: rows)
89
+ puts ""
90
+ end
91
+
92
+ def self.print_options(action, name)
93
+ options = parse_options(action.available_options) if action.available_options
94
+
95
+ if options
96
+ puts Terminal::Table.new(
97
+ title: "#{name} Options".green,
98
+ headings: ['Key', 'Description', 'Env Var', 'Default'],
99
+ rows: options
100
+ )
101
+ required_count = action.available_options.count do |o|
102
+ o.kind_of?(FastlaneCore::ConfigItem) && o.optional == false
106
103
  end
107
104
 
108
- if action.return_value
109
- puts Terminal::Table.new(
110
- title: "Return Value".green,
111
- headings: [],
112
- rows: [[action.return_value]]
113
- )
114
- puts ""
105
+ if required_count > 0
106
+ puts "#{required_count} of the available parameters are required".magenta
107
+ puts "They are marked with an asterisk *".magenta
115
108
  end
109
+ else
110
+ puts "No available options".yellow
111
+ end
112
+ puts ""
113
+ end
116
114
 
117
- puts "More information can be found on https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md"
118
- puts "\n"
115
+ def self.print_output_variables(action, name)
116
+ output = action.output
117
+ return if output.nil? || output.empty?
119
118
 
120
- return # our job is done here
121
- end
119
+ puts Terminal::Table.new(
120
+ title: "#{name} Output Variables".green,
121
+ headings: ['Key', 'Description'],
122
+ rows: output.map { |key, desc| [key.yellow, desc] }
123
+ )
124
+ puts "Access the output values using `lane_context[SharedValues::VARIABLE_NAME]`"
125
+ puts ""
126
+ end
122
127
 
123
- puts "Couldn't find action for the given filter.".red
124
- puts "==========================================\n".red
125
- print_all # show all available actions instead
128
+ def self.print_return_value(action, name)
129
+ return unless action.return_value
130
+
131
+ puts Terminal::Table.new(title: "#{name} Return Value".green, rows: [[action.return_value]])
132
+ puts ""
126
133
  end
127
134
 
128
135
  # Iterates through all available actions and yields from there
129
136
  def self.all_actions(platform = nil)
130
- all_actions = Fastlane::Actions.constants.select {|c| Fastlane::Actions.const_get(c).kind_of? Class }
131
- all_actions.sort.each do |symbol|
137
+ action_symbols = Fastlane::Actions.constants.select {|c| Fastlane::Actions.const_get(c).kind_of? Class }
138
+ action_symbols.sort.each do |symbol|
132
139
  action = Fastlane::Actions.const_get(symbol)
133
140
 
134
- next if platform && !action.is_supported?(platform.to_sym)
141
+ # We allow classes that don't respond to is_supported? to come through because we want to list
142
+ # them as broken actions in the table, regardless of platform specification
143
+ next if platform && action.respond_to?(:is_supported?) && !action.is_supported?(platform.to_sym)
135
144
 
136
145
  name = symbol.to_s.gsub('Action', '').fastlane_underscore
137
146
  yield action, name
138
147
  end
139
148
  end
140
149
 
150
+ def self.find_action_named(name)
151
+ all_actions do |action, action_name|
152
+ return action if action_name == name
153
+ end
154
+
155
+ nil
156
+ end
157
+
141
158
  # Helper:
142
159
  def self.parse_options(options, fill_all = true)
143
160
  rows = []
@@ -147,10 +164,7 @@ module Fastlane
147
164
  options.each do |current|
148
165
  if current.kind_of? FastlaneCore::ConfigItem
149
166
  key_name = (current.optional ? " " : "* ") + current.key.to_s
150
- description = (current.description || '') + (current.default_value ? " (default: '#{current.default_value}')" : "")
151
-
152
- rows << [key_name.yellow, description, current.env_name]
153
-
167
+ rows << [key_name.yellow, current.description, current.env_name, current.default_value]
154
168
  elsif current.kind_of? Array
155
169
  # Legacy actions that don't use the new config manager
156
170
  UI.user_error!("Invalid number of elements in this row: #{current}. Must be 2 or 3") unless [2, 3].include? current.count
@@ -165,5 +179,3 @@ module Fastlane
165
179
  end
166
180
  end
167
181
  end
168
- # rubocop:enable Metrics/AbcSize
169
- # rubocop:enable Metrics/MethodLength
@@ -41,7 +41,7 @@ module Fastlane
41
41
  else
42
42
  message = "Shell command exited with exit status #{exit_status} instead of 0."
43
43
  end
44
- UI.crash!(message)
44
+ UI.user_error!(message)
45
45
  end
46
46
  end
47
47
 
@@ -1,3 +1,3 @@
1
1
  module Fastlane
2
- VERSION = '1.81.0'.freeze
2
+ VERSION = '1.82.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.81.0
4
+ version: 1.82.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-08 00:00:00.000000000 Z
11
+ date: 2016-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: krausefx-shenzhen
@@ -148,7 +148,7 @@ dependencies:
148
148
  requirements:
149
149
  - - ">="
150
150
  - !ruby/object:Gem::Version
151
- version: 0.41.2
151
+ version: 0.42.0
152
152
  - - "<"
153
153
  - !ruby/object:Gem::Version
154
154
  version: 1.0.0
@@ -158,7 +158,7 @@ dependencies:
158
158
  requirements:
159
159
  - - ">="
160
160
  - !ruby/object:Gem::Version
161
- version: 0.41.2
161
+ version: 0.42.0
162
162
  - - "<"
163
163
  - !ruby/object:Gem::Version
164
164
  version: 1.0.0
@@ -701,6 +701,7 @@ files:
701
701
  - lib/fastlane/actions/crashlytics.rb
702
702
  - lib/fastlane/actions/create_keychain.rb
703
703
  - lib/fastlane/actions/create_pull_request.rb
704
+ - lib/fastlane/actions/danger.rb
704
705
  - lib/fastlane/actions/debug.rb
705
706
  - lib/fastlane/actions/default_platform.rb
706
707
  - lib/fastlane/actions/delete_keychain.rb
@@ -716,6 +717,7 @@ files:
716
717
  - lib/fastlane/actions/ensure_xcode_version.rb
717
718
  - lib/fastlane/actions/erb.rb
718
719
  - lib/fastlane/actions/fastlane_version.rb
720
+ - lib/fastlane/actions/flock.rb
719
721
  - lib/fastlane/actions/frameit.rb
720
722
  - lib/fastlane/actions/gcovr.rb
721
723
  - lib/fastlane/actions/get_build_number.rb