Created
September 25, 2011 20:37
-
-
Save eraserhd/1241123 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! RunBuildCommand(cmd) | |
let l:BuildLog = "build/vim.log" | |
if bufname("%") != "" | |
silent write | |
endif | |
echo "Building... " | |
let l:StartTime = reltime() | |
exec "silent !" . a:cmd . " >" . l:BuildLog . " 2>&1" | |
" xcodebuild does NOT set exit code properly, so check the build log | |
exec "silent !grep -q '^\*\* BUILD FAILED' " . l:BuildLog | |
redraw! | |
if !v:shell_error | |
set errorformat= | |
\%f:%l:%c:{%*[^}]}:\ error:\ %m, | |
\%f:%l:%c:{%*[^}]}:\ fatal\ error:\ %m, | |
\%f:%l:%c:{%*[^}]}:\ warning:\ %m, | |
\%f:%l:%c:\ error:\ %m, | |
\%f:%l:%c:\ fatal\ error:\ %m, | |
\%f:%l:%c:\ warning:\ %m, | |
\%f:%l:\ Error:\ %m, | |
\%f:%l:\ error:\ %m, | |
\%f:%l:\ fatal\ error:\ %m, | |
\%f:%l:\ warning:\ %m | |
execute "cfile! " . l:BuildLog | |
else | |
echo "Building... OK - " . reltimestr(reltime(l:StartTime)) . " seconds" | |
endif | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment