fastlane 1.20.0 → 1.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/bin/fastlane +16 -16
  3. data/lib/assets/custom_action_template.rb +2 -2
  4. data/lib/fastlane.rb +1 -0
  5. data/lib/fastlane/action.rb +5 -6
  6. data/lib/fastlane/action_collector.rb +6 -6
  7. data/lib/fastlane/actions/actions_helper.rb +12 -74
  8. data/lib/fastlane/actions/add_git_tag.rb +2 -2
  9. data/lib/fastlane/actions/appstore.rb +2 -2
  10. data/lib/fastlane/actions/backup_file.rb +2 -2
  11. data/lib/fastlane/actions/backup_xcarchive.rb +11 -12
  12. data/lib/fastlane/actions/bundle_install.rb +5 -1
  13. data/lib/fastlane/actions/chatwork.rb +12 -12
  14. data/lib/fastlane/actions/clean_build_artifacts.rb +4 -6
  15. data/lib/fastlane/actions/clipboard.rb +1 -1
  16. data/lib/fastlane/actions/commit_version_bump.rb +35 -10
  17. data/lib/fastlane/actions/crashlytics.rb +26 -26
  18. data/lib/fastlane/actions/create_keychain.rb +6 -6
  19. data/lib/fastlane/actions/default_platform.rb +1 -1
  20. data/lib/fastlane/actions/delete_keychain.rb +3 -3
  21. data/lib/fastlane/actions/deliver.rb +3 -3
  22. data/lib/fastlane/actions/deploygate.rb +19 -18
  23. data/lib/fastlane/actions/dsym_zip.rb +7 -9
  24. data/lib/fastlane/actions/ensure_git_branch.rb +2 -3
  25. data/lib/fastlane/actions/ensure_no_debug_code.rb +8 -8
  26. data/lib/fastlane/actions/fastlane_version.rb +4 -2
  27. data/lib/fastlane/actions/frameit.rb +7 -7
  28. data/lib/fastlane/actions/gcovr.rb +5 -4
  29. data/lib/fastlane/actions/get_build_number.rb +27 -30
  30. data/lib/fastlane/actions/get_github_release.rb +11 -11
  31. data/lib/fastlane/actions/get_version_number.rb +28 -30
  32. data/lib/fastlane/actions/git_branch.rb +1 -2
  33. data/lib/fastlane/actions/gym.rb +2 -2
  34. data/lib/fastlane/actions/hg_commit_version_bump.rb +28 -6
  35. data/lib/fastlane/actions/hg_push.rb +0 -1
  36. data/lib/fastlane/actions/hipchat.rb +20 -20
  37. data/lib/fastlane/actions/hockey.rb +16 -17
  38. data/lib/fastlane/actions/import.rb +1 -2
  39. data/lib/fastlane/actions/import_certificate.rb +1 -1
  40. data/lib/fastlane/actions/import_from_git.rb +6 -2
  41. data/lib/fastlane/actions/increment_build_number.rb +25 -28
  42. data/lib/fastlane/actions/increment_version_number.rb +55 -57
  43. data/lib/fastlane/actions/install_carthage.rb +10 -11
  44. data/lib/fastlane/actions/install_cocoapods.rb +3 -3
  45. data/lib/fastlane/actions/ipa.rb +8 -6
  46. data/lib/fastlane/actions/is_ci.rb +37 -0
  47. data/lib/fastlane/actions/lane_context.rb +2 -2
  48. data/lib/fastlane/actions/last_git_tag.rb +1 -1
  49. data/lib/fastlane/actions/lcov.rb +28 -31
  50. data/lib/fastlane/actions/mailgun.rb +11 -42
  51. data/lib/fastlane/actions/oclint.rb +10 -13
  52. data/lib/fastlane/actions/pem.rb +2 -2
  53. data/lib/fastlane/actions/pilot.rb +4 -2
  54. data/lib/fastlane/actions/prompt.rb +6 -6
  55. data/lib/fastlane/actions/push_git_tags.rb +38 -0
  56. data/lib/fastlane/actions/push_to_git_remote.rb +4 -1
  57. data/lib/fastlane/actions/puts.rb +1 -1
  58. data/lib/fastlane/actions/register_devices.rb +4 -3
  59. data/lib/fastlane/actions/reset_git_repo.rb +6 -6
  60. data/lib/fastlane/actions/resign.rb +4 -5
  61. data/lib/fastlane/actions/restore_file.rb +2 -2
  62. data/lib/fastlane/actions/s3.rb +19 -22
  63. data/lib/fastlane/actions/set_build_number_repository.rb +26 -36
  64. data/lib/fastlane/actions/set_changelog.rb +4 -4
  65. data/lib/fastlane/actions/set_github_release.rb +10 -11
  66. data/lib/fastlane/actions/sigh.rb +1 -1
  67. data/lib/fastlane/actions/slack.rb +85 -74
  68. data/lib/fastlane/actions/snapshot.rb +2 -2
  69. data/lib/fastlane/actions/team_id.rb +2 -1
  70. data/lib/fastlane/actions/team_name.rb +2 -1
  71. data/lib/fastlane/actions/testflight.rb +2 -2
  72. data/lib/fastlane/actions/testmunk.rb +16 -16
  73. data/lib/fastlane/actions/typetalk.rb +14 -14
  74. data/lib/fastlane/actions/update_app_group_identifiers.rb +17 -17
  75. data/lib/fastlane/actions/update_fastlane.rb +16 -14
  76. data/lib/fastlane/actions/update_info_plist.rb +14 -16
  77. data/lib/fastlane/actions/update_project_code_signing.rb +3 -3
  78. data/lib/fastlane/actions/update_project_provisioning.rb +48 -36
  79. data/lib/fastlane/actions/xcode_select.rb +4 -3
  80. data/lib/fastlane/actions/xcode_server_get_assets.rb +23 -24
  81. data/lib/fastlane/actions/xcodebuild.rb +13 -13
  82. data/lib/fastlane/actions/xctool.rb +2 -2
  83. data/lib/fastlane/actions_list.rb +27 -29
  84. data/lib/fastlane/command_line_handler.rb +13 -14
  85. data/lib/fastlane/configuration_helper.rb +18 -20
  86. data/lib/fastlane/core_ext/string.rb +2 -2
  87. data/lib/fastlane/docs_generator.rb +33 -32
  88. data/lib/fastlane/erb_template_helper.rb +1 -1
  89. data/lib/fastlane/fast_file.rb +27 -18
  90. data/lib/fastlane/fastlane_folder.rb +1 -1
  91. data/lib/fastlane/helper/git_helper.rb +27 -0
  92. data/lib/fastlane/helper/sh_helper.rb +48 -0
  93. data/lib/fastlane/junit_generator.rb +1 -1
  94. data/lib/fastlane/lane.rb +6 -6
  95. data/lib/fastlane/lane_list.rb +12 -13
  96. data/lib/fastlane/lane_manager.rb +17 -11
  97. data/lib/fastlane/new_action.rb +1 -1
  98. data/lib/fastlane/runner.rb +23 -24
  99. data/lib/fastlane/setup.rb +16 -17
  100. data/lib/fastlane/supported_platforms.rb +2 -2
  101. data/lib/fastlane/version.rb +1 -1
  102. metadata +16 -12
