danger plugin for asserting Swift compilation time.
See detail for README of xcprofiler.
Add this line to your Gemfile:
gem 'danger-xcprofiler'Just add this line to your Dangerfile:
xcprofiler.report 'MyApp'Or specify an xcactivitylog path
logDir = Dir[File.join('DerivedData/Logs/Build/', '*.xcactivitylog')].first
xcprofiler.report nil, nil, logDirIf compilation times of each methods are exceeded the thresholds, danger adds inline comment to your PR.
Default thresholds is 50ms for warning, 100ms for failure.
If you want to change thresholds see the following:
# Defines inline_mode
xcprofiler.inline_mode = false
# Defines thresholds (ms)
xcprofiler.thresholds = {
warn: 100,
fail: 500
}
xcprofiler.report 'MyApp'- 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.