fastlane 2.141.0 → 2.146.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +82 -82
  4. data/credentials_manager/lib/credentials_manager/appfile_config.rb +4 -0
  5. data/deliver/lib/deliver/app_screenshot.rb +1 -0
  6. data/deliver/lib/deliver/options.rb +30 -1
  7. data/deliver/lib/deliver/setup.rb +4 -4
  8. data/fastlane/lib/fastlane/actions/.update_code_signing_settings.rb.swp +0 -0
  9. data/fastlane/lib/fastlane/actions/README.md +2 -0
  10. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +13 -5
  11. data/fastlane/lib/fastlane/actions/automatic_code_signing.rb +7 -1
  12. data/fastlane/lib/fastlane/actions/clean_build_artifacts.rb +3 -0
  13. data/fastlane/lib/fastlane/actions/cocoapods.rb +2 -2
  14. data/fastlane/lib/fastlane/actions/crashlytics.rb +14 -2
  15. data/fastlane/lib/fastlane/actions/create_pull_request.rb +7 -1
  16. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +10 -4
  17. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +22 -6
  18. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +23 -7
  19. data/fastlane/lib/fastlane/actions/ensure_git_branch.rb +1 -1
  20. data/fastlane/lib/fastlane/actions/ensure_xcode_version.rb +35 -7
  21. data/fastlane/lib/fastlane/actions/frame_screenshots.rb +2 -1
  22. data/fastlane/lib/fastlane/actions/get_github_release.rb +3 -0
  23. data/fastlane/lib/fastlane/actions/get_version_number.rb +1 -1
  24. data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +9 -3
  25. data/fastlane/lib/fastlane/actions/notarize.rb +183 -0
  26. data/fastlane/lib/fastlane/actions/pod_lib_lint.rb +7 -1
  27. data/fastlane/lib/fastlane/actions/s3.rb +5 -291
  28. data/fastlane/lib/fastlane/actions/setup_ci.rb +1 -1
  29. data/fastlane/lib/fastlane/actions/setup_jenkins.rb +11 -2
  30. data/fastlane/lib/fastlane/actions/slather.rb +1 -1
  31. data/fastlane/lib/fastlane/actions/spm.rb +8 -0
  32. data/fastlane/lib/fastlane/actions/swiftlint.rb +45 -9
  33. data/fastlane/lib/fastlane/actions/update_code_signing_settings.rb +198 -0
  34. data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +14 -4
  35. data/fastlane/lib/fastlane/actions/verify_build.rb +1 -1
  36. data/fastlane/lib/fastlane/helper/adb_helper.rb +1 -1
  37. data/fastlane/lib/fastlane/helper/s3_client_helper.rb +61 -0
  38. data/fastlane/lib/fastlane/plugins/plugin_manager.rb +1 -1
  39. data/fastlane/lib/fastlane/server/socket_server_action_command_executor.rb +1 -1
  40. data/fastlane/lib/fastlane/version.rb +1 -1
  41. data/fastlane/swift/Deliverfile.swift +1 -1
  42. data/fastlane/swift/Fastlane.swift +201 -13
  43. data/fastlane/swift/Gymfile.swift +1 -1
  44. data/fastlane/swift/Matchfile.swift +1 -1
  45. data/fastlane/swift/MatchfileProtocol.swift +17 -1
  46. data/fastlane/swift/Precheckfile.swift +1 -1
  47. data/fastlane/swift/RubyCommand.swift +1 -1
  48. data/fastlane/swift/Scanfile.swift +1 -1
  49. data/fastlane/swift/ScanfileProtocol.swift +9 -1
  50. data/fastlane/swift/Screengrabfile.swift +1 -1
  51. data/fastlane/swift/Snapshotfile.swift +1 -1
  52. data/fastlane_core/lib/fastlane_core/configuration/config_item.rb +9 -0
  53. data/fastlane_core/lib/fastlane_core/device_manager.rb +3 -3
  54. data/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb +1 -0
  55. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +2 -0
  56. data/fastlane_core/lib/fastlane_core/project.rb +4 -0
  57. data/fastlane_core/lib/fastlane_core/provisioning_profile.rb +15 -2
  58. data/frameit/lib/frameit/commands_generator.rb +25 -0
  59. data/frameit/lib/frameit/config_parser.rb +31 -9
  60. data/frameit/lib/frameit/device.rb +90 -0
  61. data/frameit/lib/frameit/device_types.rb +121 -5
  62. data/frameit/lib/frameit/editor.rb +29 -41
  63. data/frameit/lib/frameit/offsets.rb +8 -1
  64. data/frameit/lib/frameit/options.rb +81 -54
  65. data/frameit/lib/frameit/runner.rb +17 -7
  66. data/frameit/lib/frameit/screenshot.rb +39 -47
  67. data/frameit/lib/frameit/template_finder.rb +15 -12
  68. data/gym/lib/gym/generators/package_command_generator.rb +4 -0
  69. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +5 -0
  70. data/gym/lib/gym/runner.rb +16 -2
  71. data/match/lib/match/change_password.rb +1 -1
  72. data/match/lib/match/encryption.rb +4 -0
  73. data/match/lib/match/importer.rb +37 -20
  74. data/match/lib/match/module.rb +1 -1
  75. data/match/lib/match/nuke.rb +5 -1
  76. data/match/lib/match/options.rb +18 -0
  77. data/match/lib/match/runner.rb +4 -0
  78. data/match/lib/match/setup.rb +1 -1
  79. data/match/lib/match/storage.rb +4 -0
  80. data/match/lib/match/storage/google_cloud_storage.rb +2 -2
  81. data/match/lib/match/storage/s3_storage.rb +167 -0
  82. data/pilot/lib/pilot/build_manager.rb +24 -7
  83. data/pilot/lib/pilot/options.rb +8 -0
  84. data/produce/lib/produce/developer_center.rb +11 -2
  85. data/produce/lib/produce/itunes_connect.rb +11 -3
  86. data/produce/lib/produce/options.rb +12 -0
  87. data/scan/lib/scan/options.rb +10 -0
  88. data/scan/lib/scan/runner.rb +9 -7
  89. data/scan/lib/scan/test_command_generator.rb +11 -4
  90. data/screengrab/lib/screengrab/runner.rb +32 -19
  91. data/snapshot/lib/snapshot/fixes/simulator_shared_pasteboard.rb +16 -0
  92. data/snapshot/lib/snapshot/reports_generator.rb +4 -0
  93. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +2 -0
  94. data/spaceship/lib/spaceship/connect_api/models/app.rb +11 -0
  95. data/spaceship/lib/spaceship/connect_api/models/build.rb +1 -2
  96. data/spaceship/lib/spaceship/connect_api/models/certificate.rb +2 -0
  97. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +23 -0
  98. data/spaceship/lib/spaceship/portal/app_service.rb +2 -2
  99. data/spaceship/lib/spaceship/portal/portal_client.rb +13 -0
  100. data/spaceship/lib/spaceship/tunes/app_version.rb +6 -1
  101. data/spaceship/lib/spaceship/tunes/application.rb +2 -1
  102. data/spaceship/lib/spaceship/tunes/tunes_client.rb +2 -2
  103. data/spaceship/lib/spaceship/two_step_or_factor_client.rb +52 -16
  104. data/supply/lib/supply/client.rb +4 -4
  105. data/supply/lib/supply/setup.rb +5 -3
  106. metadata +37 -16
