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
@@ -22,12 +22,12 @@ module Fastlane
22
22
 
23
23
  response = https.request(req)
24
24
  case response.code.to_i
25
- when 200..299
26
- Helper.log.info 'Successfully sent notification to ChatWork right now 📢'.green
27
- else
28
- require 'json'
29
- json = JSON.parse(response.body)
30
- raise "HTTP Error: #{response.code} #{json['errors']}".red
25
+ when 200..299
26
+ Helper.log.info 'Successfully sent notification to ChatWork right now 📢'.green
27
+ else
28
+ require 'json'
29
+ json = JSON.parse(response.body)
30
+ raise "HTTP Error: #{response.code} #{json['errors']}".red
31
31
  end
32
32
  end
33
33
 
@@ -40,11 +40,11 @@ module Fastlane
40
40
  FastlaneCore::ConfigItem.new(key: :api_token,
41
41
  env_name: "CHATWORK_API_TOKEN",
42
42
  description: "ChatWork API Token",
43
- verify_block: Proc.new do |value|
44
- unless value.to_s.length > 0
45
- Helper.log.fatal "Please add 'ENV[\"CHATWORK_API_TOKEN\"] = \"your token\"' to your Fastfile's `before_all` section.".red
46
- raise 'No CHATWORK_API_TOKEN given.'.red
47
- end
43
+ verify_block: proc do |value|
44
+ unless value.to_s.length > 0
45
+ Helper.log.fatal "Please add 'ENV[\"CHATWORK_API_TOKEN\"] = \"your token\"' to your Fastfile's `before_all` section.".red
46
+ raise 'No CHATWORK_API_TOKEN given.'.red
47
+ end
48
48
  end),
49
49
  FastlaneCore::ConfigItem.new(key: :message,
50
50
  env_name: "FL_CHATWORK_MESSAGE",
@@ -59,7 +59,7 @@ module Fastlane
59
59
  optional: true,
60
60
  default_value: true,
61
61
  is_string: false)
62
- ]
62
+ ]
63
63
  end
64
64
 
65
65
  def self.author
@@ -5,16 +5,14 @@ module Fastlane
5
5
  [
6
6
  Actions.lane_context[Actions::SharedValues::IPA_OUTPUT_PATH],
7
7
  Actions.lane_context[Actions::SharedValues::SIGH_PROFILE_PATH],
8
- Actions.lane_context[Actions::SharedValues::DSYM_OUTPUT_PATH],
9
- ].reject { |file| file.nil? || !File.exist?(file) }.each do |file|
10
-
8
+ Actions.lane_context[Actions::SharedValues::DSYM_OUTPUT_PATH]
9
+ ].reject { |file| file.nil? || !File.exist?(file) }.each do |file|
11
10
  if options[:exclude_pattern]
12
11
  next if file.match(options[:exclude_pattern])
13
12
  end
14
13
 
15
14
  Helper.log.debug "Cleaning up '#{file}'".yellow
16
- File.delete(file)
17
-
15
+ File.delete(file)
18
16
  end
19
17
 
20
18
  Helper.log.info 'Cleaned up build artifacts 🐙'.green
@@ -39,7 +37,7 @@ module Fastlane
39
37
  end
40
38
 
41
39
  def self.is_supported?(platform)
42
- [:ios, :mac].include?platform
40
+ [:ios, :mac].include? platform
43
41
  end
44
42
  end
45
43
  end
@@ -32,4 +32,4 @@ module Fastlane
32
32
  end
33
33
  end
34
34
  end
35
- end
35
+ end
@@ -1,3 +1,4 @@
1
+ # rubocop:disable Metrics/AbcSize
1
2
  module Fastlane
2
3
  module Actions
3
4
  # Commits the current changes in the repo as a version bump, checking to make sure only files which contain version information have been changed.
@@ -19,7 +20,7 @@ module Fastlane
19
20
  raise "Could not find the specified xcodeproj: #{xcodeproj_path}" unless File.directory?(xcodeproj_path)
20
21
  else
21
22
  # find an xcodeproj (ignoring the Cocoapods one)
