fastlane 2.138.0 → 2.143.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +75 -62
  4. data/cert/lib/cert/options.rb +12 -5
  5. data/cert/lib/cert/runner.rb +13 -0
  6. data/deliver/lib/deliver/options.rb +2 -2
  7. data/deliver/lib/deliver/runner.rb +13 -2
  8. data/deliver/lib/deliver/submit_for_review.rb +7 -1
  9. data/fastlane/lib/fastlane/action.rb +2 -2
  10. data/fastlane/lib/fastlane/actions/.hockey.rb.swp +0 -0
  11. data/fastlane/lib/fastlane/actions/.slack.rb.swp +0 -0
  12. data/fastlane/lib/fastlane/actions/.update_project_provisioning.rb.swp +0 -0
  13. data/fastlane/lib/fastlane/actions/README.md +2 -0
  14. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +13 -5
  15. data/fastlane/lib/fastlane/actions/build_app.rb +157 -6
  16. data/fastlane/lib/fastlane/actions/build_ios_app.rb +28 -132
  17. data/fastlane/lib/fastlane/actions/build_mac_app.rb +46 -0
  18. data/fastlane/lib/fastlane/actions/cocoapods.rb +2 -2
  19. data/fastlane/lib/fastlane/actions/create_pull_request.rb +71 -2
  20. data/fastlane/lib/fastlane/actions/docs/{build_ios_app.md → build_app.md} +1 -1
  21. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +22 -6
  22. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +20 -4
  23. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +10 -0
  24. data/fastlane/lib/fastlane/actions/ensure_git_branch.rb +1 -1
  25. data/fastlane/lib/fastlane/actions/ensure_xcode_version.rb +35 -7
  26. data/fastlane/lib/fastlane/actions/frame_screenshots.rb +2 -1
  27. data/fastlane/lib/fastlane/actions/get_github_release.rb +3 -0
  28. data/fastlane/lib/fastlane/actions/gradle.rb +43 -2
  29. data/fastlane/lib/fastlane/actions/gym.rb +3 -7
  30. data/fastlane/lib/fastlane/actions/import_from_git.rb +4 -0
  31. data/fastlane/lib/fastlane/actions/last_git_tag.rb +14 -5
  32. data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +9 -3
  33. data/fastlane/lib/fastlane/actions/notarize.rb +183 -0
  34. data/fastlane/lib/fastlane/actions/run_tests.rb +5 -22
  35. data/fastlane/lib/fastlane/actions/s3.rb +5 -291
  36. data/fastlane/lib/fastlane/actions/set_github_release.rb +1 -1
  37. data/fastlane/lib/fastlane/actions/setup_ci.rb +14 -8
  38. data/fastlane/lib/fastlane/actions/spm.rb +8 -0
  39. data/fastlane/lib/fastlane/actions/swiftlint.rb +17 -2
  40. data/fastlane/lib/fastlane/actions/update_plist.rb +37 -2
  41. data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +13 -3
  42. data/fastlane/lib/fastlane/actions/upload_to_app_store.rb +1 -0
  43. data/fastlane/lib/fastlane/actions/upload_to_play_store_internal_app_sharing.rb +78 -0
  44. data/fastlane/lib/fastlane/fast_file.rb +13 -3
  45. data/fastlane/lib/fastlane/helper/adb_helper.rb +1 -1
  46. data/fastlane/lib/fastlane/helper/s3_client_helper.rb +56 -0
  47. data/fastlane/lib/fastlane/plugins/plugin_manager.rb +1 -1
  48. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +2 -0
  49. data/fastlane/lib/fastlane/runner.rb +23 -18
  50. data/fastlane/lib/fastlane/server/socket_server_action_command_executor.rb +1 -1
  51. data/fastlane/lib/fastlane/version.rb +1 -1
  52. data/fastlane/swift/Deliverfile.swift +1 -1
  53. data/fastlane/swift/DeliverfileProtocol.swift +3 -3
  54. data/fastlane/swift/Fastlane.swift +429 -50
  55. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/xcuserdata/josh.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  56. data/fastlane/swift/Gymfile.swift +1 -1
  57. data/fastlane/swift/GymfileProtocol.swift +17 -1
  58. data/fastlane/swift/Matchfile.swift +1 -1
  59. data/fastlane/swift/MatchfileProtocol.swift +23 -3
  60. data/fastlane/swift/Precheckfile.swift +1 -1
  61. data/fastlane/swift/RubyCommand.swift +1 -1
  62. data/fastlane/swift/Scanfile.swift +1 -1
  63. data/fastlane/swift/ScanfileProtocol.swift +21 -1
  64. data/fastlane/swift/Screengrabfile.swift +1 -1
  65. data/fastlane/swift/Snapshotfile.swift +1 -1
  66. data/fastlane/swift/SnapshotfileProtocol.swift +9 -1
  67. data/fastlane_core/lib/fastlane_core/build_watcher.rb +6 -2
  68. data/fastlane_core/lib/fastlane_core/cert_checker.rb +28 -0
  69. data/fastlane_core/lib/fastlane_core/device_manager.rb +20 -0
  70. data/fastlane_core/lib/fastlane_core/helper.rb +7 -1
  71. data/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb +1 -0
  72. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +2 -0
  73. data/fastlane_core/lib/fastlane_core/project.rb +27 -0
  74. data/frameit/lib/frameit/commands_generator.rb +25 -0
  75. data/frameit/lib/frameit/config_parser.rb +31 -9
  76. data/frameit/lib/frameit/device.rb +90 -0
  77. data/frameit/lib/frameit/device_types.rb +121 -5
  78. data/frameit/lib/frameit/editor.rb +31 -40
  79. data/frameit/lib/frameit/offsets.rb +8 -1
  80. data/frameit/lib/frameit/options.rb +81 -54
  81. data/frameit/lib/frameit/runner.rb +17 -7
  82. data/frameit/lib/frameit/screenshot.rb +35 -47
  83. data/frameit/lib/frameit/template_finder.rb +15 -12
  84. data/gym/lib/gym/code_signing_mapping.rb +32 -3
  85. data/gym/lib/gym/detect_values.rb +34 -2
  86. data/gym/lib/gym/generators/build_command_generator.rb +1 -0
  87. data/gym/lib/gym/generators/package_command_generator.rb +4 -0
  88. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +47 -17
  89. data/gym/lib/gym/module.rb +8 -0
  90. data/gym/lib/gym/options.rb +25 -1
  91. data/gym/lib/gym/runner.rb +64 -24
  92. data/match/lib/match/change_password.rb +1 -1
  93. data/match/lib/match/encryption.rb +4 -0
  94. data/match/lib/match/encryption/openssl.rb +1 -1
  95. data/match/lib/match/generator.rb +17 -3
  96. data/match/lib/match/importer.rb +2 -2
  97. data/match/lib/match/module.rb +5 -2
  98. data/match/lib/match/nuke.rb +59 -17
  99. data/match/lib/match/options.rb +38 -15
  100. data/match/lib/match/runner.rb +24 -8
  101. data/match/lib/match/setup.rb +1 -1
  102. data/match/lib/match/spaceship_ensure.rb +19 -9
  103. data/match/lib/match/storage.rb +4 -0
  104. data/match/lib/match/storage/git_storage.rb +5 -2
  105. data/match/lib/match/storage/google_cloud_storage.rb +2 -2
  106. data/match/lib/match/storage/s3_storage.rb +162 -0
  107. data/pilot/lib/pilot/.manager.rb.swp +0 -0
  108. data/pilot/lib/pilot/build_manager.rb +55 -15
  109. data/pilot/lib/pilot/options.rb +3 -1
  110. data/scan/lib/scan/detect_values.rb +6 -1
  111. data/scan/lib/scan/manager.rb +18 -1
  112. data/scan/lib/scan/options.rb +28 -1
  113. data/scan/lib/scan/runner.rb +11 -3
  114. data/scan/lib/scan/slack_poster.rb +1 -1
  115. data/scan/lib/scan/test_command_generator.rb +9 -5
  116. data/screengrab/lib/screengrab/runner.rb +31 -18
  117. data/snapshot/lib/snapshot/fixes/simulator_shared_pasteboard.rb +16 -0
  118. data/snapshot/lib/snapshot/options.rb +12 -1
  119. data/snapshot/lib/snapshot/simulator_launchers/launcher_configuration.rb +2 -0
  120. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +13 -0
  121. data/spaceship/lib/spaceship/connect_api/.DS_Store +0 -0
  122. data/spaceship/lib/spaceship/connect_api/models/beta_feedback.rb +4 -0
  123. data/spaceship/lib/spaceship/connect_api/models/build.rb +4 -0
  124. data/spaceship/lib/spaceship/connect_api/models/build_beta_detail.rb +5 -0
  125. data/spaceship/lib/spaceship/connect_api/models/certificate.rb +2 -0
  126. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +6 -0
  127. data/spaceship/lib/spaceship/portal/.certificate.rb.swp +0 -0
  128. data/spaceship/lib/spaceship/portal/app.rb +11 -2
  129. data/spaceship/lib/spaceship/tunes/iap.rb +11 -11
  130. data/spaceship/lib/spaceship/tunes/iap_detail.rb +7 -3
  131. data/spaceship/lib/spaceship/tunes/iap_families.rb +12 -1
  132. data/spaceship/lib/spaceship/tunes/iap_family_details.rb +26 -17
  133. data/spaceship/lib/spaceship/tunes/iap_status.rb +5 -1
  134. data/spaceship/lib/spaceship/tunes/tunes_client.rb +2 -2
  135. data/supply/lib/supply/client.rb +26 -0
  136. data/supply/lib/supply/uploader.rb +28 -0
  137. metadata +64 -20