@@ -93,7 +93,7 @@ module Fastlane
93
93
  env_name: "FL_SETUP_CI_PROVIDER",
94
94
  description: "CI provider. If none is set, the provider is detected automatically",
95
95
  is_string: true,
96
- default_value: false,
96
+ optional: true,
97
97
  verify_block: proc do |value|
98
98
  value = value.to_s
99
99
  # Validate both 'travis' and 'circleci' for backwards compatibility, even
@@ -14,7 +14,10 @@ module Fastlane
14
14
  "SCAN_DERIVED_DATA_PATH",
15
15
  "SCAN_OUTPUT_DIRECTORY",
16
16
  "SCAN_RESULT_BUNDLE",
17
- "XCODE_DERIVED_DATA_PATH"
17
+ "XCODE_DERIVED_DATA_PATH",
18
+ "MATCH_KEYCHAIN_NAME",
19
+ "MATCH_KEYCHAIN_PASSWORD",
20
+ "MATCH_READONLY"
18
21
  ].freeze
19
22
 
20
23
  def self.run(params)
@@ -40,6 +43,9 @@ module Fastlane
40
43
  add_to_search_list: params[:add_keychain_to_search_list],
41
44
  set_default: params[:set_default_keychain]
42
45
  )
46
+ ENV['MATCH_KEYCHAIN_NAME'] ||= keychain_path
47
+ ENV['MATCH_KEYCHAIN_PASSWORD'] ||= params[:keychain_password]
48
+ ENV["MATCH_READONLY"] ||= true.to_s
43
49
  end