@@ -14,7 +14,6 @@ module Fastlane
14
14
  end
15
15
  end
16
16
 
17
-
18
17
  #####################################################
19
18
  # @!group Documentation
20
19
  #####################################################
@@ -29,7 +28,7 @@ module Fastlane
29
28
  env_name: "FL_ENSURE_GIT_BRANCH_NAME",
30
29
  description: "The branch that should be checked for",
31
30
  is_string: true,
32
- default_value: 'master'),
31
+ default_value: 'master')
33
32
  ]
34
33
  end
35
34
 
@@ -46,4 +45,4 @@ module Fastlane
46
45
  end
47
46
  end
48
47
  end
49
- end
48
+ end
@@ -7,7 +7,7 @@ module Fastlane
7
7
 
8
8
  Helper.log.info command.yellow
9
9
  results = `#{command}` # we don't use `sh` as the return code of grep is wrong for some reason
10
-
10
+
11
11
  # Example Output
12
12
  # ./fastlane.gemspec: spec.add_development_dependency 'my_word'
13
13
  # ./Gemfile.lock: my_word (0.10.1)
@@ -16,7 +16,7 @@ module Fastlane
16
16
  results.split("\n").each do |current_raw|
17
17
  current = current_raw.strip
18
18
  if params[:extension]
19
- if current.include?".#{params[:extension]}:"
19
+ if current.include? ".#{params[:extension]}:"
20
20
  found << current
