Class: XcodeBuilder::BuildOutputParser

Inherits:
Object
  • Object
show all
Defined in:
lib/xcode_builder/build_output_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(output) ⇒ BuildOutputParser

Returns a new instance of BuildOutputParser.



4
5
6
# File 'lib/xcode_builder/build_output_parser.rb', line 4

def initialize(output)
  @output = output
end

Instance Method Details

#build_output_dirObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/xcode_builder/build_output_parser.rb', line 8

def build_output_dir
  # yes, this is truly horrible, but unless somebody else can find a better way...
  found = @output.split("\n").grep(/^Validate(.*)\/Xcode\/DerivedData\/(.*)-(.*)/).first
  if found && found =~ /Validate [\"]?([^\"|$]*)/
    reference = $1 
  else 
    raise "Cannot parse build_dir from build output."
  end        
  derived_data_directory = reference.split("/Build/Products/").first
  "#{derived_data_directory}/Build/Products/"
end

#failed?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/xcode_builder/build_output_parser.rb', line 20

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