b0VIM 8.0è:v]+ÑÓÃjoshJoshs-MacBook-Pro.local~josh/Projects/fastlane/fastlane/gym/lib/gym/runner.rbutf-8 3210#"! UtpdZeL¿ ad+dðÜÇ®­‰`FØ·¶«œg[.Ü “ ’ c  ¿ ¾ ª ‹ s ] C   ç ¨ ‰ i R < 0 ¦ œ Š ‚ G % ë ê ¤ ~ ^ A   Ù¶wOBìÔȾ½|PíäÜÛÏΔq76Íž–•b,ÚÒÑ£‘bÊDþ¦sr+* mark_archive_as_built_by_gym(BuildCommandGenerator.archive_path) end) ErrorHandler.handle_build_error(output) error: proc do |output| print_command: !Gym.config[:silent], print_all: true, FastlaneCore::CommandExecutor.execute(command: command, print_command(command, "Generated Build Command") if FastlaneCore::Globals.verbose? command = BuildCommandGenerator.generate def build_app # Builds the app and prepares the archive end system("xattr -w info.fastlane.generated_by_gym 1 #{escaped_archive_path}") escaped_archive_path = archive_path.shellescape def mark_archive_as_built_by_gym(archive_path) end Gym::XcodebuildFixes.generic_archive_fix return unless FastlaneCore::Env.truthy?("GYM_USE_GENERIC_ARCHIVE_FIX") def fix_generic_archive ##################################################### # @!group The individual steps ##################################################### private end )) rows: FastlaneCore::PrintTable.transform_output(rows.delete_if { |c| c.to_s.empty? }) headings: ["Option", "Value"], title: title.green, puts(Terminal::Table.new( end end [current, ""] current.gsub!("| ", "\| ") # as the | will somehow break the terminal table else match_default_parameter[1, 2] # That's a default parameter, like `-project 'Name'` if match_default_parameter match_default_parameter = current.match(/(-.*) '(.*)'/) next unless current.length > 0 current = c.to_s.dup rows = command.map do |c| def print_command(command, title) # @param [Array] An array containing all the parts of the command ##################################################### # @!group Printing out things ##################################################### end return path end copy_files_from_path(File.join(BuildCommandGenerator.archive_path, "Products/usr/local/bin/*")) if Gym.project.command_line_tool? end return path copy_mac_app if Gym.project.mac_app? compress_and_move_dsym path = File.expand_path(Gym.config[:output_directory]) elsif Gym.project.mac? move_apps_folder move_app_thinning_size_report move_app_thinning move_manifest path = move_ipa compress_and_move_dsym package_app return BuildCommandGenerator.archive_path if Gym.config[:skip_package_ipa] fix_generic_archive # See https://github.com/fastlane/fastlane/pull/4325 if Gym.project.ios? || Gym.project.tvos? FileUtils.mkdir_p(File.expand_path(Gym.config[:output_directory])) verify_archive unless Gym.config[:skip_archive] end build_app unless Gym.config[:skip_build_archive] def run # @return (String) The path to the resulting ipa class Runnermodule Gymrequire_relative 'error_handler'require_relative 'generators/build_command_generator'require_relative 'generators/package_command_generator'require_relative 'module'require 'fastlane_core/command_executor'require 'fastlane_core/print_table'require 'terminal-table'require 'shellwords'require 'fileutils'require 'open3'ad ¡ vÍÌyG!Û Â ‹  ” “ Z < *   ý ³ « ¥ ¡   end end end Dir.glob(File.join(BuildCommandGenerator.build_path, "*.ipa")).last def find_archive_path end end apps_path UI.message(apps_path) UI.success("Successfully exported Apps folder:") apps_path = File.join(File.expand_path(Gym.config[:output_directory]), File.basename(PackageCommandGenerator.apps_path)) FileUtils.mv(PackageCommandGenerator.apps_path, File.expand_path(Gym.config[:output_directory]), force: true) if Dir.exist?(PackageCommandGenerator.apps_path) def move_apps_folder # Move the Apps folder to the output directory end end app_thinning_size_report_path UI.message(app_thinning_size_report_path) UI.success("Successfully exported the App Thinning Size Report.txt file:") app_thinning_size_report_path = File.join(File.expand_path(Gym.config[:output_directory]), File.basename(PackageCommandGenerator.app_thinning_size_report_path)) FileUtils.mv(PackageCommandGenerator.app_thinning_size_report_path, File.expand_path(Gym.config[:output_directory]), force: true)adRžL…4÷ÝÜ™‘N   Ï ´ ¥ œ t s P +  ª j  Ý · H   ® } s k j )  Ðhó‰6ýâÓËʈr6¼32í˵«£¢aG‰ø÷®ˆnd\[êž if File.exis if File.e if File.exist?(PackageCommandGenerator.app_thinning_size_report_path) def move_app_thinning_size_report # Move the App Thinning Size Report.txt file into the output directory end end app_thinning_path UI.message(app_thinning_path) UI.success("Successfully exported the app-thinning.plist file:") app_thinning_path = File.join(File.expand_path(Gym.config[:output_directory]), File.basename(PackageCommandGenerator.app_thinning_path)) FileUtils.mv(PackageCommandGenerator.app_thinning_path, File.expand_path(Gym.config[:output_directory]), force: true) if File.exist?(PackageCommandGenerator.app_thinning_path) def move_app_thinning # Move the app-thinning.plist file into the output directory end end manifest_path UI.message(manifest_path) UI.success("Successfully exported the manifest.plist file:") manifest_path = File.join(File.expand_path(Gym.config[:output_directory]), File.basename(PackageCommandGenerator.manifest_path)) FileUtils.mv(PackageCommandGenerator.manifest_path, File.expand_path(Gym.config[:output_directory]), force: true) if File.exist?(PackageCommandGenerator.manifest_path) def move_manifest # Move the manifest.plist if exists into the output directory end app_path UI.message(app_path) UI.success("Successfully exported the .app file:") app_path = File.join(Gym.config[:output_directory], File.basename(app_path)) FileUtils.cp_r(app_path, File.expand_path(Gym.config[:output_directory]), remove_destination: true) UI.crash!("Couldn't find application in '#{BuildCommandGenerator.archive_path}'") unless File.exist?(app_path) app_path = File.join(BuildCommandGenerator.archive_path, "Products/Applications/#{exe_name}.app") exe_name = Gym.project.build_settings(key: "EXECUTABLE_NAME") def copy_mac_app # Copies the .app from the archive into the output directory end end UI.message("\t â–¸ #{File.basename(f)}") FileUtils.cp_r(f, File.expand_path(Gym.config[:output_directory]), remove_destination: true) end FileUtils.rm_rf(existing_file) UI.important("Removing #{File.basename(f)} from output directory") if FastlaneCore::Globals.verbose? if File.exist?(existing_file) # e.g.: there are symlinks in the .framework # we have to remove it first, otherwise cp_r fails even with remove_destination # If the target file already exists in output directory existing_file = File.join(File.expand_path(Gym.config[:output_directory]), File.basename(f)) Dir[path].each do |f| UI.success("Exporting Files:") def copy_files_from_path(path) # copys framework from temp folder: end ipa_path UI.message(ipa_path) UI.success("Successfully exported and signed the ipa file:") ipa_path = File.expand_path(File.join(Gym.config[:output_directory], File.basename(PackageCommandGenerator.ipa_path))) FileUtils.mv(PackageCommandGenerator.ipa_path, File.expand_path(Gym.config[:output_directory]), force: true) def move_ipa # @return (String) The path to the resulting ipa file # Moves over the binary and dsym file to the output directory end UI.success("Successfully exported and compressed dSYM file") puts("") # new line Helper.backticks(command, print: !Gym.config[:silent]) command = "cd '#{containing_directory}' && zip -r '#{output_path}' *.dSYM" output_path = File.expand_path(File.join(Gym.config[:output_directory], Gym.config[:output_name] + ".app.dSYM.zip"))ad.²Z},+ êÓ¢¡‚"ä © ^  À … „ T = ÿ º † ~ } i 8 Ü Û a  Ð v C ; :  åä¼eü¹TS'É¢VÀ„Dúùų¢qp/.𨚙=<ùש4&³²± UI.message("Compressing #{available_dsyms.count} dSYM(s)") unless Gym.config[:silent] end end end Helper.backticks(command.join(" "), print: !Gym.config[:silent]) command << dsym.shellescape command << "--symbol-map #{path}" command << "dsymutil" command = [] symbol_map_paths.each do |path| symbol_map_paths << bcsymbolmaps_directory.shellescape if symbol_map_paths.empty? end "#{bcsymbolmaps_directory.shellescape}/#{uuid}.bcsymbolmap" symbol_map_paths = architecture_uuids.map do |uuid| architecture_uuids = architecture_uuids.reject(&:nil?) end end uuid else nil if uuid.nil? || !uuid.match(uuid_regex) uuid = info_array[1] info_array = info.split(" ") architecture_uuids = architecture_infos.map do |info| architecture_infos = dwarfdump_result.split("\n") dwarfdump_result = Helper.backticks(dwarfdump_command.join(" "), print: false) dwarfdump_command << "--uuid #{dsym.shellescape}" dwarfdump_command << "dwarfdump" dwarfdump_command = [] available_dsyms.each do |dsym| UI.message("Mapping dSYM(s) using generated BCSymbolMaps") unless Gym.config[:silent] if Dir.exist?(bcsymbolmaps_directory) uuid_regex = /[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}/ available_dsyms = Dir.glob("#{containing_directory}/*.dSYM") bcsymbolmaps_directory = File.expand_path("../../BCSymbolMaps", PackageCommandGenerator.dsym_path) containing_directory = File.expand_path("..", PackageCommandGenerator.dsym_path) # Compress and move the dsym file return unless PackageCommandGenerator.dsym_path def compress_and_move_dsym end end) ErrorHandler.handle_package_error(output) error: proc do |output| print_command: !Gym.config[:silent], print_all: false, FastlaneCore::CommandExecutor.execute(command: command, print_command(command, "Generated Package Command") if FastlaneCore::Globals.verbose? command = PackageCommandGenerator.generate def package_app end end ErrorHandler.handle_empty_archive if (Dir[BuildCommandGenerator.archive_path + "/*"]).count == 0 # from https://github.com/fastlane/fastlane/issues/3179 def verify_archive # Makes sure the archive is there and valid end end) ErrorHandler.handle_build_error(output) error: proc do |output| print_command: !Gym.config[:silent], print_all: true, FastlaneCore::CommandExecutor.execute(command: command, print_command(command, "Generated Post-Build Command") if FastlaneCore::Globals.verbose? return if command.empty? command = BuildCommandGenerator.post_build def post_build_app # Post-processing of build_app end post_build_app UI.verbose("Stored the archive in: " + BuildCommandGenerator.archive_path) UI.success("Successfully stored the archive. You can find it in the Xcode Organizer.") unless Gym.config[:archive_path].nil?