44
50
 
45
51
  # Code signing identity
@@ -90,6 +96,7 @@ module Fastlane
90
96
  def self.details
91
97
  list = <<-LIST.markdown_list(true)
92
98
  Adds and unlocks keychains from Jenkins 'Keychains and Provisioning Profiles Plugin'
99
+ Sets unlocked keychain to be used by Match
93
100
  Sets code signing identity from Jenkins 'Keychains and Provisioning Profiles Plugin'
94
101
  Sets output directory to './output' (gym, scan and backup_xcarchive)
95
102
  Sets derived data path to './derivedData' (xcodebuild, gym, scan and clear_derived_data, carthage)
@@ -99,7 +106,9 @@ module Fastlane
99
106
  [
100
107
  list,
101
108
  "This action helps with Jenkins integration. Creates own derived data for each job. All build results like IPA files and archives will be stored in the `./output` directory.",
102
- "The action also works with [Keychains and Provisioning Profiles Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Keychains+and+Provisioning+Profiles+Plugin), the selected keychain will be automatically unlocked and the selected code signing identity will be used. By default this action will only work when _fastlane_ is executed on a CI system."
109
+ "The action also works with [Keychains and Provisioning Profiles Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Keychains+and+Provisioning+Profiles+Plugin), the selected keychain will be automatically unlocked and the selected code signing identity will be used.",
110
+ "[Match](https://docs.fastlane.tools/actions/match/) will be also set up to use the unlocked keychain and set in read-only mode, if its environment variables were not yet defined.",
111
+ "By default this action will only work when _fastlane_ is executed on a CI system."
103
112
  ].join("\n")
104
113
  end
105
114
 
@@ -241,7 +241,7 @@ module Fastlane
241
241
  FastlaneCore::ConfigItem.new(key: :ignore,
242
242
  env_name: "FL_SLATHER_IGNORE",
243
243
  description: "Tell slather to ignore files matching a path or any path from an array of paths",
244
- is_string: false,
244
+ type: Array,
245
245
  optional: true),
246
246
  FastlaneCore::ConfigItem.new(key: :verbose,
247
247
  env_name: "FL_SLATHER_VERBOSE",
@@ -15,6 +15,9 @@ module Fastlane
15
15
  end
16
16
  if params[:xcpretty_output]
17
17
  cmd += ["2>&1", "|", "xcpretty", "--#{params[:xcpretty_output]}"]
18
+ if params[:xcpretty_args]
19
+ cmd << (params[:xcpretty_args]).to_s
20
+ end
18
21
  cmd = %w(set -o pipefail &&) + cmd
19
22
  end
20
23
 
@@ -67,6 +70,11 @@ module Fastlane
67
70
  verify_block: proc do |value|
68
71
  UI.user_error!("Please pass a valid xcpretty output type: (#{xcpretty_output_types.join('|')})") unless xcpretty_output_types.include?(value)
69
72
  end),
