danger-xcode_warnings
A Danger plugin to format and show warnings from xcodebuild.
Features
- Extract the compiler and linker warnings from the build log and format them for Danger
- Both
xcodebuildandxcprettyformat are supported
- Both
- Gather the build timing summary and show
Installation
gem install danger-xcode_warningsOr using Bundler,
gem 'danger-xcode_warnings'Usage
With xcodebuild
Firstly, collect the log from xcodebuild.
xcodebuild clean build -workspace ... > build.log
# If you want to show the log with xcpretty
xcodebuild clean build -workspace ... | tee build.log | xcprettyAnd then, call analyze_file method in your Dangerfile to analyze the build log,
xcode_warnings.analyze_file 'build.log'with some shell scripts with your CI, like:
bundle install
bundle exec dangerWith xcpretty
If you want to analyze the xcpretty log, you MUST set the use_xcpretty flag in your Dangerfile:
xcode_warnings.use_xcpretty = true
xcode_warnings.analyze_file 'build.log'Your build script for CI should be like,
xcodebuild clean build -workspace ... | xcpretty > build.logShow linker warnings
To show linker warnings, set the show_linker_warnings to true before analyzing the log:
xcode_warnings.show_linker_warnings = true
xcode_warnings.analyze_file 'build.log'Gathering build timing sumamry
To gather the build timing summary, you have to add -showBuildTimingSummary option to your build script:
xcodebuild clean build -workspace ... -showBuildTimingSummary > build.logThen, set the build_timing_summary flag to true.
xcode_warnings.build_timing_summary = true
xcode_warnings.analyze_file 'build.log'See also
RubyDoc for this plugin is here:
Development
- Clone this repo
- Run
bundle installto setup dependencies. - Run
bundle exec rake specto run the tests. - Use
bundle exec guardto automatically have tests run as you make changes. - Make your changes.
