Skip to content

Commit 81ce44f

Browse files
committed
update
1 parent 58b52e2 commit 81ce44f

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

fastlane/Fastfile

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,20 @@ platform :ios do
9696
)
9797

9898
# Xcode 26 renamed 'app-store' to 'app-store-connect' in ExportOptions.plist.
99-
# Monkey-patch gym to emit the new value since fastlane hasn't been updated yet.
99+
# Monkey-patch gym's generate to rewrite the plist after gym writes it.
100100
require 'gym'
101-
::Gym::PackageCommandGeneratorXcode7.class_eval do
102-
class << self
103-
alias_method :original_config_content, :config_content unless method_defined?(:original_config_content)
104-
def config_content
105-
content = original_config_content
106-
hash = Plist.parse_xml(content)
107-
hash.delete('method')
108-
Plist::Emit.dump(hash)
109-
end
101+
orig_generate = ::Gym::PackageCommandGeneratorXcode7.method(:generate)
102+
::Gym::PackageCommandGeneratorXcode7.define_singleton_method(:generate) do
103+
result = orig_generate.call
104+
plist_path = ::Gym::PackageCommandGeneratorXcode7.config_path
105+
content = File.read(plist_path)
106+
hash = Plist.parse_xml(content)
107+
if hash['method'] == 'app-store'
108+
hash.delete('method')
109+
File.write(plist_path, hash.to_plist)
110+
UI.message("Patched ExportOptions: method -> app-store-connect")
110111
end
112+
result
111113
end
112114

113115
gym(

0 commit comments

Comments
 (0)