Skip to content

Commit 31f65ef

Browse files
committed
use xcpretty to print fail log
1 parent d51dc68 commit 31f65ef

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

cocoapods-binary.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
2020

2121
spec.add_dependency "cocoapods", ">= 1.5.0", "< 2.0"
2222
spec.add_dependency "fourflusher", "~> 2.0"
23+
spec.add_dependency "xcpretty", "~> 0.3.0"
2324

2425
spec.add_development_dependency 'bundler', '~> 1.3'
2526
spec.add_development_dependency 'rake'

lib/cocoapods-binary/rome/build_framework.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require 'fourflusher'
2+
require 'xcpretty'
23

34
CONFIGURATION = "Release"
45
PLATFORMS = { 'iphonesimulator' => 'iOS',
@@ -81,9 +82,14 @@ def xcodebuild(sandbox, target, sdk='macosx', deployment_target=nil, other_optio
8182
args += Fourflusher::SimControl.new.destination(:oldest, platform, deployment_target) unless platform.nil?
8283
args += other_options
8384
log = `xcodebuild #{args.join(" ")} 2>&1`
84-
# log = Pod::Executable.execute_command 'xcodebuild', args, true
85-
is_succeed = log[-25..-1].include? "** BUILD SUCCEEDED **"
86-
puts log unless is_succeed
85+
is_succeed = ($? == 0)
86+
87+
if !is_succeed
88+
printer = XCPretty::Printer.new({:formatter => XCPretty::Simple, :colorize => 'auto'})
89+
log.each_line do |line|
90+
printer.pretty_print(line)
91+
end
92+
end
8793
[is_succeed, log]
8894
end
8995

0 commit comments

Comments
 (0)