73
+ FastlaneCore::ConfigItem.new(key: :xcpretty_args,
74
+ env_name: "FL_SPM_XCPRETTY_ARGS",
75
+ description: "Pass in xcpretty additional command line arguments (e.g. '--test --no-color' or '--tap --no-utf'), requires xcpretty_output to be specified also",
76
+ type: String,
77
+ optional: true),
70
78
  FastlaneCore::ConfigItem.new(key: :verbose,
71
79
  short_option: "-v",
72
80
  env_name: "FL_SPM_VERBOSE",
@@ -13,13 +13,7 @@ module Fastlane
13
13
 
14
14
  command = (params[:executable] || "swiftlint").dup
15
15
  command << " #{params[:mode]}"
16
- command << " --path #{params[:path].shellescape}" if params[:path]
17
- command << supported_option_switch(params, :strict, "0.9.2", true)
18
- command << " --config #{params[:config_file].shellescape}" if params[:config_file]
19
- command << " --reporter #{params[:reporter]}" if params[:reporter]
20
- command << supported_option_switch(params, :quiet, "0.9.0", true)
21
- command << supported_option_switch(params, :format, "0.11.0", true) if params[:mode] == :autocorrect
22
- command << " --compiler-log-path #{params[:compiler_log_path].shellescape}" if params[:compiler_log_path]
16
+ command << optional_flags(params)
23
17
 
24
18
  if params[:files]
25
19
  if version < Gem::Version.new('0.5.1')
@@ -37,15 +31,37 @@ module Fastlane
37
31
  Actions.sh(command)
38
32
  rescue
39
33
  handle_swiftlint_error(params[:ignore_exit_status], $?.exitstatus)
34
+ raise if params[:raise_if_swiftlint_error]
40
35
  end
41
36
  end
42
37
 
38
+ def self.optional_flags(params)
39
+ command = ""
40
+ command << " --path #{params[:path].shellescape}" if params[:path]
41
+ command << supported_option_switch(params, :strict, "0.9.2", true)
42
+ command << " --config #{params[:config_file].shellescape}" if params[:config_file]
43
+ command << " --reporter #{params[:reporter]}" if params[:reporter]
44
+ command << supported_option_switch(params, :quiet, "0.9.0", true)
45
+ command << supported_option_switch(params, :format, "0.11.0", true) if params[:mode] == :autocorrect
46
+ command << supported_no_cache_option(params) if params[:no_cache]
47
+ command << " --compiler-log-path #{params[:compiler_log_path].shellescape}" if params[:compiler_log_path]
48
+ return command
49
+ end
50
+
43
51
  # Get current SwiftLint version
44
52
  def self.swiftlint_version(executable: nil)
45
53
  binary = executable || 'swiftlint'
46
54
  Gem::Version.new(`#{binary} version`.chomp)
47
55
  end
48
56
 
57
+ def self.supported_no_cache_option(params)
58
+ if params[:mode] == :autocorrect || params[:mode] == :lint
59
+ return " --no-cache"
60
+ else
61
+ return ""
62
+ end
63
+ end
64
+
49
65
  # Return "--option" switch if option is on and current SwiftLint version is greater or equal than min version.
50
66
  # Return "" otherwise.
51
67
  def self.supported_option_switch(params, option, min_version, can_ignore = false)
@@ -106,10 +122,22 @@ module Fastlane
106
122
  is_string: false,
107
123
  type: Boolean,
108
124
  optional: true),
125
+ FastlaneCore::ConfigItem.new(key: :raise_if_swiftlint_error,
126
+ description: "Raises an error if swiftlint fails, so you can fail CI/CD jobs if necessary \
127
+ (true/false)",
128
+ default_value: false,
129
+ is_string: false,
130
+ type: Boolean,
131
+ optional: true),
109
132
  FastlaneCore::ConfigItem.new(key: :reporter,
110
- description: 'Choose output reporter',
133
+ description: "Choose output reporter. Available: xcode, json, csv, checkstyle, junit, html, \
134
+ emoji, sonarqube, markdown, github-actions-logging",
111
135
  is_string: true,
112
- optional: true),
136
+ optional: true,
137
+ verify_block: proc do |value|
138
+ available = ['xcode', 'json', 'csv', 'checkstyle', 'junit', 'html', 'emoji', 'sonarqube', 'markdown', 'github-actions-logging']
139
+ UI.user_error!("Available values are '#{available.join("', '")}'") unless available.include?(value)
140
+ end),
113
141
  FastlaneCore::ConfigItem.new(key: :quiet,
114
142
  description: "Don't print status logs like 'Linting <file>' & 'Done linting'",
115
143
  default_value: false,
@@ -126,6 +154,12 @@ module Fastlane
126
154
  is_string: false,
127
155
  type: Boolean,
128
156
  optional: true),
