Scior / danger-xcode_warnings

đŸ“¡Danger plugin for analyzing the result from xcodebuild

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

danger-xcode_warnings

Gem Version Build Status version License: MIT

A Danger plugin to format and show warnings from xcodebuild.

Sample

Features

  • Extract the compiler and linker warnings from the build log and format them for Danger
    • Both xcodebuild and xcpretty format are supported
  • Gather the build timing summary and show

Installation

gem install danger-xcode_warnings

Or 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 | xcpretty

And 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 danger

With 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.log

Show 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.log

Then, 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

  1. Clone this repo
  2. Run bundle install to setup dependencies.
  3. Run bundle exec rake spec to run the tests.
  4. Use bundle exec guard to automatically have tests run as you make changes.
  5. Make your changes.

About

đŸ“¡Danger plugin for analyzing the result from xcodebuild

License:MIT License


Languages

Language:Ruby 100.0%