fastlane 1.85.0 → 1.86.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: 5f00e39921c28effcc81677360d5922347caee20
4
- data.tar.gz: 49c4f159f75869eda5692feff918c76827fa7b8e
3
+ metadata.gz: f9c9b5874340da8868b5536d71f394c40aea0705
4
+ data.tar.gz: 8fadb3ff20ccc551f5d0933089dea99dab1974da
5
5
  SHA512:
6
- metadata.gz: bce5e5db952069eee25cd64dab6da6ca2ae1ed2dd028795bffade38b895c7739f9972f107f52eb041ab7ff384e4b0d8267d90385858076488d5f11bf51601a1d
7
- data.tar.gz: e42639ca6e7697722a4120d5ca8b6ed53822292f0e7921c82907c32d80ee10945c80a65d7d18ab460de9bfb6983f784ef3b87688edf4f10e82344f3fdb222ba1
6
+ metadata.gz: 104f28cc136ea24e172200213dffdf3c5bf300ef1cce035f1f72c77fb140d3c621a1e8f0e392cc1e5fe313bf1a37d3545dc7f7e87c00b5da95254a8147c29676
7
+ data.tar.gz: 5777323ac3e25f85a78a587a5ffeffeaab262288700d821c1e31f5c9238cbb0b6076030d98309dbcef271b27927cd33bddd770d9206f13081fbb4e6d92b216be
data/bin/fastlane CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
  $LOAD_PATH.push File.expand_path("../../lib", __FILE__)
3
3
 
4
- require "fastlane"
5
- require "fastlane/commands_generator"
6
- Fastlane::CommandsGenerator.start
4
+ require "fastlane/cli_tools_distributor"
5
+ Fastlane::CLIToolsDistributor.take_off
data/bin//360/237/232/200 CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
  $LOAD_PATH.push File.expand_path("../../lib", __FILE__)
3
3
 
4
- require "fastlane"
5
- require "fastlane/commands_generator"
6
- Fastlane::CommandsGenerator.start
4
+ require "fastlane/cli_tools_distributor"
5
+ Fastlane::CLIToolsDistributor.take_off
data/lib/fastlane.rb CHANGED
@@ -2,6 +2,7 @@ require 'fastlane_core'
2
2
 
3
3
  require 'fastlane/core_ext/string' # this has to be above most of the other requires
4
4
  require 'fastlane/version'
5
+ require 'fastlane/tools'
5
6
  require 'fastlane/actions/actions_helper' # has to be before fast_file
6
7
  require 'fastlane/fast_file'
7
8
  require 'fastlane/runner'
@@ -17,16 +18,19 @@ require 'fastlane/configuration_helper'
17
18
  require 'fastlane/one_off'
18
19
  require 'fastlane/command_line_handler'
19
20
  require 'fastlane/documentation/docs_generator'
21
+ require 'fastlane/other_action'
20
22
 
21
23
  module Fastlane
22
24
  Helper = FastlaneCore::Helper # you gotta love Ruby: Helper.* should use the Helper class contained in FastlaneCore
23
25
  UI = FastlaneCore::UI
24
26
 
25
- Fastlane::Actions.load_default_actions
26
- Fastlane::Actions.load_helpers
27
+ def self.load_actions
28
+ Fastlane::Actions.load_default_actions
29
+ Fastlane::Actions.load_helpers
27
30
 
28
- if Fastlane::FastlaneFolder.path
29
- actions_path = File.join(Fastlane::FastlaneFolder.path, 'actions')
30
- Fastlane::Actions.load_external_actions(actions_path) if File.directory?(actions_path)
31
+ if Fastlane::FastlaneFolder.path
32
+ actions_path = File.join(Fastlane::FastlaneFolder.path, 'actions')
33
+ Fastlane::Actions.load_external_actions(actions_path) if File.directory?(actions_path)
34
+ end
31
35
  end
32
36
  end
@@ -2,6 +2,10 @@ require 'fastlane/actions/actions_helper'
2
2
 
3
3
  module Fastlane
4
4
  class Action
5
+ class << self
6
+ attr_accessor :runner
7
+ end
8
+
5
9
  def self.run(params)
6
10
  end
7
11
 
@@ -62,13 +66,26 @@ module Fastlane
62
66
  end
63
67
 
64
68
  # to allow a simple `sh` in the custom actions
65
- def self.sh(command, print_command: true, print_command_output: true)
66
- Fastlane::Actions.sh_control_output(command, print_command: print_command, print_command_output: print_command_output)
69
+ def self.sh(command, print_command: true, print_command_output: true, error_callback: nil)
70
+ Fastlane::Actions.sh_control_output(command, print_command: print_command, print_command_output: print_command_output, error_callback: error_callback)
67
71
  end
68
72
 
69
73
  # instead of "AddGitAction", this will return "add_git" to print it to the user
70
74
  def self.action_name
71
75
  self.name.split('::').last.gsub('Action', '').fastlane_underscore
72
76
  end
