fastlane 2.139.0 → 2.144.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +85 -72
  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 +28 -2
  7. data/deliver/lib/deliver/runner.rb +13 -2
  8. data/fastlane/lib/fastlane/action.rb +1 -1
  9. data/fastlane/lib/fastlane/actions/.hockey.rb.swp +0 -0
  10. data/fastlane/lib/fastlane/actions/.slack.rb.swp +0 -0
  11. data/fastlane/lib/fastlane/actions/.update_project_provisioning.rb.swp +0 -0
  12. data/fastlane/lib/fastlane/actions/README.md +2 -0
  13. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +13 -5
  14. data/fastlane/lib/fastlane/actions/automatic_code_signing.rb +7 -1
  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/clean_build_artifacts.rb +3 -0
  19. data/fastlane/lib/fastlane/actions/cocoapods.rb +2 -2
  20. data/fastlane/lib/fastlane/actions/crashlytics.rb +14 -2
  21. data/fastlane/lib/fastlane/actions/create_pull_request.rb +29 -0
  22. data/fastlane/lib/fastlane/actions/docs/{build_ios_app.md → build_app.md} +1 -1
  23. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +22 -6
  24. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +22 -6
  25. data/fastlane/lib/fastlane/actions/ensure_git_branch.rb +1 -1
  26. data/fastlane/lib/fastlane/actions/ensure_xcode_version.rb +35 -7
  27. data/fastlane/lib/fastlane/actions/frame_screenshots.rb +2 -1
  28. data/fastlane/lib/fastlane/actions/get_github_release.rb +3 -0
  29. data/fastlane/lib/fastlane/actions/gradle.rb +43 -2
  30. data/fastlane/lib/fastlane/actions/gym.rb +3 -7
  31. data/fastlane/lib/fastlane/actions/import_from_git.rb +4 -0
  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/pod_lib_lint.rb +7 -1
  35. data/fastlane/lib/fastlane/actions/run_tests.rb +5 -22
  36. data/fastlane/lib/fastlane/actions/s3.rb +5 -291
  37. data/fastlane/lib/fastlane/actions/set_github_release.rb +1 -1
  38. data/fastlane/lib/fastlane/actions/spm.rb +8 -0
  39. data/fastlane/lib/fastlane/actions/swiftlint.rb +45 -9
  40. data/fastlane/lib/fastlane/actions/update_code_signing_settings.rb +190 -0
  41. data/fastlane/lib/fastlane/actions/update_plist.rb +37 -2
  42. data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +13 -3
  43. data/fastlane/lib/fastlane/actions/upload_to_app_store.rb +1 -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 +422 -45
  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/cert_checker.rb +28 -0
  68. data/fastlane_core/lib/fastlane_core/device_manager.rb +1 -1
  69. data/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb +1 -0
  70. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +2 -0
  71. data/fastlane_core/lib/fastlane_core/project.rb +27 -0
  72. data/fastlane_core/lib/fastlane_core/provisioning_profile.rb +15 -2
  73. data/frameit/lib/frameit/commands_generator.rb +25 -0
  74. data/frameit/lib/frameit/config_parser.rb +31 -9
  75. data/frameit/lib/frameit/device.rb +90 -0
  76. data/frameit/lib/frameit/device_types.rb +121 -5
  77. data/frameit/lib/frameit/editor.rb +28 -40
  78. data/frameit/lib/frameit/offsets.rb +8 -1
  79. data/frameit/lib/frameit/options.rb +81 -54
  80. data/frameit/lib/frameit/runner.rb +17 -7
  81. data/frameit/lib/frameit/screenshot.rb +35 -47
  82. data/frameit/lib/frameit/template_finder.rb +15 -12
  83. data/gym/lib/gym/code_signing_mapping.rb +32 -3
  84. data/gym/lib/gym/detect_values.rb +34 -2
  85. data/gym/lib/gym/generators/package_command_generator.rb +8 -0
  86. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +52 -17
  87. data/gym/lib/gym/module.rb +8 -0
  88. data/gym/lib/gym/options.rb +25 -1
  89. data/gym/lib/gym/runner.rb +70 -21
  90. data/match/lib/match/change_password.rb +1 -1
  91. data/match/lib/match/encryption.rb +4 -0
  92. data/match/lib/match/encryption/openssl.rb +1 -1
  93. data/match/lib/match/generator.rb +17 -3
  94. data/match/lib/match/importer.rb +35 -20
  95. data/match/lib/match/module.rb +5 -2
  96. data/match/lib/match/nuke.rb +59 -17
  97. data/match/lib/match/options.rb +38 -15
  98. data/match/lib/match/runner.rb +24 -8
  99. data/match/lib/match/setup.rb +1 -1
  100. data/match/lib/match/spaceship_ensure.rb +19 -9
  101. data/match/lib/match/storage.rb +4 -0
  102. data/match/lib/match/storage/git_storage.rb +5 -2
  103. data/match/lib/match/storage/google_cloud_storage.rb +2 -2
  104. data/match/lib/match/storage/s3_storage.rb +162 -0
  105. data/pilot/lib/pilot/.manager.rb.swp +0 -0
  106. data/pilot/lib/pilot/build_manager.rb +24 -9
  107. data/scan/lib/scan/detect_values.rb +6 -1
  108. data/scan/lib/scan/manager.rb +18 -1
  109. data/scan/lib/scan/options.rb +28 -1
  110. data/scan/lib/scan/runner.rb +9 -7
  111. data/scan/lib/scan/slack_poster.rb +1 -1
  112. data/scan/lib/scan/test_command_generator.rb +12 -5
  113. data/screengrab/lib/screengrab/runner.rb +31 -18
  114. data/sigh/lib/sigh/.runner.rb.swp +0 -0
  115. data/snapshot/lib/snapshot/fixes/simulator_shared_pasteboard.rb +16 -0
  116. data/snapshot/lib/snapshot/options.rb +12 -1
  117. data/snapshot/lib/snapshot/simulator_launchers/launcher_configuration.rb +2 -0
  118. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +13 -0
  119. data/spaceship/lib/spaceship/connect_api/.DS_Store +0 -0
  120. data/spaceship/lib/spaceship/connect_api/models/.bundle_id.rb.swp +0 -0
  121. data/{gym/lib/gym/.runner.rb.swp → spaceship/lib/spaceship/connect_api/models/.bundle_id_capability.rb.swp} +0 -0
  122. data/spaceship/lib/spaceship/connect_api/models/app.rb +11 -0
  123. data/spaceship/lib/spaceship/connect_api/models/beta_feedback.rb +4 -0
  124. data/spaceship/lib/spaceship/connect_api/models/build.rb +1 -2
  125. data/spaceship/lib/spaceship/connect_api/models/certificate.rb +2 -0
  126. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +29 -0
  127. data/spaceship/lib/spaceship/portal/app.rb +11 -2
  128. data/spaceship/lib/spaceship/tunes/app_version.rb +6 -1
  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 +1 -1
  136. metadata +63 -18