22
- xcodeproj_paths = Dir[File.expand_path(File.join(repo_path, '**/*.xcodeproj'))].reject { |path| /Pods\/.*.xcodeproj/ =~ path }
23
+ xcodeproj_paths = Dir[File.expand_path(File.join(repo_path, '**/*.xcodeproj'))].reject { |path| %r{Pods\/.*.xcodeproj} =~ path }
23
24
 
24
25
  # no projects found: error
25
26
  raise 'Could not find a .xcodeproj in the current repository\'s working directory.'.red if xcodeproj_paths.count == 0
@@ -39,8 +40,20 @@ module Fastlane
39
40
  pbxproj_path = pbxproj_pathname.relative_path_from(repo_pathname).to_s
40
41
 
41
42
  # find the info_plist files
43
+ # rubocop:disable Style/MultilineBlockChain
42
44
  project = Xcodeproj::Project.open(xcodeproj_path)
43
- 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 }
45
+ info_plist_files = project.objects.select do |object|
46
+ object.isa == 'XCBuildConfiguration'
47
+ end.map(&:to_hash).map do |object_hash|
48
+ object_hash['buildSettings']
49
+ end.select do |build_settings|
50
+ build_settings.key?('INFOPLIST_FILE')
51
+ end.map do |build_settings|
52
+ build_settings['INFOPLIST_FILE']
53
+ end.uniq.map do |info_plist_path|
54
+ Pathname.new(File.expand_path(File.join(xcodeproj_path, '..', info_plist_path))).relative_path_from(repo_pathname).to_s
55
+ end
56
+ # rubocop:enable Style/MultilineBlockChain
44
57
 
45
58
  # 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 git workdir root
46
59
  expected_changed_files = []
@@ -58,25 +71,36 @@ module Fastlane
58
71
  changed_files_as_expected = (Set.new(git_dirty_files.map(&:downcase)).subset? Set.new(expected_changed_files.map(&:downcase)))
59
72
  unless changed_files_as_expected
60
73
  unless params[:force]
61
- 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#{git_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
74
+ error = [
75
+ "Found unexpected uncommited changes in the working directory. Expected these files to have ",
76
+ "changed: \n#{expected_changed_files.join("\n")}.\nBut found these actual changes: ",
77
+ "#{git_dirty_files.join("\n")}.\nMake sure you have cleaned up the build artifacts and ",
78
+ "are only left with the changed version files at this stage in your lane, and don't touch the ",
79
+ "working directory while your lane is running. You can also use the :force option to bypass this ",
80
+ "check, and always commit a version bump regardless of the state of the working directory."
81
+ ].join("\n")
82
+ raise error.red
62
83
  end
63
84
  end
64
85
 
65
86
  # get the absolute paths to the files
66
- git_add_paths = expected_changed_files.map { |path| File.expand_path(File.join(repo_pathname, path)) }
87
+ git_add_paths = expected_changed_files.map do |path|
88
+ File.expand_path(File.join(repo_pathname, path))
89
+ end
67
90
 
68
91
  # then create a commit with a message
69
92
  Actions.sh("git add #{git_add_paths.map(&:shellescape).join(' ')}")
70
93
 
71
94
  begin
72
95
  build_number = Actions.lane_context[Actions::SharedValues::BUILD_NUMBER]
73
-
96
+
74
97
  params[:message] ||= (build_number ? "Version Bump to #{build_number}" : "Version Bump")
75
-
98
+
76
99
  Actions.sh("git commit -m '#{params[:message]}'")
77
100
 
78
101
  Helper.log.info "Committed \"#{params[:message]}\" 💾.".green
79
102
  rescue => ex
103
+ Helper.log.error ex
80
104
  Helper.log.info "Didn't commit any changes.".yellow
81
105
  end
82
106
  end
@@ -95,9 +119,9 @@ module Fastlane
95
119
  env_name: "FL_BUILD_NUMBER_PROJECT",
96
120
  description: "The path to your project file (Not the workspace). If you have only one, this is optional",
97
121
  optional: true,
98
- verify_block: Proc.new do |value|
99
- raise "Please pass the path to the project, not the workspace".red if value.include?"workspace"
100
- raise "Could not find Xcode project".red unless File.exists?(value)
122
+ verify_block: proc do |value|
123
+ raise "Please pass the path to the project, not the workspace".red if value.include? "workspace"
124
+ raise "Could not find Xcode project".red unless File.exist?(value)
101
125
  end),