21
21
  end
22
22
  else
@@ -53,16 +53,16 @@ module Fastlane
53
53
  env_name: "FL_ENSURE_NO_DEBUG_CODE_PATH",
54
54
  description: "The directory containing all the source files",
55
55
  default_value: ".",
56
- verify_block: Proc.new do |value|
57
- raise "Couldn't find the folder at '#{File.absolute_path(value)}'".red unless File.directory?(value)
56
+ verify_block: proc do |value|
57
+ raise "Couldn't find the folder at '#{File.absolute_path(value)}'".red unless File.directory?(value)
58
58
  end),
59
59
  FastlaneCore::ConfigItem.new(key: :extension,
60
60
  env_name: "FL_ENSURE_NO_DEBUG_CODE_EXTENSION",
61
61
  description: "The extension that should be searched for",
62
62
  optional: true,
63
- verify_block: Proc.new do |value|
64
- value.gsub!(".", "") if value.include?"."
65
- end),
63
+ verify_block: proc do |value|
64
+ value.delete!('.') if value.include? "."
65
+ end)
66
66
  ]
67
67
  end
68
68
 
@@ -79,4 +79,4 @@ module Fastlane
79
79
  end
80
80
  end
81
81
  end
82
- end
82
+ end
@@ -1,12 +1,14 @@
1
1
  module Fastlane
2
2
  module Actions
3
3
  module SharedValues
4
-
5
4
  end
6
5
 
7
6
  class FastlaneVersionAction < Action
8
7
  def self.run(params)
9
- defined_version = ((Gem::Version.new(params.first) if params.first) rescue nil)
8
+ params = nil unless params.kind_of? Array
9
+ value = (params || []).first
10
+ defined_version = Gem::Version.new(value) if value
11
+
10
12
  raise "Please pass minimum fastlane version as parameter to fastlane_version".red unless defined_version
11
13
 
12
14
  if Gem::Version.new(Fastlane::VERSION) < defined_version
@@ -9,7 +9,7 @@ module Fastlane
9
9
  begin
10
10
  FastlaneCore::UpdateChecker.start_looking_for_update('frameit') unless Helper.is_test?
11
11
  color = Frameit::Color::BLACK
12
- color = Frameit::Color::SILVER if (config[:white] or config[:silver])
12
+ color = Frameit::Color::SILVER if config[:white] || config[:silver]
13
13
 
14
14
  Helper.log.info "Framing screenshots at path #{config[:path]}"
15
15
 
@@ -46,11 +46,11 @@ module Fastlane
46
46
  env_name: "FRAMEIT_FORCE_DEVICE_TYPE",
47
47
  description: "Forces a given device type, useful for Mac screenshots, as their sizes vary",
48
48
  optional: true,
49
- verify_block: Proc.new do |value|
50
- available = ['iPhone_6_Plus', 'iPhone_5s', 'iPhone_4', 'iPad_mini', 'Mac']
51
- unless available.include?value
52
- raise "Invalid device type '#{value}'. Available values: #{available}".red
53
- end
49
+ verify_block: proc do |value|
50
+ available = ['iPhone_6_Plus', 'iPhone_5s', 'iPhone_4', 'iPad_mini', 'Mac']
51
+ unless available.include? value
52
+ raise "Invalid device type '#{value}'. Available values: #{available}".red
53
+ end
54
54
  end)
55
55
  ]
56
56
  end
@@ -60,7 +60,7 @@ module Fastlane
60
60
  end
61
61
 
62
62
  def self.is_supported?(platform)
63
- [:ios, :mac].include?platform
63
+ [:ios, :mac].include? platform
64
64
  end
65
65
  end
66
66
  end
@@ -60,11 +60,11 @@ module Fastlane
60
60
  gcovr_args = nil
61
61
 
62
62
  # Allows for a whole variety of configurations
63
- if params.is_a? Hash
63
+ if params.kind_of? Hash
64
64
  params_hash = params
65
65
 
66
66
  # Check if an output path was given
67
- if params_hash.has_key? :output
67
+ if params_hash.key? :output
68
68
  create_output_dir_if_not_exists(params_hash[:output])
69
69
  end
70
70
 
@@ -87,7 +87,7 @@ module Fastlane
87
87
  output_dir = File.dirname(output_path)
88
88
 
89
89
  # If the output directory doesn't exist, create it