157
+ FastlaneCore::ConfigItem.new(key: :no_cache,
158
+ description: "Ignore the cache when mode is :autocorrect or :lint",
159
+ default_value: false,
160
+ is_string: false,
161
+ type: Boolean,
162
+ optional: true),
129
163
  FastlaneCore::ConfigItem.new(key: :compiler_log_path,
130
164
  description: "Compiler log path when mode is :analyze",
131
165
  is_string: true,
@@ -161,7 +195,9 @@ module Fastlane
161
195
  "AppDelegate.swift",
162
196
  "path/to/project/Model.swift"
163
197
  ],
198
+ raise_if_swiftlint_error: true, # Allow fastlane to raise an error if swiftlint fails
164
199
  ignore_exit_status: true # Allow fastlane to continue even if SwiftLint returns a non-zero exit status
200
+
165
201
  )'
166
202
  ]
167
203
  end
@@ -0,0 +1,198 @@
1
+ require 'xcodeproj'
2
+ module Fastlane
3
+ module Actions
4
+ class UpdateCodeSigningSettingsAction < Action
5
+ def self.run(params)
6
+ FastlaneCore::PrintTable.print_values(config: params, title: "Summary for code signing settings")
7
+ path = params[:path]
8
+ path = File.join(File.expand_path(path), "project.pbxproj")
9
+
10
+ project = Xcodeproj::Project.open(params[:path])
11
+ UI.user_error!("Could not find path to project config '#{path}'. Pass the path to your project (not workspace)!") unless File.exist?(path)
12
+ UI.message("Updating the Automatic Codesigning flag to #{params[:use_automatic_signing] ? 'enabled' : 'disabled'} for the given project '#{path}'")
13
+
14
+ unless project.root_object.attributes["TargetAttributes"]
15
+ UI.user_error!("Seems to be a very old project file format - please open your project file in a more recent version of Xcode")
16
+ return false
17
+ end
18
+
19
+ changed_targets = []
20
+ changed_build_configurations = []
21
+
22
+ project.targets.each do |target|
23
+ if params[:targets]
24
+ unless params[:targets].include?(target.name)
25
+ UI.important("Skipping #{target.name} not selected (#{params[:targets].join(',')})")
26
+ next
27
+ end
28
+ end
29
+
30
+ target.build_configurations.each do |config|
31
+ if params[:build_configurations]
32
+ unless params[:build_configurations].include?(config.name)
33
+ UI.important("Skipping #{config.name} not selected (#{params[:build_configurations].join(',')})")
34
+ next
35
+ end
36
+ end
37
+
38
+ style_value = params[:use_automatic_signing] ? 'Automatic' : 'Manual'
39
+ set_build_setting(config, "CODE_SIGN_STYLE", style_value)
40
+
41
+ if params[:team_id]
42
+ set_build_setting(config, "DEVELOPMENT_TEAM", params[:team_id])
43
+ UI.important("Set Team id to: #{params[:team_id]} for target: #{target.name} for build configuration: #{config.name}")
44
+ end
45
+ if params[:code_sign_identity]
46
+ set_build_setting(config, "CODE_SIGN_IDENTITY", params[:code_sign_identity])
47
+ UI.important("Set Code Sign identity to: #{params[:code_sign_identity]} for target: #{target.name} for build configuration: #{config.name}")
48
+ end
49
+ if params[:profile_name]
50
+ set_build_setting(config, "PROVISIONING_PROFILE_SPECIFIER", params[:profile_name])
51
+ UI.important("Set Provisioning Profile name to: #{params[:profile_name]} for target: #{target.name} for build configuration: #{config.name}")
52
+ end
53
+ # Since Xcode 8, this is no longer needed, you simply use PROVISIONING_PROFILE_SPECIFIER
54
+ if params[:profile_uuid]
55
+ set_build_setting(config, "PROVISIONING_PROFILE", params[:profile_uuid])
56
+ UI.important("Set Provisioning Profile UUID to: #{params[:profile_uuid]} for target: #{target.name} for build configuration: #{config.name}")
57
+ end
58
+ if params[:bundle_identifier]
59
+ set_build_setting(config, "PRODUCT_BUNDLE_IDENTIFIER", params[:bundle_identifier])
60
+ UI.important("Set Bundle identifier to: #{params[:bundle_identifier]} for target: #{target.name} for build configuration: #{config.name}")
61
+ end
62
+
63
+ changed_build_configurations << config.name
64
+ end
65
+
66
+ changed_targets << target.name
67
+ end
68
+ project.save
69
+
70
+ if changed_targets.empty?
71
+ UI.important("None of the specified targets has been modified")
72
+ UI.important("available targets:")
73
+ project.targets.each do |target|
74
+ UI.important("\t* #{target.name}")
75
+ end
76
+ else
77
+ UI.success("Successfully updated project settings to use Code Sign Style = '#{params[:use_automatic_signing] ? 'Automatic' : 'Manual'}'")
78
+ UI.success("Modified Targets:")
79
+ changed_targets.each do |target|
80
+ UI.success("\t * #{target}")
81
+ end
82
+
83
+ UI.success("Modified Build Configurations:")
84
+ changed_build_configurations.each do |name|
85
+ UI.success("\t * #{name}")
86
+ end
87
+ end
88
+
89
+ params[:use_automatic_signing]
90
+ end
91
+
92
+ def self.set_build_setting(configuration, name, value)
93
+ codesign_build_settings_keys = configuration.build_settings.keys.select { |key| key.to_s.match(/#{name}.*/) }
94
+ codesign_build_settings_keys.each do |key|
95
+ configuration.build_settings[key] = value
96
+ end
97
+ end
98
+
99
+ def self.description
100
+ "Configures Xcode's Codesigning options"
101
+ end
102
+
103
+ def self.details
104
+ "Configures Xcode's Codesigning options of all targets in the project"
105
+ end
106
+
107
+ def self.available_options
108
+ [
109
+ FastlaneCore::ConfigItem.new(key: :path,
110
+ env_name: "FL_PROJECT_SIGNING_PROJECT_PATH",
111
+ description: "Path to your Xcode project",
112
+ code_gen_sensitive: true,
113
+ default_value: Dir['*.xcodeproj'].first,
114
+ default_value_dynamic: true,
115
+ verify_block: proc do |value|
116
+ UI.user_error!("Path is invalid") unless File.exist?(File.expand_path(value))
117
+ end),
118
+ FastlaneCore::ConfigItem.new(key: :use_automatic_signing,
119
+ env_name: "FL_PROJECT_USE_AUTOMATIC_SIGNING",
120
+ description: "Defines if project should use automatic signing",
121
+ is_string: false,
122
+ default_value: false),
123
+ FastlaneCore::ConfigItem.new(key: :team_id,
124
+ env_name: "FASTLANE_TEAM_ID",
125
+ optional: true,
126
+ description: "Team ID, is used when upgrading project",
127
+ is_string: true),
128
+ FastlaneCore::ConfigItem.new(key: :targets,
129
+ env_name: "FL_PROJECT_SIGNING_TARGETS",
130
+ optional: true,
131
+ type: Array,
132
+ description: "Specify targets you want to toggle the signing mech. (default to all targets)",
133
+ is_string: false),
134
+ FastlaneCore::ConfigItem.new(key: :build_configurations,
135
+ env_name: "FL_PROJECT_SIGNING_BUILD_CONFIGURATIONS",
136
+ optional: true,
137
+ type: Array,
138
+ description: "Specify build_configurations you want to toggle the signing mech. (default to all targets)",
139
+ is_string: false),
140
+ FastlaneCore::ConfigItem.new(key: :code_sign_identity,
141
+ env_name: "FL_CODE_SIGN_IDENTITY",
142
+ description: "Code signing identity type (iPhone Developer, iPhone Distribution)",
143
+ optional: true,
144
+ is_string: true),
145
+ FastlaneCore::ConfigItem.new(key: :profile_name,
146
+ env_name: "FL_PROVISIONING_PROFILE_SPECIFIER",
147
+ description: "Provisioning profile name to use for code signing",
148
+ optional: true,
149
+ is_string: true),
150
+ FastlaneCore::ConfigItem.new(key: :profile_uuid,
151
+ env_name: "FL_PROVISIONING_PROFILE",
152
+ description: "Provisioning profile UUID to use for code signing",
153
+ optional: true,
154
+ is_string: true),
155
+ FastlaneCore::ConfigItem.new(key: :bundle_identifier,
156
+ env_name: "FL_APP_IDENTIFIER",
157
+ description: "Application Product Bundle Identifier",
158
+ optional: true,
159
+ is_string: true)
160
+ ]
161
+ end
162
+
163
+ def self.output
164
+ end
165
+
166
+ def self.example_code
167
+ [
168
+ ' # manual code signing
169
+ update_code_signing_settings(
170
+ use_automatic_signing: false,
171
+ path: "demo-project/demo/demo.xcodeproj"
172
+ )',
173
+ ' # automatic code signing
174
+ update_code_signing_settings(
175
+ use_automatic_signing: true,
176
+ path: "demo-project/demo/demo.xcodeproj"
177
+ )'
178
+ ]
179
+ end
180
+
181
+ def self.category
182
+ :code_signing
183
+ end
184
+
185
+ def self.return_value
186
+ "The current status (boolean) of codesigning after modification"
187
+ end
188
+
189
+ def self.authors
190
+ ["mathiasAichinger", "hjanuschka", "p4checo", "portellaa", "aeons", "att55"]
191
+ end
192
+
193
+ def self.is_supported?(platform)
194
+ [:ios, :mac].include?(platform)
195
+ end
196
+ end
197
+ end
198
+ end
@@ -10,8 +10,8 @@ module Fastlane
10
10
  find_gsp_path(params)
11
11
  find_api_token(params)
12
12
 
13
- if !params[:api_token] && !params[:gsp_path]
14
- UI.user_error!('Either Fabric API key or path to Firebase Crashlytics GoogleService-Info.plist must be given.')
13
+ if !params[:app_id] && !params[:gsp_path] && !params[:api_token]
14
+ UI.user_error!('Either Firebase Crashlytics App ID, path to GoogleService-Info.plist or legacy Fabric API key must be given.')
15
15
  end
16
16
 
17
17
  dsym_paths = []
@@ -87,7 +87,9 @@ module Fastlane
87
87
  UI.message("Uploading '#{path}'...")
88
88
  command = []
89
89
  command << File.expand_path(params[:binary_path]).shellescape
90
- if params[:gsp_path]
90
+ if params[:app_id]
91
+ command << "-ai #{params[:app_id].shellescape}"
92
+ elsif params[:gsp_path]
91
93
  command << "-gsp #{params[:gsp_path].shellescape}"
92
94
  elsif params[:api_token]
93
95
  command << "-a #{params[:api_token]}"
@@ -128,7 +130,7 @@ module Fastlane
128
130
  end
129
131
 
130
132
  def self.find_binary_path(params)
131
- params[:binary_path] ||= (Dir["/Applications/Fabric.app/**/upload-symbols"] + Dir["./Pods/**/upload-symbols"]).last
133
+ params[:binary_path] ||= (Dir["/Applications/Fabric.app/**/upload-symbols"] + Dir["./Pods/Fabric/upload-symbols"] + Dir["./Pods/FirebaseCrashlytics/upload-symbols"]).last
132
134
  UI.user_error!("Failed to find Fabric's upload_symbols binary at /Applications/Fabric.app/**/upload-symbols or ./Pods/**/upload-symbols. Please specify the location of the binary explicitly by using the binary_path option") unless params[:binary_path]
133
135
 
134
136
  params[:binary_path] = File.expand_path(params[:binary_path])
@@ -186,6 +188,14 @@ module Fastlane
186
188
  UI.user_error!("Couldn't find file at path '#{File.expand_path(value)}'") unless File.exist?(value)
187
189
  UI.user_error!("No Path to GoogleService-Info.plist for Firebase Crashlytics given, pass using `gsp_path: 'path'`") if value.to_s.length == 0
188
190
  end),
191
+ FastlaneCore::ConfigItem.new(key: :app_id,
192
+ env_name: "CRASHLYTICS_APP_ID",
193
+ sensitive: true,
194
+ optional: true,
195
+ description: "Firebase Crashlytics APP ID",
196
+ verify_block: proc do |value|
197
+ UI.user_error!("No App ID for Firebase Crashlytics given, pass using `app_id: 'appId'`") if value.to_s.length == 0
198
+ end),
189
199
  FastlaneCore::ConfigItem.new(key: :binary_path,
190
200
  env_name: "FL_UPLOAD_SYMBOLS_TO_CRASHLYTICS_BINARY_PATH",
191
201
  description: "The path to the upload-symbols file of the Fabric app",
@@ -46,7 +46,7 @@ module Fastlane
46
46
 
47
47
  parts = cert_info.strip.split(/\r?\n/)
48
48
  parts.each do |part|
49
- if part =~ /\AAuthority=i(Phone|OS)/
49
+ if part =~ /\AAuthority=(iPhone|iOS|Apple)\s(Distribution|Development)/
50
50
  type = part.split('=')[1].split(':')[0]
51
51
  values['provisioning_type'] = type.downcase =~ /distribution/i ? "distribution" : "development"
52
52
  end
@@ -24,7 +24,7 @@ module Fastlane
24
24
  adb_path = File.join(android_home, "platform-tools", "adb")
25
25
  end
26
26
 
27
- self.adb_path = adb_path
27
+ self.adb_path = File.expand_path(adb_path)
28
28
  self.adb_host = adb_host
29
29
  end
30
30
 
@@ -0,0 +1,61 @@
1
+ require 'aws-sdk-s3'
2
+
3
+ module Fastlane
4
+ module Helper
5
+ class S3ClientHelper
6
+ attr_reader :client
7
+
8
+ def initialize(access_key: nil, secret_access_key: nil, region: nil)
9
+ creds = Aws::Credentials.new(access_key, secret_access_key)
10
+ Aws.config.update(
11
+ region: region,
12
+ credentials: creds
13
+ )
14
+ end
15
+
16
+ def list_buckets
17
+ return client.list_buckets
18
+ end
19
+
20
+ def upload_file(bucket_name, file_name, file_data, acl)
21
+ bucket = find_bucket!(bucket_name)
22
+ details = {
23
+ acl: acl,
24
+ key: file_name,
25
+ body: file_data
26
+ }
27
+ obj = bucket.put_object(details)
28
+
29
+ # When you enable versioning on a S3 bucket,
30
+ # writing to an object will create an object version
31
+ # instead of replacing the existing object.
32
+ # http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/S3/ObjectVersion.html
33
+ if obj.kind_of?(Aws::S3::ObjectVersion)
34
+ obj = obj.object
35
+ end
36
+
37
+ # Return public url
38
+ obj.public_url.to_s
39
+ end
40
+
41
+ def delete_file(bucket_name, file_name)
42
+ bucket = find_bucket!(bucket_name)
43
+ file = bucket.object(file_name)
44
+ file.delete
45
+ end
46
+
47
+ def find_bucket!(bucket_name)
48
+ bucket = Aws::S3::Bucket.new(bucket_name, client: client)
49
+ raise "Bucket '#{bucket_name}' not found" unless bucket.exists?
50
+
51
+ return bucket
52
+ end
53
+ end
54
+
55
+ private
56
+
57
+ def client
58
+ @client ||= Aws::S3::Client.new
59
+ end
60
+ end
61
+ end