@@ -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
 
@@ -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
@@ -45,6 +49,10 @@ module Gym
45
49
  generator.apps_path
46
50
  end
47
51
 
52
+ def asset_packs_path
53
+ generator.asset_packs_path
54
+ end
55
+
48
56
  # The generator we need to use for the currently used Xcode version
49
57
  # Since we dropped Xcode 6 support, it's just this class, but maybe we'll have
50
58
  # new classes in the future
@@ -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
@@ -110,6 +136,11 @@ module Gym
110
136
  Gym.cache[:apps_path] ||= File.join(temporary_output_path, "Apps")
111
137
  end
112
138
 
139
+ # The path to the Apps folder
140
+ def asset_packs_path
141
+ Gym.cache[:asset_packs_path] ||= File.join(temporary_output_path, "OnDemandResources")
142
+ end
143
+
113
144
  private
114
145
 
115
146
  def normalize_export_options(hash)
@@ -160,6 +191,10 @@ module Gym
160
191
  hash[:signingStyle] = 'manual'
161
192
  end
162
193
 
194
+ if Gym.config[:installer_cert_name] && (Gym.project.mac? || Gym.building_mac_catalyst_for_mac?)
195
+ hash[:installerSigningCertificate] = Gym.config[:installer_cert_name]
196
+ end
197
+
163
198
  hash[:teamID] = Gym.config[:export_team_id] if Gym.config[:export_team_id]
164
199
 
165
200
  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
@@ -23,8 +23,13 @@ module Gym
23
23
 
24
24
  FileUtils.mkdir_p(File.expand_path(Gym.config[:output_directory]))
25
25
 
26
- if Gym.project.ios? || Gym.project.tvos?
27
- 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
28
33
  return BuildCommandGenerator.archive_path if Gym.config[:skip_package_ipa]
29
34
 
30
35
  package_app
@@ -34,11 +39,16 @@ module Gym
34
39
  move_app_thinning
35
40
  move_app_thinning_size_report
36
41
  move_apps_folder
37
- elsif Gym.project.mac?
42
+ move_asset_packs
43
+ elsif is_mac
38
44
  path = File.expand_path(Gym.config[:output_directory])
39
45
  compress_and_move_dsym
40
- if Gym.project.mac_app?
41
- copy_mac_app
46
+ if Gym.project.mac_app? || Gym.building_mac_catalyst_for_mac?
47
+ path = copy_mac_app
48
+ return path if Gym.config[:skip_package_pkg]
49
+
50
+ package_app
51
+ path = move_pkg
42
52
  return path
43
53
  end
44
54
  copy_files_from_path(File.join(BuildCommandGenerator.archive_path, "Products/usr/local/bin/*")) if Gym.project.command_line_tool?
@@ -160,31 +170,45 @@ module Gym
160
170
  dwarfdump_command << "dwarfdump"
161
171
  dwarfdump_command << "--uuid #{dsym.shellescape}"
162
172
 
173
+ # Extract uuids
163
174
  dwarfdump_result = Helper.backticks(dwarfdump_command.join(" "), print: false)
164
175
  architecture_infos = dwarfdump_result.split("\n")
