Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/beta_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def initialize(namespace = :beta, &block)

def xcodebuild(*args)
# we're using tee as we still want to see our build output on screen
system("#{@configuration.xcodebuild_path} #{args.join(" ")} | tee build.output")
system("#{@configuration.xcodebuild_path} #{args.join(" ")} 2>&1 | tee build.output")
end

class Configuration < OpenStruct
Expand Down Expand Up @@ -118,6 +118,7 @@ def define
desc "Build the beta release of the app"
task :build => :clean do
xcodebuild @configuration.build_arguments, "build"
raise "** BUILD FAILED **" if BuildOutputParser.new(File.read("build.output")).failed?
end

task :clean do
Expand Down
4 changes: 4 additions & 0 deletions lib/beta_builder/build_output_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ def build_output_dir
derived_data_directory = reference.split("/Build/Products/").first
"#{derived_data_directory}/Build/Products/"
end

def failed?
@output.split("\n").any? {|line| line.include? "** BUILD FAILED **"}
end
end
end

Expand Down