lib/gym/runner.rb in gym-1.2.0 vs lib/gym/runner.rb in gym-1.3.0
- old
+ new
@@ -5,10 +5,15 @@
module Gym
class Runner
# @return (String) The path to the resulting ipa
def run
clear_old_files
+
+ if Gym.project.tvos?
+ UI.user_error!("gym doesn't suppoort tvOS projects yet, we're working on adding this feature!")
+ end
+
build_app
verify_archive
FileUtils.mkdir_p(Gym.config[:output_directory])
@@ -79,12 +84,12 @@
print_command: !Gym.config[:silent],
error: proc do |output|
ErrorHandler.handle_build_error(output)
end)
- Helper.log.info("Successfully stored the archive. You can find it in the Xcode Organizer.".green)
- Helper.log.info("Stored the archive in: ".green + BuildCommandGenerator.archive_path) if $verbose
+ UI.success "Successfully stored the archive. You can find it in the Xcode Organizer."
+ UI.verbose("Stored the archive in: " + BuildCommandGenerator.archive_path)
end
# Makes sure the archive is there and valid
def verify_archive
# from https://github.com/fastlane/gym/issues/115
@@ -110,44 +115,41 @@
# Compress and move the dsym file
containing_directory = File.expand_path("..", PackageCommandGenerator.dsym_path)
available_dsyms = Dir.glob("#{containing_directory}/*.dSYM")
+ UI.message "Compressing #{available_dsyms.count} dSYM(s)" unless Gym.config[:silent]
- Helper.log.info "Compressing #{available_dsyms.count} dSYM(s)"
-
output_path = File.expand_path(File.join(Gym.config[:output_directory], Gym.config[:output_name] + ".app.dSYM.zip"))
command = "cd '#{containing_directory}' && zip -r '#{output_path}' *.dSYM"
- Helper.log.info command.yellow unless Gym.config[:silent]
- command_result = `#{command}`
- Helper.log.info command_result if $verbose
+ Helper.backticks(command, print: !Gym.config[:silent])
puts "" # new line
- Helper.log.info "Successfully exported and compressed dSYM file".green
+ UI.success "Successfully exported and compressed dSYM file"
end
# Moves over the binary and dsym file to the output directory
# @return (String) The path to the resulting ipa file
def move_ipa
FileUtils.mv(PackageCommandGenerator.ipa_path, File.expand_path(Gym.config[:output_directory]), force: true)
ipa_path = File.expand_path(File.join(Gym.config[:output_directory], File.basename(PackageCommandGenerator.ipa_path)))
- Helper.log.info "Successfully exported and signed the ipa file:".green
- Helper.log.info ipa_path
+ UI.success "Successfully exported and signed the ipa file:"
+ UI.message ipa_path
ipa_path
end
# Move the .app from the archive into the output directory
def move_mac_app
app_path = Dir[File.join(BuildCommandGenerator.archive_path, "Products/Applications/*.app")].last
- raise "Couldn't find application in '#{BuildCommandGenerator.archive_path}'".red unless app_path
+ UI.crash!("Couldn't find application in '#{BuildCommandGenerator.archive_path}'") unless app_path
FileUtils.mv(app_path, File.expand_path(Gym.config[:output_directory]), force: true)
app_path = File.join(Gym.config[:output_directory], File.basename(app_path))
- Helper.log.info "Successfully exported the .app file:".green
- Helper.log.info app_path
+ UI.success "Successfully exported the .app file:"
+ UI.message app_path
app_path
end
private