77
+
78
+ # Allows the user to call an action from an action
79
+ def self.method_missing(method_sym, *arguments, &_block)
80
+ UI.error("Unknown method '#{method_sym}'")
81
+ UI.user_error!("To call another action from an action use `OtherAction.#{method_sym}` instead")
82
+ end
83
+
84
+ # Return a new instance of the OtherAction action
85
+ # We need to do this, since it has to have access to
86
+ # the runner object
87
+ def self.other_action
88
+ return OtherAction.new(self.runner)
89
+ end
73
90
  end
74
91
  end
@@ -43,7 +43,7 @@ module Fastlane
43
43
  params = { store_id: store_id, api_key: api_key, key: path }
44
44
  uri.query = URI.encode_www_form(params)
45
45
  url_for_download_response = Net::HTTP.get_response(uri)
46
- if url_for_download_response.kind_of?(Net::HTTPNotFound)
46
+ if invalid_response?(url_for_download_response)
47
47
  UI.user_error!("ERROR: A problem occurred with your API token and your store id. Please try again.")
48
48
  end
49
49
  json_res = JSON.parse(url_for_download_response.body)
@@ -99,6 +99,7 @@ module Fastlane
99
99
  screenshots = all_screenshots_links(screenshots)
100
100
  uri = URI("#{APPALOOSA_SERVER}/#{store_id}/mobile_application_updates/upload")
101
101
  http = Net::HTTP.new(uri.host, uri.port)
102
+ http.use_ssl = true
102
103
  req = Net::HTTP::Post.new(uri.path, { 'Content-Type' => 'application/json' })
103
104
  req.body = { store_id: store_id,
104
105
  api_key: api_key,
@@ -216,6 +217,11 @@ module Fastlane
216
217
  def self.is_supported?(platform)
217
218
  [:ios, :mac, :android].include? platform
218
219
  end
220
+
221
+ def self.invalid_response?(url_for_download_response)
222
+ url_for_download_response.kind_of?(Net::HTTPNotFound) ||
223
+ url_for_download_response.kind_of?(Net::HTTPForbidden)
224
+ end
219
225
  end
220
226
  end
221
227
  end
@@ -0,0 +1,89 @@
1
+ module Fastlane
2
+ module Actions
3
+ class ApteligentAction < Action
4
+ def self.run(params)
5
+ command = []
6
+ command << "curl"
7
+ command += upload_options(params)
8
+ command << upload_url(params[:app_id].shellescape)
9
+
10
+ # Fastlane::Actions.sh has buffering issues, no progress bar is shown in real time
11
+ # will reanable it when it is fixed
12
+ # result = Fastlane::Actions.sh(command.join(' '), log: false)
13
+ shell_command = command.join(' ')
14
+ return shell_command if Helper.is_test?
15
+ result = Actions.sh(shell_command)
16
+ fail_on_error(result)
17
+ end
18
+
19
+ def self.fail_on_error(result)
20
+ if result != "200"
21
+ UI.crash! "Server error, failed to upload the dSYM file."
22
+ else
23
+ UI.success 'dSYM successfully uploaded to Apteligent!'
24
+ end
25
+ end
26
+
27
+ def self.upload_url(app_id)
28
+ "https://api.crittercism.com/api_beta/dsym/#{app_id}"
29
+ end
30
+
31
+ def self.dsym_path(params)
32
+ file_path = params[:dsym]
33
+ file_path ||= Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH] || ENV[SharedValues::DSYM_OUTPUT_PATH.to_s]
34
+ file_path ||= Actions.lane_context[SharedValues::DSYM_ZIP_PATH] || ENV[SharedValues::DSYM_ZIP_PATH.to_s]
35
+
36
+ if file_path
37
+ expanded_file_path = File.expand_path(file_path)
38
+ UI.user_error!("Couldn't find file at path '#{expanded_file_path}'") unless File.exist?(expanded_file_path)
39
+ return expanded_file_path
40
+ else
41
+ UI.user_error!("Couldn't find dSYM file")
42
+ end
43
+ end
44
+
45
+ def self.upload_options(params)
46
+ file_path = dsym_path(params).shellescape
47
+
48
+ options = []
49
+ options << "--write-out %{http_code} --silent --output /dev/null"
50
+ options << "-F dsym=@#{file_path}"
51
+ options << "-F key=#{params[:api_key].shellescape}"
52
+ options
53
+ end
54
+
55
+ #####################################################
56
+ # @!group Documentation
57
+ #####################################################
58
+
59
+ def self.description
60
+ "Upload dSYM file to Apteligent (Crittercism)"
61
+ end
62
+
63
+ def self.available_options
64
+ [
65
+ FastlaneCore::ConfigItem.new(key: :dsym,
66
+ env_name: "FL_APTELIGENT_FILE",
67
+ description: "dSYM.zip file to upload to Apteligent",
68
+ optional: true),
69
+ FastlaneCore::ConfigItem.new(key: :app_id,
70
+ env_name: "FL_APTELIGENT_APP_ID",
71
+ description: "Apteligent App ID key e.g. 569f5c87cb99e10e00c7xxxx",
72
+ optional: false),
73
+ FastlaneCore::ConfigItem.new(key: :api_key,
74
+ env_name: "FL_APTELIGENT_API_KEY",
75
+ description: "Apteligent App API key e.g. IXPQIi8yCbHaLliqzRoo065tH0lxxxxx",
76
+ optional: false)
77
+ ]
78
+ end
79
+
80
+ def self.authors
81
+ ["Mo7amedFouad"]
82
+ end
83
+
84
+ def self.is_supported?(platform)
85
+ platform == :ios
86
+ end
87
+ end
88
+ end
89
+ end
@@ -28,11 +28,29 @@ module Fastlane
28
28
  end