@@ -33,6 +33,7 @@ module Gym
33
33
  detect_selected_provisioning_profiles # we can only do that *after* we have the platform
34
34
  detect_configuration
35
35
  detect_toolchain
36
+ detect_third_party_installer
36
37
 
37
38
  config[:output_name] ||= Gym.project.app_name
38
39
 
@@ -100,6 +101,38 @@ module Gym
100
101
  end
101
102
  end
102
103
 
104
+ # Detects name of a "3rd Party Mac Developer Installer" cert for the configured team id
105
+ def self.detect_third_party_installer
106
+ return if Gym.config[:installer_cert_name]
107
+
108
+ team_id = Gym.config[:export_team_id] || Gym.project.build_settings(key: "DEVELOPMENT_TEAM")
109
+ return if team_id.nil?
110
+
111
+ case Gym.config[:export_method]
112
+ when "app-store"
113
+ prefix = "3rd Party Mac Developer Installer: "
114
+ when "developer-id"
115
+ prefix = "Developer ID Installer: "
116
+ else
117
+ return
118
+ end
119
+
120
+ output = Helper.backticks("security find-certificate -a -c \"#{prefix}\"", print: false)
121
+
122
+ # Find matches, filter by team_id, prepend prefix for full cert name
123
+ certs = output.scan(/"(?:#{prefix})(.*)"/)
124
+ certs = certs.flatten.uniq.select do |cert|
125
+ cert.include?(team_id)
126
+ end.map do |cert|
127
+ prefix + cert
128
+ end
129
+
130
+ if certs.first
131
+ UI.verbose("Detected installer certificate to use: #{certs.first}")
132
+ Gym.config[:installer_cert_name] = certs.first
133
+ end
134
+ end
135
+
103
136
  def self.detect_scheme