102
126
  FastlaneCore::ConfigItem.new(key: :force,
103
127
  env_name: "FL_FORCE_COMMIT",
@@ -113,8 +137,9 @@ module Fastlane
113
137
  end
114
138
 
115
139
  def self.is_supported?(platform)
116
- [:ios, :mac].include?platform
140
+ [:ios, :mac].include? platform
117
141
  end
118
142
  end
119
143
  end
120
144
  end
145
+ # rubocop:enable Metrics/AbcSize
@@ -5,9 +5,9 @@ end
5
5
  module Fastlane
6
6
  module Actions
7
7
  class CrashlyticsAction < Action
8
-
8
+
9
9
  def self.is_supported?(platform)
10
- [:ios, :mac].include?platform
10
+ [:ios, :mac].include? platform
11
11
  end
12
12
 
13
13
  def self.run(params)
@@ -27,19 +27,19 @@ module Fastlane
27
27
  # Normalized notification to Crashlytics notification parameter requirement
28
28
  # 'YES' or 'NO' - String
29
29
  case params[:notifications]
30
- when String
31
- if params[:notifications] == 'YES' || params[:notifications] == 'NO'
32
- notifications = params[:notifications]
33
- else
34
- notifications = 'YES' if params[:notifications] == 'true'
35
- notifications = 'NO' if params[:notifications] == 'false'
36
- end
37
- when TrueClass
38
- notifications = 'YES'
39
- when FalseClass
40
- notifications = 'NO'
30
+ when String
31
+ if params[:notifications] == 'YES' || params[:notifications] == 'NO'
32
+ notifications = params[:notifications]
41
33
  else
42
- notifications = nil
34
+ notifications = 'YES' if params[:notifications] == 'true'
35
+ notifications = 'NO' if params[:notifications] == 'false'
36
+ end
37
+ when TrueClass
38
+ notifications = 'YES'
39
+ when FalseClass
40
+ notifications = 'NO'
41
+ else
42
+ notifications = nil
43
43
  end
44
44
 
45
45
  Helper.log.info 'Uploading the IPA to Crashlytics. Go for a coffee ☕️.'.green
@@ -70,34 +70,34 @@ module Fastlane
70
70
  FastlaneCore::ConfigItem.new(key: :crashlytics_path,
71
71
  env_name: "CRASHLYTICS_FRAMEWORK_PATH",
72
72
  description: "Path to the submit binary in the Crashlytics bundle",
73
- verify_block: Proc.new do |value|
74
- raise "No Crashlytics path given or found, pass using `crashlytics_path: 'path'`".red unless File.exists?(value)
73
+ verify_block: proc do |value|
74
+ raise "No Crashlytics path given or found, pass using `crashlytics_path: 'path'`".red unless File.exist?(value)
75
75
  end),
76
76
  FastlaneCore::ConfigItem.new(key: :api_token,
77
77
  env_name: "CRASHLYTICS_API_TOKEN",
78
78
  description: "Crashlytics Beta API Token",
79
- verify_block: Proc.new do |value|
80
- raise "No API token for Crashlytics given, pass using `api_token: 'token'`".red unless (value and not value.empty?)
79
+ verify_block: proc do |value|
80
+ raise "No API token for Crashlytics given, pass using `api_token: 'token'`".red unless value and !value.empty?
81
81
  end),
82
82
  FastlaneCore::ConfigItem.new(key: :build_secret,
83
83
  env_name: "CRASHLYTICS_BUILD_SECRET",
84
84
  description: "Crashlytics Build Secret",
85
- verify_block: Proc.new do |value|
86
- raise "No build secret for Crashlytics given, pass using `build_secret: 'secret'`".red unless (value and not value.empty?)
85
+ verify_block: proc do |value|
86
+ raise "No build secret for Crashlytics given, pass using `build_secret: 'secret'`".red unless value and !value.empty?
87
87
  end),
88
88
  FastlaneCore::ConfigItem.new(key: :ipa_path,
89
89
  env_name: "CRASHLYTICS_IPA_PATH",
90
90
  description: "Path to your IPA file. Optional if you use the `ipa` or `xcodebuild` action",
91
91
  default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH],
92
- verify_block: Proc.new do |value|
93
- raise "Couldn't find ipa file at path '#{value}'".red unless File.exists?(value)
92
+ verify_block: proc do |value|
93
+ raise "Couldn't find ipa file at path '#{value}'".red unless File.exist?(value)
94
94
  end),