29
29
 
30
30
  UI.success('Uploading the build to Crashlytics Beta. Time for some ☕️.')
31
- UI.verbose(command.join(" ")) if $verbose
32
- Actions.sh(command.join(" "), log: false)
31
+
32
+ sanitizer = proc do |message|
33
+ message.gsub(params[:api_token], '[[API_TOKEN]]')
34
+ .gsub(params[:build_secret], '[[BUILD_SECRET]]')
35
+ end
36
+
37
+ UI.verbose sanitizer.call(command.join(' ')) if $verbose
38
+
39
+ error_callback = proc do |error|
40
+ clean_error = sanitizer.call(error)
41
+ UI.error(clean_error)
42
+ end
43
+
44
+ result = Actions.sh_control_output(
45
+ command.join(" "),
46
+ print_command: false,
47
+ print_command_output: false,
48
+ error_callback: error_callback)
33
49
 
34
50
  return command if Helper.test?
35
51
 
52
+ UI.verbose sanitizer.call(result) if $verbose
53
+
36
54
  UI.success('Build successfully uploaded to Crashlytics Beta 🌷')
37
55
  end
38
56
 
@@ -41,12 +59,23 @@ module Fastlane
41
59
  end
42
60
 
43
61
  def self.available_options
62
+ platform = Actions.lane_context[Actions::SharedValues::PLATFORM_NAME]
63
+
64
+ ipa_path_default = nil
65
+ if platform == :ios or platform.nil?
66
+ ipa_path_default = Dir["*.ipa"].last
67
+ end
68
+ apk_path_default = nil
69
+ if platform == :android
70
+ apk_path_default = Dir["*.apk"].last || Dir[File.join("app", "build", "outputs", "apk", "app-release.apk")].last
71
+ end
72
+
44
73
  [
45
74
  # iOS Specific
46
75
  FastlaneCore::ConfigItem.new(key: :ipa_path,
47
76
  env_name: "CRASHLYTICS_IPA_PATH",
48
77
  description: "Path to your IPA file. Optional if you use the `gym` or `xcodebuild` action",
49
- default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] || Dir["*.ipa"].last,
78
+ default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] || ipa_path_default,
50
79
  optional: true,
51
80
  verify_block: proc do |value|
52
81
  UI.user_error!("Couldn't find ipa file at path '#{value}'") unless File.exist?(value)
@@ -55,7 +84,7 @@ module Fastlane
55
84
  FastlaneCore::ConfigItem.new(key: :apk_path,
56
85
  env_name: "CRASHLYTICS_APK_PATH",
57
86
  description: "Path to your APK file",
58
- default_value: Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH] || Dir["*.apk"].last || Dir[File.join("app", "build", "outputs", "apk", "app-Release.apk")].last,
87
+ default_value: Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH] || apk_path_default,
59
88
  optional: true,
60
89
  verify_block: proc do |value|
61
90
  UI.user_error!("Couldn't find apk file at path '#{value}'") unless File.exist?(value)
@@ -64,7 +93,6 @@ module Fastlane
64
93
  FastlaneCore::ConfigItem.new(key: :crashlytics_path,
65
94
  env_name: "CRASHLYTICS_FRAMEWORK_PATH",
66
95
  description: "Path to the submit binary in the Crashlytics bundle (iOS) or `crashlytics-devtools.jar` file (Android)",
67
- default_value: Dir["./Pods/iOS/Crashlytics/Crashlytics.framework"].last || Dir["./**/Crashlytics.framework"].last,
68
96
  optional: true,
69
97
  verify_block: proc do |value|
70
98
  UI.user_error!("Couldn't find crashlytics at path '#{File.expand_path(value)}'`") unless File.exist?(File.expand_path(value))
@@ -32,6 +32,11 @@ module Fastlane
32
32
  options << "-F g=#{params[:repo_group_id].shellescape}"
33
33
  options << "-F a=#{params[:repo_project_name].shellescape}"
34
34
  options << "-F v=#{params[:repo_project_version].shellescape}"
35
+
36
+ if params[:repo_classifier]
37
+ options << "-F c=#{params[:repo_classifier].shellescape}"
38
+ end
39
+
35
40
  options << "-F e=#{file_extension}"
36
41
  options << "-F file=@#{file_path}"
37
42
  options << "-u #{params[:username].shellescape}:#{params[:password].shellescape}"
@@ -92,6 +97,10 @@ module Fastlane
92
97
  env_name: "FL_NEXUS_REPO_PROJECT_VERSION",
93
98
  description: "Nexus repository commandect version",
94
99
  optional: false),