104
137
  Gym.project.select_scheme
105
138
  end
@@ -111,14 +144,13 @@ module Gym
111
144
  # Is it an iOS device or a Mac?
112
145
  def self.detect_platform
113
146
  return if Gym.config[:destination]
114
- platform = if Gym.project.mac?
147
+ platform = if Gym.project.mac? || Gym.building_mac_catalyst_for_mac?
115
148
  min_xcode8? ? "macOS" : "OS X"
116
149
  elsif Gym.project.tvos?
117
150
  "tvOS"
118
151
  else
119
152
  "iOS"
120
153
  end
121
-
122
154
  Gym.config[:destination] = "generic/platform=#{platform}"
123
155
  end
124
156
 
@@ -51,6 +51,7 @@ module Gym
51
51
 
52
52
  buildactions = []
53
53
  buildactions << :clean if config[:clean]
54
+ buildactions << :build if config[:skip_archive]
54
55
  buildactions << :archive unless config[:skip_archive]
55
56
 
56
57
  buildactions
@@ -25,6 +25,10 @@ module Gym
25
25
  generator.ipa_path
26
26
  end
27
27
 
28
+ def pkg_path
29
+ generator.pkg_path
30
+ end
31
+
28
32
  def dsym_path
29
33
  generator.dsym_path