90
- unless Dir.exists? output_dir
90
+ unless Dir.exist? output_dir
91
91
  FileUtils.mkpath output_dir
92
92
  end
93
93
  end
@@ -99,7 +99,8 @@ module Fastlane
99
99
  # Maps nice developer param names to CLI arguments
100
100
  params.map do |k, v|
101
101
  v ||= ""
102
- if args = ARGS_MAP[k]
102
+ args = ARGS_MAP[k]
103
+ if args
103
104
  value = (v != true && v.to_s.length > 0 ? "\"#{v}\"" : "")
104
105
  "#{args} #{value}".strip
105
106
  end
@@ -7,35 +7,32 @@ module Fastlane
7
7
  # More information about how to set up your project and how it works:
8
8
  # https://developer.apple.com/library/ios/qa/qa1827/_index.html
9
9
 
10
- begin
11
- folder = params[:xcodeproj] ? File.join('.', params[:xcodeproj], '..') : '.'
10
+ folder = params[:xcodeproj] ? File.join('.', params[:xcodeproj], '..') : '.'
12
11
 
13
- command_prefix = [
14
- 'cd',
15
- File.expand_path(folder).shellescape,
16
- '&&'
17
- ].join(' ')
12
+ command_prefix = [
13
+ 'cd',
14
+ File.expand_path(folder).shellescape,
15
+ '&&'
16
+ ].join(' ')
18
17
 
19
- command = [
20
- command_prefix,
21
- 'agvtool',
22
- 'what-version',
23
- '-terse'
24
- ].join(' ')
18
+ command = [
19
+ command_prefix,
20
+ 'agvtool',
21
+ 'what-version',
22
+ '-terse'
23
+ ].join(' ')
25
24
 
26
- if Helper.test?
27
- Actions.lane_context[SharedValues::BUILD_NUMBER] = command
28
- else
25
+ if Helper.test?
26
+ Actions.lane_context[SharedValues::BUILD_NUMBER] = command
27
+ else
28
+ build_number = (Actions.sh command).split("\n").last.strip
29
29
 
30
- build_number = (Actions.sh command).split("\n").last.to_i
31
-
32
- # Store the number in the shared hash
33
- Actions.lane_context[SharedValues::BUILD_NUMBER] = build_number
34
- end
35
- rescue => ex
36
- Helper.log.error 'Make sure to to follow the steps to setup your Xcode project: https://developer.apple.com/library/ios/qa/qa1827/_index.html'.yellow
37
- raise ex
30
+ # Store the number in the shared hash
31
+ Actions.lane_context[SharedValues::BUILD_NUMBER] = build_number
38
32
  end
33
+ rescue => ex
34
+ Helper.log.error 'Make sure to to follow the steps to setup your Xcode project: https://developer.apple.com/library/ios/qa/qa1827/_index.html'.yellow
35
+ raise ex
39
36
  end
40
37
 
41
38
  #####################################################
@@ -51,7 +48,7 @@ module Fastlane
51
48
  "This action will return the current build number set on your project.",
52
49
  "You first have to set up your Xcode project, if you haven't done it already:",
53
50
  "https://developer.apple.com/library/ios/qa/qa1827/_index.html"
54
- ].join(' ')
51
+ ].join(' ')
55
52
  end
56
53
 
57
54
  def self.available_options
@@ -60,9 +57,9 @@ module Fastlane
60
57
  env_name: "FL_BUILD_NUMBER_PROJECT",
61
58
  description: "optional, you must specify the path to your main Xcode project if it is not in the project root directory",
62
59
  optional: true,
63
- verify_block: Proc.new do |value|
64
- raise "Please pass the path to the project, not the workspace".red if value.include?"workspace"
65
- raise "Could not find Xcode project".red if (not File.exists?(value) and not Helper.is_test?)
60
+ verify_block: proc do |value|
61
+ raise "Please pass the path to the project, not the workspace".red if value.include? "workspace"
62
+ raise "Could not find Xcode project".red if !File.exist?(value) and !Helper.is_test?
66
63
  end)
67
64
  ]
68
65
  end
@@ -78,8 +75,8 @@ module Fastlane
78
75
  end
79
76
 
80
77
  def self.is_supported?(platform)
81
- [:ios, :mac].include?platform
78
+ [:ios, :mac].include? platform
82
79
  end
83
80
  end