165
- architecture_uuids = architecture_infos.map do |info|
166
- info_array = info.split(" ")
176
+ architecture_infos.each do |info|
177
+ info_array = info.split(" ", 4)
167
178
  uuid = info_array[1]
179
+ dwarf_file_path = info_array[3]
168
180
 
169
181
  if uuid.nil? || !uuid.match(uuid_regex)
170
- nil
171
- else
172
- uuid
182
+ next
173
183
  end
174
- end
175
184
 
176
- architecture_uuids = architecture_uuids.reject(&:nil?)
177
-
178
- symbol_map_paths = architecture_uuids.map do |uuid|
179
- "#{bcsymbolmaps_directory.shellescape}/#{uuid}.bcsymbolmap"
180
- end
181
-
182
- symbol_map_paths << bcsymbolmaps_directory.shellescape if symbol_map_paths.empty?
183
-
184
- symbol_map_paths.each do |path|
185
+ # Find bcsymbolmap file to be used:
186
+ # - if a <uuid>.plist file exists, we will extract uuid of bcsymbolmap and use it
187
+ # - if a <uuid>.bcsymbolmap file exists, we will use it
188
+ # - otherwise let dsymutil figure it out
189
+ symbol_map_path = nil
190
+ split_dwarf_file_path = File.split(dwarf_file_path)
191
+ dsym_plist_file_path = File.join(split_dwarf_file_path[0], "..", "#{uuid}.plist")
192
+ if File.exist?(dsym_plist_file_path)
193
+ dsym_plist = Plist.parse_xml(dsym_plist_file_path)
194
+ original_uuid = dsym_plist['DBGOriginalUUID']
195
+ possible_symbol_map_path = "#{bcsymbolmaps_directory}/#{original_uuid}.bcsymbolmap"
196
+ if File.exist?(possible_symbol_map_path)
197
+ symbol_map_path = possible_symbol_map_path.shellescape
198
+ end
199
+ end
200
+ if symbol_map_path.nil?
201
+ possible_symbol_map_path = File.join(bcsymbolmaps_directory, "#{uuid}.bcsymbolmap")
202
+ if File.exist?(possible_symbol_map_path)
203
+ symbol_map_path = possible_symbol_map_path.shellescape
204
+ end
205
+ end
206
+ if symbol_map_path.nil?
207
+ symbol_map_path = bcsymbolmaps_directory.shellescape
208
+ end
185
209
  command = []
186
210
  command << "dsymutil"
187
- command << "--symbol-map #{path}"
211
+ command << "--symbol-map #{symbol_map_path}"
188
212
  command << dsym.shellescape
189
213
  Helper.backticks(command.join(" "), print: !Gym.config[:silent])
190
214
  end
@@ -212,6 +236,17 @@ module Gym
212
236
  ipa_path
213
237
  end
214
238
 
239
+ # Moves over the binary and dsym file to the output directory
240
+ # @return (String) The path to the resulting pkg file
241
+ def move_pkg
242
+ FileUtils.mv(PackageCommandGenerator.pkg_path, File.expand_path(Gym.config[:output_directory]), force: true)
243
+ pkg_path = File.expand_path(File.join(Gym.config[:output_directory], File.basename(PackageCommandGenerator.pkg_path)))
244
+
245
+ UI.success("Successfully exported and signed the pkg file:")
246
+ UI.message(pkg_path)
247
+ pkg_path
248
+ end
249
+
215
250
  # copys framework from temp folder:
216
251
 
217
252
  def copy_files_from_path(path)
@@ -234,6 +269,7 @@ module Gym
234
269
  def copy_mac_app
235
270
  exe_name = Gym.project.build_settings(key: "EXECUTABLE_NAME")
236
271
  app_path = File.join(BuildCommandGenerator.archive_path, "Products/Applications/#{exe_name}.app")
272
+
237
273
  UI.crash!("Couldn't find application in '#{BuildCommandGenerator.archive_path}'") unless File.exist?(app_path)
238
274
  FileUtils.cp_r(app_path, File.expand_path(Gym.config[:output_directory]), remove_destination: true)
239
275
  app_path = File.join(Gym.config[:output_directory], File.basename(app_path))
@@ -290,6 +326,19 @@ module Gym
290
326
  end
291
327
  end
292
328
 
329
+ # Move Asset Packs folder to the output directory
330
+ # @return (String) The path to the resulting Asset Packs (aka OnDemandResources) folder
331
+ def move_asset_packs
332
+ if Dir.exist?(PackageCommandGenerator.asset_packs_path)
333
+ FileUtils.mv(PackageCommandGenerator.asset_packs_path, File.expand_path(Gym.config[:output_directory]), force: true)
334
+ asset_packs_path = File.join(File.expand_path(Gym.config[:output_directory]), File.basename(PackageCommandGenerator.asset_packs_path))
335
+
336
+ UI.success("Successfully exported Asset Pack folder:")
337
+ UI.message(asset_packs_path)
338
+ asset_packs_path
339
+ end
340
+ end
341
+
293
342
  def find_archive_path
294
343
  Dir.glob(File.join(BuildCommandGenerator.build_path, "*.ipa")).last
295
344
  end
@@ -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