Ⅰ. 插件描述
Flexible and fast xcodebuild formatterⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'supermarin/xcpretty'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'supermarin/xcpretty'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'supermarin/xcpretty'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/supermarin/xcpretty
Ⅳ. 文档说明

__xcpretty is a fast and flexible formatter for xcodebuild__.<br/>
It does one thing, and it should do it well.
Installation
$ gem install xcprettyUsage
$ xcodebuild [flags] | xcprettyxcpretty is designed to be piped with xcodebuild and thus keeping 100%
compatibility with it. It's even a bit faster than xcodebuild itself, since
it saves your terminal some prints.
Important: If you're running xcpretty on a CI like Travis or Jenkins, you
may want to exit with same status code as xcodebuild.
CI systems usually use status codes to determine if the build has failed.
$ set -o pipefail && xcodebuild [flags] | xcpretty
#
# OR
#
$ xcodebuild [flags] | xcpretty && exit ${PIPESTATUS[0]}Raw xcodebuild output
You might want to use xcpretty together with tee to store the raw log in a
file, and get the pretty output in the terminal. This might be useful if you
want to inspect a failure in detail and aren't able to tell from the pretty
output.
Here's a way of doing it:
$ xcodebuild [flags] | tee xcodebuild.log | xcprettyFormats
--simple,-s(default)
--test,-t(RSpec style)
--tap(Test Anything Protocol-compatible output)--knock,-k(a simplified version of the Test Anything Protocol)
ANSI / UTF-8
--[no-]color: Show build icons in color. (you can add it to--simpleor--testformat).
Defaults to auto-detecting color availability.--[no-]utf: Use unicode characters in build output or only ASCII.
Defaults to auto-detecting the current locale.
Reporters
--report junit,-r junit: Creates a JUnit-style XML report atbuild/reports/junit.xml, compatible with Jenkins and TeamCity CI.--report html,-r html: Creates a simple HTML report atbuild/reports/tests.html.
--report json-compilation-database,-r json-compilation-database: Creates a JSON compilation database atbuild/reports/compilation_db.json. This is a format to replay single compilations independently of the build system.
Writing a report to a custom path can be specified using --output PATH.
Extensions
xcpretty supports custom formatters through the use of the--formatter flag, which takes a path to a file as an argument. The
file must contain a Ruby subclass of XCPretty::Formatter, and
return that class at the end of the file. The class
can override the format_* methods to hook into output parsing
events.
Known extensions
- xcpretty-travis-formatter: support for cleaner output in TravisCI using code folding
The recommended format is a gem containing the formatter and named
with an xcpretty- prefix, for easier discovery.