100
+ FastlaneCore::ConfigItem.new(key: :repo_classifier,
101
+ env_name: "FL_NEXUS_REPO_CLASSIFIER",
102
+ description: "Nexus repository artifact classifier (optional)",
103
+ optional: true),
95
104
  FastlaneCore::ConfigItem.new(key: :endpoint,
96
105
  env_name: "FL_NEXUS_ENDPOINT",
97
106
  description: "Nexus endpoint e.g. http://nexus:8081",
@@ -22,6 +22,10 @@ module Fastlane
22
22
  command << " --allow-warnings"
23
23
  end
24
24
 
25
+ if params[:use_libraries]
26
+ command << " --use-libraries"
27
+ end
28
+
25
29
  result = Actions.sh(command.to_s)
26
30
  UI.success("Successfully pushed Podspec ⬆️ ")
27
31
  return result
@@ -55,6 +59,10 @@ module Fastlane
55
59
  description: "Allow warnings during pod push",
56
60
  optional: true,
57
61
  is_string: false),
62
+ FastlaneCore::ConfigItem.new(key: :use_libraries,
63
+ description: "Allow lint to use static libraries to install the spec",
64
+ optional: true,
65
+ is_string: false),
58
66
  FastlaneCore::ConfigItem.new(key: :sources,
59
67
  description: "The sources of repos you want the pod spec to lint with, separated by commas",
60
68
  optional: true,
@@ -6,7 +6,7 @@ module Fastlane
6
6
  require 'sigh'
7
7
 
8
8
  # try to resign the ipa
9
- if Sigh::Resign.resign(params[:ipa], params[:signing_identity], params[:provisioning_profile], params[:entitlements], params[:version], params[:display_name], params[:short_version], params[:bundle_version])
9
+ if Sigh::Resign.resign(params[:ipa], params[:signing_identity], params[:provisioning_profile], params[:entitlements], params[:version], params[:display_name], params[:short_version], params[:bundle_version], params[:bundle_id])
10
10
  UI.success('Successfully re-signed .ipa 🔏.')
11
11
  else
12
12
  UI.user_error!("Failed to re-sign .ipa")
@@ -85,6 +85,11 @@ module Fastlane
85
85
  description: "Bundle version to force resigned ipa to use (CFBundleIdentifier)",
86
86
  conflicting_options: [:version],
87
87
  is_string: true,
88
+ optional: true),
89
+ FastlaneCore::ConfigItem.new(key: :bundle_id,
90
+ env_name: "FL_RESIGN_BUNDLE_ID",
91
+ description: "Set new bundle ID during resign",
92
+ is_string: true,
88
93
  optional: true)
89
94
  ]
90
95
  end
@@ -37,6 +37,7 @@ module Fastlane
37
37
  ##
38
38
  ##
39
39
  "
40
+ return "🚀"
40
41
  end
41
42
 
42
43
  #####################################################
@@ -0,0 +1,60 @@
1
+ module Fastlane
2
+ module Actions
3
+ class SetPodKeyAction < Action
4
+ def self.run(params)
5
+ Actions.verify_gem!('cocoapods-keys')
6
+ cmd = []
7
+
8
+ cmd << ['bundle exec'] if File.exist?('Gemfile') && params[:use_bundle_exec]
9
+ cmd << ['pod keys set']
10
+
11
+ cmd << ["\"#{params[:key].shellescape}\""]
12
+ cmd << ["\"#{params[:value].shellescape}\""]
13
+ cmd << ["\"#{params[:project].shellescape}\""] if params[:project]
14
+
15
+ Actions.sh(cmd.join(' '))
16
+ end
17
+
18
+ def self.author
19
+ "marcelofabri"
20
+ end
21
+
22
+ #####################################################
23
+ # @!group Documentation
24
+ #####################################################
25
+
26
+ def self.description
27
+ "Sets a value for a key with cocoapods-keys"
28
+ end
29
+
30
+ def self.available_options
31
+ [
32
+ FastlaneCore::ConfigItem.new(key: :use_bundle_exec,
33
+ env_name: "FL_SET_POD_KEY_USE_BUNDLE_EXEC",
34
+ description: "Use bundle exec when there is a Gemfile presented",
35
+ is_string: false,
36
+ default_value: true),
37
+ FastlaneCore::ConfigItem.new(key: :key,
38
+ env_name: "FL_SET_POD_KEY_ITEM_KEY",
39
+ description: "The key to be saved with cocoapods-keys",
40
+ is_string: true,
41
+ optional: false),
42
+ FastlaneCore::ConfigItem.new(key: :value,
43
+ env_name: "FL_SET_POD_KEY_ITEM_VALUE",
44
+ description: "The value to be saved with cocoapods-keys",
45
+ is_string: true,
46
+ optional: false),
47
+ FastlaneCore::ConfigItem.new(key: :project,
48
+ env_name: "FL_SET_POD_KEY_PROJECT",
49
+ description: "The project name",
50
+ is_string: true,
51
+ optional: true)
52
+ ]
53
+ end
54
+
55
+ def self.is_supported?(platform)
56
+ [:ios, :mac].include? platform
57
+ end
58
+ end
59
+ end
60
+ end
@@ -35,10 +35,24 @@ module Fastlane
35
35
  Actions.verify_gem!('slather')
36
36
  end
37
37
 
38
+ validate_params!(params)
39
+
38
40
  command = build_command(params)
39
41
  sh command
40
42
  end
41
43
 