30
34
  end
@@ -58,27 +58,53 @@ module Gym
58
58
  end
59
59
 
60
60
  def ipa_path
61
- unless Gym.cache[:ipa_path]
62
- path = Dir[File.join(temporary_output_path, "*.ipa")].last
63
- # We need to process generic IPA
64
- if path
65
- # Try to find IPA file in the output directory, used when app thinning was not set
66
- Gym.cache[:ipa_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.ipa")
67
- FileUtils.mv(path, Gym.cache[:ipa_path]) unless File.expand_path(path).casecmp(File.expand_path(Gym.cache[:ipa_path]).downcase).zero?
68
- elsif Dir.exist?(apps_path)
69
- # Try to find "generic" IPA file inside "Apps" folder, used when app thinning was set
70
- files = Dir[File.join(apps_path, "*.ipa")]
71
- # Generic IPA file doesn't have suffix so its name is the shortest
72
- path = files.min_by(&:length)
73
- Gym.cache[:ipa_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.ipa")
74
- FileUtils.cp(path, Gym.cache[:ipa_path]) unless File.expand_path(path).casecmp(File.expand_path(Gym.cache[:ipa_path]).downcase).zero?
75
- else
76
- ErrorHandler.handle_empty_archive unless path
77
- end
61
+ path = Gym.cache[:ipa_path]
62
+ return path if path
63
+
64
+ path = Dir[File.join(temporary_output_path, "*.ipa")].last
65
+ # We need to process generic IPA
66
+ if path
67
+ # Try to find IPA file in the output directory, used when app thinning was not set
68
+ Gym.cache[:ipa_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.ipa")
69
+ FileUtils.mv(path, Gym.cache[:ipa_path]) unless File.expand_path(path).casecmp(File.expand_path(Gym.cache[:ipa_path]).downcase).zero?
70
+ elsif Dir.exist?(apps_path)
71
+ # Try to find "generic" IPA file inside "Apps" folder, used when app thinning was set
72
+ files = Dir[File.join(apps_path, "*.ipa")]
73
+ # Generic IPA file doesn't have suffix so its name is the shortest
74
+ path = files.min_by(&:length)
75
+ Gym.cache[:ipa_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.ipa")
76
+ FileUtils.cp(path, Gym.cache[:ipa_path]) unless File.expand_path(path).casecmp(File.expand_path(Gym.cache[:ipa_path]).downcase).zero?
77
+ else
78
+ ErrorHandler.handle_empty_archive unless path
78
79
  end
80
+
79
81
  Gym.cache[:ipa_path]
80
82
  end
81
83
 
84
+ def pkg_path
85
+ path = Gym.cache[:pkg_path]
86
+ return path if path
87
+
88
+ path = Dir[File.join(temporary_output_path, "*.pkg")].last
89
+ # We need to process generic PKG
90
+ if path
91
+ # Try to find PKG file in the output directory, used when app thinning was not set
92
+ Gym.cache[:pkg_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.pkg")
93
+ FileUtils.mv(path, Gym.cache[:pkg_path]) unless File.expand_path(path).casecmp(File.expand_path(Gym.cache[:pkg_path]).downcase).zero?
94
+ elsif Dir.exist?(apps_path)
95
+ # Try to find "generic" PKG file inside "Apps" folder, used when app thinning was set
96
+ files = Dir[File.join(apps_path, "*.pkg")]
97
+ # Generic PKG file doesn't have suffix so its name is the shortest
98
+ path = files.min_by(&:length)
99
+ Gym.cache[:pkg_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.pkg")
100
+ FileUtils.cp(path, Gym.cache[:pkg_path]) unless File.expand_path(path).casecmp(File.expand_path(Gym.cache[:pkg_path]).downcase).zero?
101
+ else
102
+ ErrorHandler.handle_empty_archive unless path
103
+ end
104
+
105
+ Gym.cache[:pkg_path]
106
+ end
107
+
82
108
  # The path the the dsym file for this app. Might be nil
83
109
  def dsym_path
84
110
  Dir[BuildCommandGenerator.archive_path + "/**/*.app.dSYM"].last
@@ -160,6 +186,10 @@ module Gym
160
186
  hash[:signingStyle] = 'manual'
161
187
  end
162
188
 
189
+ if Gym.config[:installer_cert_name] && (Gym.project.mac? || Gym.building_mac_catalyst_for_mac?)
190
+ hash[:installerSigningCertificate] = Gym.config[:installer_cert_name]
191
+ end
192
+
163
193
  hash[:teamID] = Gym.config[:export_team_id] if Gym.config[:export_team_id]
164
194
 
165
195
  UI.important("Generated plist file with the following values:")
@@ -24,6 +24,14 @@ module Gym
24
24
  # Import all the fixes
25
25
  require 'gym/xcodebuild_fixes/generic_archive_fix'
26
26
  end
27
+
28
+ def building_mac_catalyst_for_ios?
29
+ Gym.project.supports_mac_catalyst? && Gym.config[:catalyst_platform] == "ios"
30
+ end
31
+
32
+ def building_mac_catalyst_for_mac?
33
+ Gym.project.supports_mac_catalyst? && Gym.config[:catalyst_platform] == "macos"
34
+ end
27
35
  end
28
36
 
29
37
  Helper = FastlaneCore::Helper # you gotta love Ruby: Helper.* should use the Helper class contained in FastlaneCore
@@ -85,6 +85,11 @@ module Gym
85
85
  description: "Should we skip packaging the ipa?",
86
86
  type: Boolean,
87
87
  default_value: false),
88
+ FastlaneCore::ConfigItem.new(key: :skip_package_pkg,
89
+ env_name: "GYM_SKIP_PACKAGE_PKG",
90
+ description: "Should we skip packaging the pkg?",
91
+ type: Boolean,
92
+ default_value: false),
88
93
  FastlaneCore::ConfigItem.new(key: :include_symbols,
89
94
  short_option: "-m",
90
95
  env_name: "GYM_INCLUDE_SYMBOLS",
@@ -139,6 +144,20 @@ module Gym
139
144
  description: "Build without codesigning",
140
145
  type: Boolean,
141
146
  optional: true),
147
+ FastlaneCore::ConfigItem.new(key: :catalyst_platform,
148
+ env_name: "GYM_CATALYST_PLATFORM",
149
+ description: "Platform to build when using a Catalyst enabled app. Valid values are: ios, macos",
150
+ type: String,
151
+ optional: true,
152
+ verify_block: proc do |value|
153
+ av = %w(ios macos)
154
+ UI.user_error!("Unsupported export_method '#{value}', must be: #{av}") unless av.include?(value)
155
+ end),
156
+ FastlaneCore::ConfigItem.new(key: :installer_cert_name,
157
+ env_name: "GYM_INSTALLER_CERT_NAME",
158
+ description: "Full name of 3rd Party Mac Developer Installer or Deveoper ID Installer certificate. Example: `3rd Party Mac Developer Installer: Your Company (ABC1234XWYZ)`",
159
+ type: String,
160
+ optional: true),
142
161
  # Very optional
143
162
  FastlaneCore::ConfigItem.new(key: :build_path,
144
163
  env_name: "GYM_BUILD_PATH",
@@ -255,7 +274,12 @@ module Gym
255
274
  description: "Do not try to build a profile mapping from the xcodeproj. Match or a manually provided mapping should be used",
256
275
  optional: true,
257
276
  type: Boolean,
258
- default_value: false)
277
+ default_value: false),
278
+ FastlaneCore::ConfigItem.new(key: :cloned_source_packages_path,
279
+ env_name: "GYM_CLONED_SOURCE_PACKAGES_PATH",
280
+ description: "Sets a custom path for Swift Package Manager dependencies",
281
+ type: String,
282
+ optional: true)
259
283
  ]
260
284
  end
261
285
  end
@@ -18,10 +18,18 @@ module Gym
18
18
  build_app
19
19
  end
20
20
  verify_archive unless Gym.config[:skip_archive]
21
+
22
+ return nil if Gym.config[:skip_archive]
23
+
21
24
  FileUtils.mkdir_p(File.expand_path(Gym.config[:output_directory]))
22
25
 
23
- if Gym.project.ios? || Gym.project.tvos?
24
- fix_generic_archive # See https://github.com/fastlane/fastlane/pull/4325
26
+ # Determine platform to archive
27
+ is_mac = Gym.project.mac? || Gym.building_mac_catalyst_for_mac?
28
+ is_ios = !is_mac && (Gym.project.ios? || Gym.project.tvos? || Gym.project.watchos?)
29
+
30
+ # Archive
31
+ if is_ios
32
+ fix_generic_archive unless Gym.project.watchos? # See https://github.com/fastlane/fastlane/pull/4325
25
33
  return BuildCommandGenerator.archive_path if Gym.config[:skip_package_ipa]
26
34
 
27
35
  package_app
@@ -31,11 +39,15 @@ module Gym
31
39
  move_app_thinning
32
40
  move_app_thinning_size_report
33
41
  move_apps_folder
34
- elsif Gym.project.mac?
42
+ elsif is_mac
35
43
  path = File.expand_path(Gym.config[:output_directory])
36
44
  compress_and_move_dsym
37
- if Gym.project.mac_app?
38
- copy_mac_app
45
+ if Gym.project.mac_app? || Gym.building_mac_catalyst_for_mac?
46
+ path = copy_mac_app
47
+ return path if Gym.config[:skip_package_pkg]
48
+
49
+ package_app
50
+ path = move_pkg
39
51
  return path
40
52
  end
41
53
  copy_files_from_path(File.join(BuildCommandGenerator.archive_path, "Products/usr/local/bin/*")) if Gym.project.command_line_tool?
@@ -97,9 +109,11 @@ module Gym
97
109
  ErrorHandler.handle_build_error(output)
98
110
  end)
99
111
 
100
- mark_archive_as_built_by_gym(BuildCommandGenerator.archive_path)
101
- UI.success("Successfully stored the archive. You can find it in the Xcode Organizer.") unless Gym.config[:archive_path].nil?
102
- UI.verbose("Stored the archive in: " + BuildCommandGenerator.archive_path)
112
+ unless Gym.config[:skip_archive]
113
+ mark_archive_as_built_by_gym(BuildCommandGenerator.archive_path)
114
+ UI.success("Successfully stored the archive. You can find it in the Xcode Organizer.") unless Gym.config[:archive_path].nil?
115
+ UI.verbose("Stored the archive in: " + BuildCommandGenerator.archive_path)
116
+ end
103
117
 
104
118
  post_build_app
105
119
  end
@@ -155,31 +169,45 @@ module Gym
155
169
  dwarfdump_command << "dwarfdump"
156
170
  dwarfdump_command << "--uuid #{dsym.shellescape}"
157
171
 
172
+ # Extract uuids
158
173
  dwarfdump_result = Helper.backticks(dwarfdump_command.join(" "), print: false)
159
174
  architecture_infos = dwarfdump_result.split("\n")
160
- architecture_uuids = architecture_infos.map do |info|
161
- info_array = info.split(" ")
175
+ architecture_infos.each do |info|
176
+ info_array = info.split(" ", 4)
162
177
  uuid = info_array[1]
178
+ dwarf_file_path = info_array[3]
163
179
 
164
180
  if uuid.nil? || !uuid.match(uuid_regex)
165
- nil
166
- else
167
- uuid
181
+ next
168
182
  end
169
- end
170
-
171
- architecture_uuids = architecture_uuids.reject(&:nil?)
172
-
173
- symbol_map_paths = architecture_uuids.map do |uuid|
174
- "#{bcsymbolmaps_directory.shellescape}/#{uuid}.bcsymbolmap"
175
- end
176
183
 
177
- symbol_map_paths << bcsymbolmaps_directory.shellescape if symbol_map_paths.empty?
178
-
179
- symbol_map_paths.each do |path|
184
+ # Find bcsymbolmap file to be used:
185
+ # - if a <uuid>.plist file exists, we will extract uuid of bcsymbolmap and use it
186
+ # - if a <uuid>.bcsymbolmap file exists, we will use it
187
+ # - otherwise let dsymutil figure it out
188
+ symbol_map_path = nil
189
+ split_dwarf_file_path = File.split(dwarf_file_path)
190
+ dsym_plist_file_path = File.join(split_dwarf_file_path[0], "..", "#{uuid}.plist")
191
+ if File.exist?(dsym_plist_file_path)
192
+ dsym_plist = Plist.parse_xml(dsym_plist_file_path)
193
+ original_uuid = dsym_plist['DBGOriginalUUID']
194
+ possible_symbol_map_path = "#{bcsymbolmaps_directory}/#{original_uuid}.bcsymbolmap"
195
+ if File.exist?(possible_symbol_map_path)
196
+ symbol_map_path = possible_symbol_map_path.shellescape
197
+ end
198
+ end
199
+ if symbol_map_path.nil?
200
+ possible_symbol_map_path = File.join(bcsymbolmaps_directory, "#{uuid}.bcsymbolmap")
201
+ if File.exist?(possible_symbol_map_path)
202
+ symbol_map_path = possible_symbol_map_path.shellescape
203
+ end
204
+ end
205
+ if symbol_map_path.nil?
206
+ symbol_map_path = bcsymbolmaps_directory.shellescape
207
+ end
180
208
  command = []
181
209
  command << "dsymutil"
182
- command << "--symbol-map #{path}"
210
+ command << "--symbol-map #{symbol_map_path}"
183
211
  command << dsym.shellescape
184
212
  Helper.backticks(command.join(" "), print: !Gym.config[:silent])
185
213
  end
@@ -207,6 +235,17 @@ module Gym
207
235
  ipa_path
208
236
  end
209
237
 
238
+ # Moves over the binary and dsym file to the output directory
239
+ # @return (String) The path to the resulting pkg file
240
+ def move_pkg
241
+ FileUtils.mv(PackageCommandGenerator.pkg_path, File.expand_path(Gym.config[:output_directory]), force: true)
242
+ pkg_path = File.expand_path(File.join(Gym.config[:output_directory], File.basename(PackageCommandGenerator.pkg_path)))
243
+
244
+ UI.success("Successfully exported and signed the pkg file:")
245
+ UI.message(pkg_path)
246
+ pkg_path
247
+ end
248
+
210
249
  # copys framework from temp folder:
211
250
 
212
251
  def copy_files_from_path(path)
@@ -229,6 +268,7 @@ module Gym
229
268
  def copy_mac_app
230
269
  exe_name = Gym.project.build_settings(key: "EXECUTABLE_NAME")
231
270
  app_path = File.join(BuildCommandGenerator.archive_path, "Products/Applications/#{exe_name}.app")
271
+
232
272
  UI.crash!("Couldn't find application in '#{BuildCommandGenerator.archive_path}'") unless File.exist?(app_path)
233
273
  FileUtils.cp_r(app_path, File.expand_path(Gym.config[:output_directory]), remove_destination: true)
234
274
  app_path = File.join(Gym.config[:output_directory], File.basename(app_path))
@@ -45,7 +45,7 @@ module Match
45
45
  end
46
46
 
47
47
  # This method is called from both here, and from `openssl.rb`
48
- def self.ask_password(message: "Passphrase for Git Repo: ", confirm: nil)
48
+ def self.ask_password(message: "Passphrase for Match storage: ", confirm: nil)
49
49
  ensure_ui_interactive
50
50
  loop do
51
51
  password = UI.password(message)
@@ -14,6 +14,10 @@ module Match
14
14
  },
15
15
  "google_cloud" => lambda { |params|
16
16
  return nil
17
+ },
18
+ "s3" => lambda { |params|
19
+ params[:keychain_name] = params[:s3_bucket]
20
+ return Encryption::OpenSSL.configure(params)
17
21
  }
18
22
  }