84
81
  end
85
- end
82
+ end
@@ -11,7 +11,7 @@ module Fastlane
11
11
  require 'base64'
12
12
  headers = { 'User-Agent' => 'fastlane-get_github_release' }
13
13
  headers['Authorization'] = "Basic #{Base64.strict_encode64(params[:api_token])}" if params[:api_token]
14
- response = Excon.get("https://api.github.com/repos/#{params[:url]}/releases", :headers => headers)
14
+ response = Excon.get("https://api.github.com/repos/#{params[:url]}/releases", headers: headers)
15
15
 
16
16
  case response[:status]
17
17
  when 404
@@ -26,15 +26,15 @@ module Fastlane
26
26
  return nil
27
27
  end
28
28
  end
29
-
29
+
30
30
  result = JSON.parse(response.body)
31
31
  result.each do |current|
32
- if current['tag_name'] == params[:version]
33
- # Found it
34
- Actions.lane_context[SharedValues::GET_GITHUB_RELEASE_INFO] = current
35
- Helper.log.info "Version is already live on GitHub.com 🚁"
36
- return current
37
- end
32
+ next unless current['tag_name'] == params[:version]
33
+
34
+ # Found it
35
+ Actions.lane_context[SharedValues::GET_GITHUB_RELEASE_INFO] = current
36
+ Helper.log.info "Version is already live on GitHub.com 🚁"
37
+ return current
38
38
  end
39
39
 
40
40
  Helper.log.info "Couldn't find GitHub release #{params[:version]}".yellow
@@ -105,9 +105,9 @@ module Fastlane
105
105
  FastlaneCore::ConfigItem.new(key: :url,
106
106
  env_name: "FL_GET_GITHUB_RELEASE_URL",
107
107
  description: "The path to your repo, e.g. 'KrauseFx/fastlane'",
108
- verify_block: Proc.new do |value|
109
- raise "Please only pass the path, e.g. 'KrauseFx/fastlane'".red if value.include?"github.com"
110
- raise "Please only pass the path, e.g. 'KrauseFx/fastlane'".red if value.split('/').count != 2
108
+ verify_block: proc do |value|
109
+ raise "Please only pass the path, e.g. 'KrauseFx/fastlane'".red if value.include? "github.com"
110
+ raise "Please only pass the path, e.g. 'KrauseFx/fastlane'".red if value.split('/').count != 2
111
111
  end),
112
112
  FastlaneCore::ConfigItem.new(key: :version,
113
113
  env_name: "FL_GET_GITHUB_RELEASE_VERSION",
@@ -7,35 +7,33 @@ module Fastlane
7
7
  # More information about how to set up your project and how it works:
8
8
  # https://developer.apple.com/library/ios/qa/qa1827/_index.html
9
9
 
10
- begin
11
- folder = params[:xcodeproj] ? File.join('.', params[:xcodeproj], '..') : '.'
12
-
13
- command_prefix = [
14
- 'cd',
15
- File.expand_path(folder).shellescape,
16
- '&&'
17
- ].join(' ')
10
+ folder = params[:xcodeproj] ? File.join('.', params[:xcodeproj], '..') : '.'
18
11
 
19
- command = [
20
- command_prefix,
21
- 'agvtool',
22
- 'what-marketing-version',
23
- '-terse1'
24
- ].join(' ')
12
+ command_prefix = [
13
+ 'cd',
14
+ File.expand_path(folder).shellescape,
15
+ '&&'
16
+ ].join(' ')
25
17
 
26
- if Helper.test?
27
- Actions.lane_context[SharedValues::VERSION_NUMBER] = command
28
- else
18
+ command = [
19
+ command_prefix,
20
+ 'agvtool',
21
+ 'what-marketing-version',
22
+ '-terse1'
23
+ ].join(' ')
29
24
 
30
- version_number = (Actions.sh command).split("\n").last
25
+ if Helper.test?
26
+ Actions.lane_context[SharedValues::VERSION_NUMBER] = command
27
+ else
31
28
 
32
- # Store the number in the shared hash
33
- Actions.lane_context[SharedValues::VERSION_NUMBER] = version_number
34
- end
35
- rescue => ex
36
- Helper.log.error 'Make sure to to follow the steps to setup your Xcode project: https://developer.apple.com/library/ios/qa/qa1827/_index.html'.yellow
37
- raise ex
29
+ version_number = (Actions.sh command).split("\n").last
30
+
31
+ # Store the number in the shared hash
32
+ Actions.lane_context[SharedValues::VERSION_NUMBER] = version_number
38
33
  end
34
+ rescue => ex
35
+ Helper.log.error 'Make sure to to follow the steps to setup your Xcode project: https://developer.apple.com/library/ios/qa/qa1827/_index.html'.yellow
36
+ raise ex
39
37
  end
40
38
 
41
39
  #####################################################
@@ -51,7 +49,7 @@ module Fastlane
51
49
  "This action will return the current version number set on your project.",
52
50
  "You first have to set up your Xcode project, if you haven't done it already:",
53
51
  "https://developer.apple.com/library/ios/qa/qa1827/_index.html"
54
- ].join(' ')
52
+ ].join(' ')
55
53
  end
