lib/guard/xcode.rb
# Build an Xcode project on file change
#
# Should be initialised with 'guard xcode' in the target project's 
# directory
Build an Xcode project on file change
Should be initialised with 'guard xcode' in the target project's
directory
Build an Xcode project on file change Should be initialised with ' guard xcode ' in the target project ' s directory
def run_build(build_line)
       returns:
       a list of symbols; possible values include :errors and :warnings which
       indicate the build included warnings or errors. Returning an empty list
       means no errors were detected.
      alerts = []
      puts "building..." unless @suppress_all_output
      unless @quiet or @suppress_all_output
        UI.info "guard-xcode: starting build"
        Notifier.notify("kicking off build with:\n{build_line}", :image => :pending)
      end
      output = `{build_line} 2>&1`
      res = $?
      if not ((not 0 == res or output =~ /errors? generated/) or (output =~ /warnings? generated/))
        success_message = @test ? "All Tests Passed!" : "Build succeeded!"
        UI.info "guard-xcode: {success_message}" unless @quiet or @suppress_all_output
        Notifier.notify(success_message) unless @quiet or @suppress_all_output
      end
      unless @quiet or @suppress_all_output
        puts output
      end
      if not 0 == res or output =~ /errors? generated/
        UI.info "guard-xcode: Errors in build." unless @suppress_all_output
        Notifier.notify("Errors in build.", :image => :failed) unless @suppress_all_output
        alerts.push :errors
      end
      if output =~ /warnings? generated/
        UI.info "guard-xcode: Warnings in build." unless @suppress_all_output
        Notifier.notify("Warnings in build.", :image => :failed) unless @suppress_all_output
        alerts.push :warnings
      end
      puts "build finished." unless @suppress_all_output
      alerts
    end
def run_build ( build_line ) alerts = [ ] puts "building..." unless @suppress_all_output unless @quiet or @suppress_all_output UI . info "guard-xcode: starting build" Notifier . notify ( "kicking off build with:\n#{build_line}" , :image => :pending ) end output = ` #{ build_line }  2>&1 ` res = $? if not ( ( not 0 == res or output =~ / errors? generated / ) or ( output =~ / warnings? generated / ) ) success_message = @test ? "All Tests Passed!" : "Build succeeded!" UI . info "guard-xcode: #{success_message}" unless @quiet or @suppress_all_output Notifier . notify ( success_message ) unless @quiet or @suppress_all_output end unless @quiet or @suppress_all_output puts output end if not 0 == res or output =~ / errors? generated / UI . info "guard-xcode: Errors in build." unless @suppress_all_output Notifier . notify ( "Errors in build." , :image => :failed ) unless @suppress_all_output alerts . push :errors end if output =~ / warnings? generated / UI . info "guard-xcode: Warnings in build." unless @suppress_all_output Notifier . notify ( "Warnings in build." , :image => :failed ) unless @suppress_all_output alerts . push :warnings end puts "build finished." unless @suppress_all_output alerts end
Build an Xcode project on file change
Should be initialised with 'guard xcode' in the target project's
directory
Build an Xcode project on file change Should be initialised with ' guard xcode ' in the target project ' s directory
# run the build, returning a list of alerts # # returns: # a list of symbols; possible values include :errors and :warnings which # indicate the build included warnings or errors. Returning an empty list # means no errors were detected.
build_line
<not_specific>