44
+ def self.has_config_file
45
+ File.file?('.slather.yml')
46
+ end
47
+
48
+ def self.validate_params!(params)
49
+ if params[:proj] || has_config_file
50
+ true
51
+ else
52
+ UI.user_error!("You have to provide a project with `:proj` or use a .slather.yml")
53
+ end
54
+ end
55
+
42
56
  def self.build_command(params)
43
57
  command = []
44
58
  command.push("bundle exec") if params[:use_bundle_exec]
@@ -60,7 +74,7 @@ module Fastlane
60
74
  end
61
75
  end
62
76
 
63
- command << params[:proj].shellescape
77
+ command << params[:proj].shellescape if params[:proj]
64
78
  command.join(" ")
65
79
  end
66
80
 
@@ -91,7 +105,8 @@ Slather is available at https://github.com/SlatherOrg/slather
91
105
  description: "The project file that slather looks at", # a short description of this parameter
92
106
  verify_block: proc do |value|
93
107
  UI.user_error!("No project file specified, pass using `proj: 'Project.xcodeproj'`") unless value and !value.empty?
94
- end),
108
+ end,
109
+ optional: true),
95
110
  FastlaneCore::ConfigItem.new(key: :workspace,
96
111
  env_name: "FL_SLATHER_WORKSPACE",
97
112
  description: "The workspace that slather looks at",
@@ -0,0 +1,52 @@
1
+ module Fastlane
2
+ # This class is responsible for checking the ARGV
3
+ # to see if the user wants to launch another fastlane
4
+ # tool or fastlane itself
5
+ class CLIToolsDistributor
6
+ class << self
7
+ def take_off
8
+ require "fastlane"
9
+
10
+ # Array of symbols for the names of the available lanes
11
+ # This doesn't actually use the Fastfile parser, but only
12
+ # the available lanes. This way it's much faster, which
13
+ # is very important in this case, since it will be executed
14
+ # every time one of the tools is launched
15
+ available_lanes = Fastlane::FastlaneFolder.available_lanes
16
+
17
+ tool_name = ARGV.first
18
+ if tool_name && Fastlane::TOOLS.include?(tool_name.to_sym) && !available_lanes.include?(tool_name.to_sym)
19
+ # Triggering a specific tool
20
+ # This happens when the users uses things like
21
+ #
22
+ # fastlane sigh
23
+ # fastlane snapshot
24
+ #
25
+ require tool_name
26
+ begin
27
+ # First, remove the tool's name from the arguments
28
+ # Since it will be parsed by the `commander` at a later point
29
+ # and it must not contain the binary name
30
+ ARGV.shift
31
+
32
+ # Import the CommandsGenerator class, which is used to parse
33
+ # the user input
34
+ require File.join(tool_name, "commands_generator")
35
+
36
+ # Call the tool's CommandsGenerator class and let it do its thing
37
+ Object.const_get(tool_name.fastlane_class)::CommandsGenerator.start
38
+ rescue LoadError
39
+ # This will only happen if the tool we call here, doesn't provide
40
+ # a CommandsGenerator class yet
41
+ # When we launch this feature, this should never be the case
42
+ abort("#{tool_name} can't be called via `fastlane #{tool_name}`, run '#{tool_name}' directly instead".red)
43
+ end
44
+ else
45
+ # Triggering fastlane to call a lane
46
+ require "fastlane/commands_generator"
47
+ Fastlane::CommandsGenerator.start
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -9,6 +9,7 @@ module Fastlane
9
9
 
10
10
  def self.start
11
11
  FastlaneCore::UpdateChecker.start_looking_for_update('fastlane')
12
+ Fastlane.load_actions
12
13
  self.new.run
13
14
  ensure
14
15
  FastlaneCore::UpdateChecker.show_update_status('fastlane', Fastlane::VERSION)
@@ -127,29 +127,7 @@ module Fastlane
127
127
 
128
128
  # Is used to look if the method is implemented as an action
129
129
  def method_missing(method_sym, *arguments, &_block)
130
- method_str = method_sym.to_s
131
- method_str.delete!('?') # as a `?` could be at the end of the method name
132
-
133
- # First, check if there is a predefined method in the actions folder
134
- class_name = method_str.fastlane_class + 'Action'
135
- class_ref = nil
136
- begin
137
- class_ref = Fastlane::Actions.const_get(class_name)
138
- rescue NameError
139
- # Action not found
140
- # Is there a lane under this name?
141
- return self.runner.try_switch_to_lane(method_sym, arguments)
142
- end
143
-
144
- # It's important to *not* have this code inside the rescue block
145
- # otherwise all NameErrors will be catched and the error message is
146
- # confusing
147
- if class_ref && class_ref.respond_to?(:run)
148
- # Action is available, now execute it
149
- return self.runner.execute_action(method_sym, class_ref, arguments)
150
- else
151
- UI.user_error!("Action '#{method_sym}' of class '#{class_name}' was found, but has no `run` method.")
152
- end
130
+ self.runner.trigger_action_by_name(method_sym, *arguments)
153
131
  end
154
132
 
155
133
  #####################################################
@@ -13,10 +13,15 @@ module Fastlane
13
13
  return value
14
14
  end
15
15
 
16
+ def self.fastfile_path
17
+ return nil if path.nil?
18
+ File.join(path, "Fastfile")
19
+ end
20
+
16
21
  # Does a fastlane configuration already exist?
17
22
  def self.setup?
18
23
  return false unless path
19
- File.exist?(File.join(path, "Fastfile"))
24
+ File.exist?(self.fastfile_path)
20
25
  end
21
26
 
22
27
  def self.create_folder!(path = nil)
@@ -24,5 +29,15 @@ module Fastlane
24
29
  FileUtils.mkdir_p(path)
25
30
  UI.success "Created new folder '#{path}'."
26
31
  end
32
+
33
+ # Returns an array of symbols for the available lanes for the Fastfile
34
+ # This doesn't actually use the Fastfile parser, but only
35
+ # the available lanes. This way it's much faster
36
+ # Use this only if performance is :key:
37
+ def self.available_lanes
38
+ return [] if fastfile_path.nil?
39
+ output = Helper.backticks("cat #{fastfile_path.shellescape} | grep \"^\s*lane \:\" | awk -F ':' '{print $2}' | awk -F ' ' '{print $1}'")
40
+ return output.strip.split(" ").collect(&:to_sym)
41
+ end
27
42
  end
28
43
  end
@@ -3,6 +3,7 @@ module Fastlane
3
3
  class CrashlyticsHelper
4
4
  class << self
5
5
  def generate_ios_command(params)
6
+ params[:crashlytics_path] = Dir["./Pods/iOS/Crashlytics/Crashlytics.framework"].last || Dir["./**/Crashlytics.framework"].last unless params[:crashlytics_path]
6
7
  UI.user_error!("No value found for 'crashlytics_path'") unless params[:crashlytics_path]
7
8
  submit_binary = Dir[File.join(params[:crashlytics_path], '**', 'submit')].last
8
9
  submit_binary ||= "Crashlytics.framework/submit" if Helper.test?
@@ -4,16 +4,21 @@ module Fastlane
4
4
  # This method will output the string and execute it
5
5
  # Just an alias for sh_no_action
6
6
  # When running this in tests, it will return the actual command instead of executing it
7
- # @param log [boolean] should fastlane print out the executed command
8
- def self.sh(command, log: true)
9
- sh_control_output(command, print_command: log, print_command_output: log)
7
+ # @param log [Boolean] should fastlane print out the executed command
8
+ # @param error_callback [Block] a callback invoked with the command ouptut if there is a non-zero exit status
9
+ def self.sh(command, log: true, error_callback: nil)
10
+ sh_control_output(command, print_command: log, print_command_output: log, error_callback: error_callback)
10
11
  end
11
12
 
12
- def self.sh_no_action(command, log: true)
13
- sh_control_output(command, print_command: log, print_command_output: log)
13
+ def self.sh_no_action(command, log: true, error_callback: nil)
14
+ sh_control_output(command, print_command: log, print_command_output: log, error_callback: error_callback)
14
15
  end
15
16
 
16
- def self.sh_control_output(command, print_command: true, print_command_output: true)
17
+ # @param command [String] The command to be executed
18
+ # @param print_command [Boolean] Should we print the command that's being executed
19
+ # @param print_command_output [Boolean] Should we print the command output during execution
20
+ # @param error_callback [Block] A block that's called if the command exits with a non-zero status
21
+ def self.sh_control_output(command, print_command: true, print_command_output: true, error_callback: nil)
17
22
  # Set the encoding first, the user might have set it wrong
18
23
  previous_encoding = [Encoding.default_external, Encoding.default_internal]
19
24
  Encoding.default_external = Encoding::UTF_8
@@ -44,6 +49,8 @@ module Fastlane
44
49
  "Shell command exited with exit status #{exit_status} instead of 0."
45
50
  end
46
51
  message += "\n#{result}" if print_command_output
52
+
53
+ error_callback.call(result) if error_callback
47
54
  UI.user_error!(message)
48
55
  end
49
56
  end
data/lib/fastlane/lane.rb CHANGED
@@ -19,10 +19,7 @@ module Fastlane
19
19
  UI.user_error!("lane name must not contain any spaces") if name.to_s.include? " "
20
20
  UI.user_error!("lane name must start with :") unless name.kind_of? Symbol
21
21
 
22
- if self.class.black_list.include?(name.to_s)
23
- UI.error "Lane Name '#{name}' can not be one of the followings: #{self.class.black_list}".red
24
- UI.user_error!("Name '#{name}' is already taken")
25
- end
22
+ self.class.verify_lane_name(name)
26
23
 
27
24
  self.platform = platform
28
25
  self.name = name
@@ -42,9 +39,28 @@ module Fastlane
42
39
  end
43
40
 
44
41
  class << self
42
+ # Makes sure the lane name is valid
43
+ def verify_lane_name(name)
44
+ if self.black_list.include?(name.to_s)
45
+ UI.error "Lane Name '#{name}' can not be one of the followings: #{self.black_list}"
46
+ UI.user_error!("Name '#{name}' is already taken")
47
+ end
48
+
49
+ if self.gray_list.include?(name.to_sym)
50
+ UI.error "Lane name '#{name}' should not be used because it is the name of a fastlane tool"
51
+ UI.error "It is recommended to not use '#{name}' as the name of your lane"
52
+ # We still allow it, because we're nice
53
+ # Otherwise we might break existing setups
54
+ end
55
+ end
56
+
45
57
  def black_list
46
58
  %w(run init new_action lanes list docs action actions help)
47
59
  end
60
+
61
+ def gray_list
62
+ Fastlane::TOOLS
63
+ end
48
64
  end
49
65
  end
50
66
  end
@@ -0,0 +1,17 @@
1
+ module Fastlane
2
+ # This class is used to call other actions from within actions
3
+ # We use a separate class so that we can easily identify when
4
+ # we have dependencies between actions
5
+ class OtherAction
6
+ attr_accessor :runner
7
+
8
+ def initialize(runner)
9
+ self.runner = runner
10
+ end
11
+
12
+ # Allows the user to call an action from an action
13
+ def method_missing(method_sym, *arguments, &_block)
14
+ self.runner.trigger_action_by_name(method_sym, *arguments)
15
+ end
16
+ end
17
+ end
@@ -86,6 +86,34 @@ module Fastlane
86
86
  all
87
87
  end
88
88
 
89
+ # This is being called from `method_missing` from the Fastfile
90
+ # It's also used when an action is called from another action
91
+ def trigger_action_by_name(method_sym, *arguments)
92
+ method_str = method_sym.to_s
93
+ method_str.delete!('?') # as a `?` could be at the end of the method name
94
+
95
+ # First, check if there is a predefined method in the actions folder
96
+ class_name = method_str.fastlane_class + 'Action'
97
+ class_ref = nil
98
+ begin
99
+ class_ref = Fastlane::Actions.const_get(class_name)
100
+ rescue NameError
101
+ # Action not found
102
+ # Is there a lane under this name?
103
+ return self.try_switch_to_lane(method_sym, arguments)
104
+ end
105
+
106
+ # It's important to *not* have this code inside the rescue block
107
+ # otherwise all NameErrors will be caugth and the error message is
108
+ # confusing
109
+ if class_ref && class_ref.respond_to?(:run)
110
+ # Action is available, now execute it
111
+ return self.execute_action(method_sym, class_ref, arguments)
112
+ else
113
+ UI.user_error!("Action '#{method_sym}' of class '#{class_name}' was found, but has no `run` method.")
114
+ end
115
+ end
116
+
89
117
  #
90
118
  # All the methods that are usually called on execution
91
119
  #
@@ -140,6 +168,7 @@ module Fastlane
140
168
  UI.user_error!("You have to call the integration like `#{method_sym}(key: \"value\")`. Run `fastlane action #{method_sym}` for all available keys. Please check out the current documentation on GitHub.")
141
169
  end
142
170
 
171
+ class_ref.runner = self # needed to call another action form an action
143
172
  class_ref.run(arguments)
144
173
  end
145
174
  end
@@ -0,0 +1,20 @@
1
+ module Fastlane
2
+ TOOLS = [
3
+ :fastlane,
4
+ :pilot,
5
+ :spaceship,
6
+ :produce,
7
+ :cert,
8
+ :deliver,
9
+ :frameit,
10
+ :pem,
11
+ :snapshot,
12
+ :screengrab,
13
+ :supply,
14
+ :cert,
15
+ :sigh,
16
+ :match,
17
+ :scan,
18
+ :gym
19
+ ]
20
+ end
@@ -1,4 +1,4 @@
1
1
  module Fastlane
2
- VERSION = '1.85.0'.freeze
2
+ VERSION = '1.86.0'.freeze
3
3
  DESCRIPTION = "The easiest way to automate building and releasing your iOS and Android apps"
4
4
  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.85.0
4
+ version: 1.86.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-05-04 00:00:00.000000000 Z
11
+ date: 2016-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: krausefx-shenzhen
@@ -248,7 +248,7 @@ dependencies:
248
248
  requirements:
249
249
  - - ">="
250
250
  - !ruby/object:Gem::Version
251
- version: 2.6.0
251
+ version: 2.6.1
252
252
  - - "<"
253
253
  - !ruby/object:Gem::Version
254
254
  version: 3.0.0
@@ -258,7 +258,7 @@ dependencies:
258
258
  requirements:
259
259
  - - ">="
260
260
  - !ruby/object:Gem::Version
261
- version: 2.6.0
261
+ version: 2.6.1
262
262
  - - "<"
263
263
  - !ruby/object:Gem::Version
264
264
  version: 3.0.0
@@ -288,7 +288,7 @@ dependencies:
288
288
  requirements:
289
289
  - - ">="
290
290
  - !ruby/object:Gem::Version
291
- version: 1.4.0
291
+ version: 1.4.1
292
292
  - - "<"
293
293
  - !ruby/object:Gem::Version
294
294
  version: 2.0.0
@@ -298,7 +298,7 @@ dependencies:
298
298
  requirements:
299
299
  - - ">="
300
300
  - !ruby/object:Gem::Version
301
- version: 1.4.0
301
+ version: 1.4.1
302
302
  - - "<"
303
303
  - !ruby/object:Gem::Version
304
304
  version: 2.0.0
@@ -308,7 +308,7 @@ dependencies:
308
308
  requirements:
309
309
  - - ">="
310
310
  - !ruby/object:Gem::Version
311
- version: 1.7.0
311
+ version: 1.8.0
312
312
  - - "<"
313
313
  - !ruby/object:Gem::Version
314
314
  version: 2.0.0
@@ -318,7 +318,7 @@ dependencies:
318
318
  requirements:
319
319
  - - ">="
320
320
  - !ruby/object:Gem::Version
321
- version: 1.7.0
321
+ version: 1.8.0
322
322
  - - "<"
323
323
  - !ruby/object:Gem::Version
324
324
  version: 2.0.0
@@ -328,7 +328,7 @@ dependencies:
328
328
  requirements:
329
329
  - - ">="
330
330
  - !ruby/object:Gem::Version
331
- version: 1.1.1
331
+ version: 1.1.2
332
332
  - - "<"
333
333
  - !ruby/object:Gem::Version
334
334
  version: 2.0.0
@@ -338,7 +338,7 @@ dependencies:
338
338
  requirements:
339
339
  - - ">="
340
340
  - !ruby/object:Gem::Version
341
- version: 1.1.1
341
+ version: 1.1.2
342
342
  - - "<"
343
343
  - !ruby/object:Gem::Version
344
344
  version: 2.0.0
@@ -368,7 +368,7 @@ dependencies:
368
368
  requirements:
369
369
  - - ">="
370
370
  - !ruby/object:Gem::Version
371
- version: 1.5.0
371
+ version: 1.5.1
372
372
  - - "<"
373
373
  - !ruby/object:Gem::Version
374
374
  version: 2.0.0
@@ -378,7 +378,7 @@ dependencies:
378
378
  requirements:
379
379
  - - ">="
380
380
  - !ruby/object:Gem::Version
381
- version: 1.5.0
381
+ version: 1.5.1
382
382
  - - "<"
383
383
  - !ruby/object:Gem::Version
384
384
  version: 2.0.0
@@ -408,7 +408,7 @@ dependencies:
408
408
  requirements:
409
409
  - - ">="
410
410
  - !ruby/object:Gem::Version
411
- version: 0.5.2
411
+ version: 0.6.0
412
412
  - - "<"
413
413
  - !ruby/object:Gem::Version
414
414
  version: 1.0.0
@@ -418,7 +418,7 @@ dependencies:
418
418
  requirements:
419
419
  - - ">="
420
420
  - !ruby/object:Gem::Version
421
- version: 0.5.2
421
+ version: 0.6.0
422
422
  - - "<"
423
423
  - !ruby/object:Gem::Version
424
424
  version: 1.0.0
@@ -685,6 +685,7 @@ files:
685
685
  - lib/fastlane/actions/appium.rb
686
686
  - lib/fastlane/actions/appledoc.rb
687
687
  - lib/fastlane/actions/appstore.rb
688
+ - lib/fastlane/actions/apteligent.rb
688
689
  - lib/fastlane/actions/artifactory.rb
689
690
  - lib/fastlane/actions/backup_file.rb
690
691
  - lib/fastlane/actions/backup_xcarchive.rb
@@ -807,6 +808,7 @@ files:
807
808
  - lib/fastlane/actions/set_changelog.rb
808
809
  - lib/fastlane/actions/set_github_release.rb
809
810
  - lib/fastlane/actions/set_info_plist_value.rb
811
+ - lib/fastlane/actions/set_pod_key.rb
810
812
  - lib/fastlane/actions/setup_jenkins.rb
811
813
  - lib/fastlane/actions/sigh.rb
812
814
  - lib/fastlane/actions/skip_docs.rb
@@ -852,6 +854,7 @@ files:
852
854
  - lib/fastlane/actions/xctool.rb
853
855
  - lib/fastlane/actions/zip.rb
854
856
  - lib/fastlane/auto_complete.rb
857
+ - lib/fastlane/cli_tools_distributor.rb
855
858
  - lib/fastlane/command_line_handler.rb
856
859
  - lib/fastlane/commands_generator.rb
857
860
  - lib/fastlane/configuration_helper.rb
@@ -876,11 +879,13 @@ files:
876
879
  - lib/fastlane/lane_manager.rb
877
880
  - lib/fastlane/new_action.rb
878
881
  - lib/fastlane/one_off.rb
882
+ - lib/fastlane/other_action.rb
879
883
  - lib/fastlane/runner.rb
880
884
  - lib/fastlane/setup/setup.rb
881
885
  - lib/fastlane/setup/setup_android.rb
882
886
  - lib/fastlane/setup/setup_ios.rb
883
887
  - lib/fastlane/supported_platforms.rb
888
+ - lib/fastlane/tools.rb
884
889
  - lib/fastlane/version.rb
885
890
  homepage: https://fastlane.tools
886
891
  licenses:
@@ -902,7 +907,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
902
907
  version: '0'
903
908
  requirements: []
904
909
  rubyforge_project:
905
- rubygems_version: 2.4.0
910
+ rubygems_version: 2.6.2
906
911
  signing_key:
907
912
  specification_version: 4
908
913
  summary: The easiest way to automate building and releasing your iOS and Android apps