56
54
 
57
55
  def self.available_options
@@ -60,9 +58,9 @@ module Fastlane
60
58
  env_name: "FL_VERSION_NUMBER_PROJECT",
61
59
  description: "optional, you must specify the path to your main Xcode project if it is not in the project root directory",
62
60
  optional: true,
63
- verify_block: Proc.new do |value|
64
- raise "Please pass the path to the project, not the workspace".red if value.include?"workspace"
65
- raise "Could not find Xcode project".red if (not File.exists?(value) and not Helper.is_test?)
61
+ verify_block: proc do |value|
62
+ raise "Please pass the path to the project, not the workspace".red if value.include? "workspace"
63
+ raise "Could not find Xcode project".red if !File.exist?(value) and !Helper.is_test?
66
64
  end)
67
65
  ]
68
66
  end
@@ -78,8 +76,8 @@ module Fastlane
78
76
  end
79
77
 
80
78
  def self.is_supported?(platform)
81
- [:ios, :mac].include?platform
79
+ [:ios, :mac].include? platform
82
80
  end
83
81
  end
84
82
  end
85
- end
83
+ end
@@ -1,7 +1,6 @@
1
1
  module Fastlane
2
2
  module Actions
3
3
  module SharedValues
4
-
5
4
  end
6
5
 
7
6
  class GitBranchAction < Action
@@ -38,4 +37,4 @@ module Fastlane
38
37
  end
39
38
  end
40
39
  end
41
- end
40
+ end
@@ -16,7 +16,7 @@ module Fastlane
16
16
  sigh_path = Actions.lane_context[Actions::SharedValues::SIGH_PROFILE_PATH] || ENV["SIGH_PROFILE_PATH"]
17
17
  values[:provisioning_profile_path] = File.expand_path(sigh_path) if sigh_path
18
18
  end
19
-
19
+
20
20
  absolute_ipa_path = File.expand_path(Gym::Manager.new.work(values))
21
21
  absolute_dsym_path = absolute_ipa_path.gsub(".ipa", ".app.dSYM.zip")
22
22
 
@@ -24,7 +24,7 @@ module Fastlane
24
24
  Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH] = absolute_dsym_path if File.exist?(absolute_dsym_path)
25
25
  ENV[SharedValues::IPA_OUTPUT_PATH.to_s] = absolute_ipa_path # for deliver
26
26
  ENV[SharedValues::DSYM_OUTPUT_PATH.to_s] = absolute_dsym_path if File.exist?(absolute_dsym_path)
27
-
27
+
28
28
  return absolute_ipa_path
29
29
  ensure
30
30
  FastlaneCore::UpdateChecker.show_update_status('gym', Gym::VERSION)
@@ -1,3 +1,4 @@
1
+ # rubocop:disable Metrics/AbcSize
1
2
  module Fastlane
2
3
  module Actions
3
4
  # Commits version bump.
@@ -25,7 +26,7 @@ module Fastlane
25
26
  end
26
27
  else
27
28
  # find an xcodeproj (ignoring the Cocoapods one)
28
- xcodeproj_paths = Dir[File.expand_path(File.join(repo_path, '**/*.xcodeproj'))].reject { |path| /Pods\/.*.xcodeproj/ =~ path }
29
+ xcodeproj_paths = Dir[File.expand_path(File.join(repo_path, '**/*.xcodeproj'))].reject { |path| %r{Pods\/.*.xcodeproj} =~ path }
29
30
 
30
31
  # no projects found: error