95
95
  FastlaneCore::ConfigItem.new(key: :notes_path,
96
96
  env_name: "CRASHLYTICS_NOTES_PATH",
97
97
  description: "Path to the release notes",
98
98
  optional: true,
99
- verify_block: Proc.new do |value|
100
- raise "Path '#{value}' not found".red unless File.exists?(value)
99
+ verify_block: proc do |value|
100
+ raise "Path '#{value}' not found".red unless File.exist?(value)
101
101
  end),
102
102
  FastlaneCore::ConfigItem.new(key: :groups,
103
103
  env_name: "CRASHLYTICS_GROUPS",
@@ -112,8 +112,8 @@ module Fastlane
112
112
  description: "Crashlytics notification option (true/false)",
113
113
  optional: true,
114
114
  is_string: false,
115
- verify_block: Proc.new do |value|
116
- raise "Crashlytics supported notifications options: TrueClass, FalseClass, 'true', 'false', 'YES', 'NO'".red unless (value.is_a?(TrueClass) || value.is_a?(FalseClass) || value.is_a?(String))
115
+ verify_block: proc do |value|
116
+ raise "Crashlytics supported notifications options: TrueClass, FalseClass, 'true', 'false', 'YES', 'NO'".red unless value.kind_of?(TrueClass) || value.kind_of?(FalseClass) || value.kind_of?(String)
117
117
  end)
118
118
  ]
119
119
  end
@@ -12,14 +12,14 @@ module Fastlane
12
12
  escaped_password = params[:password].shellescape
13
13
 
14
14
  commands = []
15
- commands << Fastlane::Actions.sh("security create-keychain -p #{escaped_password} #{escaped_name}", log:false)
15
+ commands << Fastlane::Actions.sh("security create-keychain -p #{escaped_password} #{escaped_name}", log: false)
16
16
 
17
17
  if params[:default_keychain]
18
- Actions.lane_context[Actions::SharedValues::ORIGINAL_DEFAULT_KEYCHAIN] = Fastlane::Actions.sh("security default-keychain", log:false).strip
19
- commands << Fastlane::Actions.sh("security default-keychain -s #{escaped_name}", log:false)
18
+ Actions.lane_context[Actions::SharedValues::ORIGINAL_DEFAULT_KEYCHAIN] = Fastlane::Actions.sh("security default-keychain", log: false).strip
19
+ commands << Fastlane::Actions.sh("security default-keychain -s #{escaped_name}", log: false)
20
20
  end
21
21
 
22
- commands << Fastlane::Actions.sh("security unlock-keychain -p #{escaped_password} #{escaped_name}", log:false) if params[:unlock]
22
+ commands << Fastlane::Actions.sh("security unlock-keychain -p #{escaped_password} #{escaped_name}", log: false) if params[:unlock]
23
23
 
24
24
  command = "security set-keychain-settings"
25
25
  command << " -t #{params[:timeout]}" if params[:timeout]
@@ -27,7 +27,7 @@ module Fastlane
27
27
  command << " -u" if params[:lock_after_timeout]
28
28
  command << " ~/Library/Keychains/#{escaped_name}"
29
29
 
30
- commands << Fastlane::Actions.sh(command, log:false)
30
+ commands << Fastlane::Actions.sh(command, log: false)
31
31
  commands
32
32
  end
33
33
 
@@ -64,7 +64,7 @@ module Fastlane
64
64
  FastlaneCore::ConfigItem.new(key: :lock_after_timeout,
65
65
  description: 'Lock keychain after timeout interval',
66
66
  is_string: false,
67
- default_value: false),
67
+ default_value: false)
68
68
  ]
69
69
  end
70
70
 
@@ -10,7 +10,7 @@ module Fastlane
10
10
 
11
11
  platform = params.first.to_sym
12
12
 
13
- SupportedPlatforms.verify!platform
13
+ SupportedPlatforms.verify! platform
14
14
 
15
15
  Actions.lane_context[SharedValues::DEFAULT_PLATFORM] = platform
16
16
  end
@@ -5,8 +5,8 @@ module Fastlane
5
5
  class DeleteKeychainAction < Action