19
23
  end
@@ -71,7 +71,7 @@ module Match
71
71
  private
72
72
 
73
73
  def iterate(source_path)
74
- Dir[File.join(source_path, "**", "*.{cer,p12,mobileprovision}")].each do |path|
74
+ Dir[File.join(source_path, "**", "*.{cer,p12,mobileprovision,provisionprofile}")].each do |path|
75
75
  next if File.directory?(path)
76
76
  yield(path)
77
77
  end
@@ -3,14 +3,20 @@ require_relative 'module'
3
3
  module Match
4
4
  # Generate missing resources
5
5
  class Generator
6
- def self.generate_certificate(params, cert_type, working_directory)
6
+ def self.generate_certificate(params, cert_type, working_directory, specific_cert_type: nil)
7
7
  require 'cert/runner'
8
8
  require 'cert/options'
9
9
 
10
10
  output_path = File.join(working_directory, "certs", cert_type.to_s)
11
11
 
12
+ # Mapping match option to cert option for "Developer ID Application"
13
+ if cert_type.to_sym == :developer_id_application
14
+ specific_cert_type = cert_type.to_s
15
+ end
16
+
12
17
  arguments = FastlaneCore::Configuration.create(Cert::Options.available_options, {
13
18
  development: params[:type] == "development",
19
+ type: specific_cert_type,
14
20
  generate_apple_certs: params[:generate_apple_certs],
15
21
  output_path: output_path,
16
22
  force: true, # we don't need a certificate without its private key, we only care about a new certificate
@@ -70,8 +76,15 @@ module Match
70
76
  }
71
77
 
72
78
  values[:platform] = params[:platform]
73
- values[:adhoc] = true if prov_type == :adhoc
74
- values[:development] = true if prov_type == :development
79
+
80
+ # These options are all conflicting so can only set one
81
+ if params[:type] == "developer_id"
82
+ values[:developer_id] = true
83
+ elsif prov_type == :adhoc
84
+ values[:adhoc] = true
85
+ elsif prov_type == :development
86
+ values[:development] = true
87
+ end
75
88
 
76
89
  arguments = FastlaneCore::Configuration.create(Sigh::Options.available_options, values)
77
90
 
@@ -82,6 +95,7 @@ module Match
82
95
 
83
96
  # @return the name of the provisioning profile type
84
97
  def self.profile_type_name(type)
98
+ return "Direct" if type == :developer_id
85
99
  return "Development" if type == :development
86
100
  return "AdHoc" if type == :adhoc
87
101
  return "AppStore" if type == :appstore
@@ -54,9 +54,9 @@ module Match
54
54
 
55
55
  case cert_type
56
56
  when :development
57
- certificate_type = Spaceship::ConnectAPI::Certificate::CertificateType::IOS_DEVELOPMENT
57
+ certificate_type = Spaceship::ConnectAPI::Certificate::CertificateType::IOS_DEVELOPMENT + "," + Spaceship::ConnectAPI::Certificate::CertificateType::DEVELOPMENT
58
58
  when :distribution, :enterprise
59
- certificate_type = Spaceship::ConnectAPI::Certificate::CertificateType::IOS_DISTRIBUTION
59
+ certificate_type = Spaceship::ConnectAPI::Certificate::CertificateType::IOS_DISTRIBUTION + "," + Spaceship::ConnectAPI::Certificate::CertificateType::DISTRIBUTION
60
60
  else
61
61
  UI.user_error!("Cert type '#{cert_type}' is not supported")
62
62
  end