31
32
  raise 'Could not find a .xcodeproj in the current repository\'s working directory.'.red if xcodeproj_paths.count == 0
@@ -49,8 +50,20 @@ module Fastlane
49
50
  pbxproj_path = pbxproj_pathname.relative_path_from(repo_pathname).to_s
50
51
 
51
52
  # find the info_plist files
53
+ # rubocop:disable Style/MultilineBlockChain
52
54
  project = Xcodeproj::Project.open(xcodeproj_path)
53
- info_plist_files = project.objects.select { |object| object.isa == 'XCBuildConfiguration' }.map(&:to_hash).map { |object_hash| object_hash['buildSettings'] }.select { |build_settings| build_settings.key?('INFOPLIST_FILE') }.map { |build_settings| build_settings['INFOPLIST_FILE'] }.uniq.map { |info_plist_path| Pathname.new(File.expand_path(File.join(xcodeproj_path, '..', info_plist_path))).relative_path_from(repo_pathname).to_s }
55
+ info_plist_files = project.objects.select do |object|
56
+ object.isa == 'XCBuildConfiguration'
57
+ end.map(&:to_hash).map do |object_hash|
58
+ object_hash['buildSettings']
59
+ end.select do |build_settings|
60
+ build_settings.key?('INFOPLIST_FILE')
61
+ end.map do |build_settings|
62
+ build_settings['INFOPLIST_FILE']
63
+ end.uniq.map do |info_plist_path|
64
+ Pathname.new(File.expand_path(File.join(xcodeproj_path, '..', info_plist_path))).relative_path_from(repo_pathname).to_s
65
+ end
66
+ # rubocop:enable Style/MultilineBlockChain
54
67
 
55
68
  # create our list of files that we expect to have changed, they should all be relative to the project root, which should be equal to the hg workdir root
56
69
  expected_changed_files = []
@@ -71,7 +84,14 @@ module Fastlane
71
84
  changed_files_as_expected = dirty_set.subset? expected_set
72
85
  unless changed_files_as_expected
73
86
  unless params[:force]
74
- raise "Found unexpected uncommited changes in the working directory. Expected these files to have changed: \n#{expected_changed_files.join("\n")}.\nBut found these actual changes: \n#{hg_dirty_files.join("\n")}.\nMake sure you have cleaned up the build artifacts and are only left with the changed version files at this stage in your lane, and don't touch the working directory while your lane is running. You can also use the :force option to bypass this check, and always commit a version bump regardless of the state of the working directory.".red
87
+ str = ["Found unexpected uncommited changes in the working directory. Expected these files to have changed:",
88
+ "#{expected_changed_files.join("\n")}.",
89
+ "But found these actual changes: \n#{hg_dirty_files.join("\n")}.",
90
+ "Make sure you have cleaned up the build artifacts and are only left with the changed version files at this",
91
+ "stage in your lane, and don't touch the working directory while your lane is running. You can also use the :force option to ",
92
+ "bypass this check, and always commit a version bump regardless of the state of the working directory."
93
+ ].join("\n")
94
+ raise str.red
75
95
  end
76
96
  end
77
97
 
@@ -83,6 +103,7 @@ module Fastlane
83
103
 
84
104
  Helper.log.info "Committed \"#{params[:message]}\" 💾.".green
85
105
  rescue => ex
106
+ Helper.log.error ex
86
107
  Helper.log.info "Didn't commit any changes. 😐".yellow
87
108
  end
88
109
  end
@@ -101,9 +122,9 @@ module Fastlane
101
122
  env_name: "FL_BUILD_NUMBER_PROJECT",
102
123
  description: "The path to your project file (Not the workspace). If you have only one, this is optional",
103
124
  optional: true,
104
- verify_block: Proc.new do |value|
105
- raise "Please pass the path to the project, not the workspace".red if value.include?"workspace"
106
- raise "Could not find Xcode project".red unless File.exists?(value)
125
+ verify_block: proc do |value|
126
+ raise "Please pass the path to the project, not the workspace".red if value.include? "workspace"
127
+ raise "Could not find Xcode project".red unless File.exist?(value)
107
128
  end),
108
129
  FastlaneCore::ConfigItem.new(key: :force,
109
130
  env_name: "FL_FORCE_COMMIT",
@@ -135,3 +156,4 @@ module Fastlane
135
156
  end
136
157
  end
137
158
  end
159
+ # rubocop:enable Metrics/AbcSize