6
6
  def self.run(params)
7
7
  original = Actions.lane_context[Actions::SharedValues::ORIGINAL_DEFAULT_KEYCHAIN]
8
- Fastlane::Actions.sh("security default-keychain -s #{original}", log:false) unless original.nil?
9
- Fastlane::Actions.sh "security delete-keychain #{params[:name].shellescape}", log:false
8
+ Fastlane::Actions.sh("security default-keychain -s #{original}", log: false) unless original.nil?
9
+ Fastlane::Actions.sh "security delete-keychain #{params[:name].shellescape}", log: false
10
10
  end
11
11
 
12
12
  def self.description
@@ -18,7 +18,7 @@ module Fastlane
18
18
  FastlaneCore::ConfigItem.new(key: :name,
19
19
  env_name: "KEYCHAIN_NAME",
20
20
  description: "Keychain name",
21
- optional: false),
21
+ optional: false)
22
22
  ]
23
23
  end
24
24
 
@@ -69,8 +69,8 @@ module Fastlane
69
69
  env_name: "FL_DELIVER_CONFIG_PATH",
70
70
  description: "Specify a path to the directory containing the Deliverfile",
71
71
  default_value: FastlaneFolder.path || Dir.pwd, # defaults to fastlane folder
72
- verify_block: Proc.new do |value|
73
- raise "Couldn't find folder '#{value}'. Make sure to pass the path to the directory not the file!".red unless File.directory?(value)
72
+ verify_block: proc do |value|
73
+ raise "Couldn't find folder '#{value}'. Make sure to pass the path to the directory not the file!".red unless File.directory?(value)
74
74
  end)
75
75
  ]
76
76
  end
@@ -80,7 +80,7 @@ module Fastlane
80
80
  end
81
81
 
82
82
  def self.is_supported?(platform)
83
- [:ios, :mac].include?platform
83
+ [:ios, :mac].include? platform
84
84
  end
85
85
  end
86
86
  end
@@ -42,17 +42,18 @@ module Fastlane
42
42
 
43
43
  def self.parse_response(response)
44
44
  if response.body && response.body.key?('error')
45
- unless response.body['error']
45
+
46
+ if response.body['error']
47
+ Helper.log.error "Error uploading to DeployGate: #{response.body['message']}".red
48
+ help_message(response)
49
+ return
50
+ else
46
51
  res = response.body['results']
47
52
  url = DEPLOYGATE_URL_BASE + res['path']
48
53
 
49
54
  Actions.lane_context[SharedValues::DEPLOYGATE_URL] = url
50
55
  Actions.lane_context[SharedValues::DEPLOYGATE_REVISION] = res['revision']
51
56
  Actions.lane_context[SharedValues::DEPLOYGATE_APP_INFO] = res
52
- else
53
- Helper.log.error "Error uploading to DeployGate: #{response.body['message']}".red
54
- help_message(response)
55
- return
56
57
  end
57
58
  else
58
59
  Helper.log.fatal "Error uploading to DeployGate: #{response.body}".red
@@ -65,12 +66,12 @@ module Fastlane
65
66
  def self.help_message(response)
66
67
  message =
67
68
  case response.body['message']
68
- when 'you are not authenticated'
69
- 'Invalid API Token specified.'
70
- when 'application create error: permit'
71
- 'Access denied: May be trying to upload to wrong user or updating app you join as a tester?'
72
- when 'application create error: limit'
73
- 'Plan limit: You have reached to the limit of current plan or your plan was expired.'
69
+ when 'you are not authenticated'
70
+ 'Invalid API Token specified.'
71
+ when 'application create error: permit'
72
+ 'Access denied: May be trying to upload to wrong user or updating app you join as a tester?'
73
+ when 'application create error: limit'
74
+ 'Plan limit: You have reached to the limit of current plan or your plan was expired.'
74
75
  end
75
76
  Helper.log.error message.red if message
76
77
  end
@@ -85,21 +86,21 @@ module Fastlane
85
86
  FastlaneCore::ConfigItem.new(key: :api_token,
86
87
  env_name: "DEPLOYGATE_API_TOKEN",
87
88
  description: "Deploygate API Token",
88
- verify_block: Proc.new do |value|
89
- raise "No API Token for DeployGate given, pass using `api_token: 'token'`".red unless value.to_s.length > 0
89
+ verify_block: proc do |value|
90
+ raise "No API Token for DeployGate given, pass using `api_token: 'token'`".red unless value.to_s.length > 0
90
91
  end),
91
92
  FastlaneCore::ConfigItem.new(key: :user,
92
93
  env_name: "DEPLOYGATE_USER",
93
- description: "Target username or organization name",
94
- verify_block: Proc.new do |value|
95
- raise "No User for app given, pass using `user: 'user'`".red unless value.to_s.length > 0
94
+ description: "Target username or organization name",
95
+ verify_block: proc do |value|
96
+ raise "No User for app given, pass using `user: 'user'`".red unless value.to_s.length > 0
96
97
  end),
97
98
  FastlaneCore::ConfigItem.new(key: :ipa,
98
99
  env_name: "DEPLOYGATE_IPA_PATH",
99
100
  description: "Path to your IPA file. Optional if you use the `ipa` or `xcodebuild` action",
100
101
  default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH],
101
- verify_block: Proc.new do |value|
102
- raise "Couldn't find ipa file at path '#{value}'".red unless File.exists?(value)
102
+ verify_block: proc do |value|
103
+ raise "Couldn't find ipa file at path '#{value}'".red unless File.exist?(value)
103
104
  end),
104
105
  FastlaneCore::ConfigItem.new(key: :message,
105
106
  env_name: "DEPLOYGATE_MESSAGE",
@@ -10,30 +10,28 @@ module Fastlane
10
10
  def self.run(params)
11
11
  archive = params[:archive_path]
12
12
  params[:dsym_path] ||= File.join("#{File.basename(archive, '.*')}.app.dSYM.zip")
13
-
13
+
14
14
  dsym_folder_path = File.expand_path(File.join(archive, 'dSYMs'))
15
15
  zipped_dsym_path = File.expand_path(params[:dsym_path])
16
16
 
17
17
  Actions.lane_context[SharedValues::DSYM_ZIP_PATH] = zipped_dsym_path
18
18
 
19
19
  if params[:all]
20
- Actions.sh(%Q[cd "#{dsym_folder_path}" && zip -r "#{zipped_dsym_path}" "#{dsym_folder_path}"/*.dSYM])
20
+ Actions.sh(%(cd "#{dsym_folder_path}" && zip -r "#{zipped_dsym_path}" "#{dsym_folder_path}"/*.dSYM))
21
21
  else
22
- plist = Plist::parse_xml(File.join(archive, 'Info.plist'))
22
+ plist = Plist.parse_xml(File.join(archive, 'Info.plist'))
23
23
  app_name = Helper.test? ? 'MyApp.app' : File.basename(plist['ApplicationProperties']['ApplicationPath'])
24
24
  dsym_name = "#{app_name}.dSYM"
25
- Actions.sh(%Q[cd "#{dsym_folder_path}" && zip -r "#{zipped_dsym_path}" "#{dsym_name}"])
25
+ Actions.sh(%(cd "#{dsym_folder_path}" && zip -r "#{zipped_dsym_path}" "#{dsym_name}"))
26
26
  end
27
-
28
27
  end
29
28
 
30
-
31
29
  #####################################################
32
30
  # @!group Documentation
33
31
  #####################################################
34
32
 
35
33
  def self.is_supported?(platform)
36
- [:ios, :mac].include?platform
34
+ [:ios, :mac].include? platform
37
35
  end
38
36
 
39
37
  def self.description
@@ -47,8 +45,8 @@ module Fastlane
47
45
  default_value: Actions.lane_context[SharedValues::XCODEBUILD_ARCHIVE],
48
46
  optional: true,
49
47
  env_name: 'DSYM_ZIP_XCARCHIVE_PATH',
50
- verify_block: Proc.new do |value|
51
- raise "Couldn't find xcarchive file at path '#{value}'".red if !Helper.test? && !File.exists?(value)
48
+ verify_block: proc do |value|
49
+ raise "Couldn't find xcarchive file at path '#{value}'".red if !Helper.test? && !File.exist?(value)
52
50
  end),
53
51
  FastlaneCore::ConfigItem.new(key: :dsym_path,
54
52
  description: 'Path for generated dsym. Optional, default is your apps root directory',