class Danger::DangerXcprofiler

Asserts compilation time of each methods if these are exceeded the specified thresholds @example Asserting compilation time of 'MyApp'

xcprofiler.report 'MyApp'

@example Define thresholds (ms)

xcprofiler.thresholds = { warn: 100, fail: 500 }
xcprofiler.report 'MyApp'

@example Specify a custom DerivedData directory

xcprofiler.report 'MyApp' './DerivedData'

@see giginet/danger-xcprofiler @tags xcode, ios, danger

Attributes

ignored_files[RW]

A globbed string or array of strings which should match the files that you want to ignore warnings on. Defaults to nil. An example would be `'/Pods/'` to ignore warnings in Pods that your project uses.

@param [String or [String]] value @return [[String]]

inline_mode[RW]

Defines if using inline comment to assert Default value is `true` @param [Boolean] value @return [Boolean]

thresholds[RW]

Defines threshold of compilation time (ms) to assert warning/failure Default value is `{ warn: 100, fail: 500 }` @param [Hash<String, String>] value @return [Hash<String, String>]

working_dir[RW]

Defines path for working directory Default value is `Dir.pwd` @param [String] value @return [String]

Public Instance Methods

report(product_name, derived_data_path = nil) click to toggle source

Search the latest .xcactivitylog by the passing product_name and profile compilation time @param [String] product_name Product name for the target project. @param [String] derived_data_path Path to the directory containing the DerivedData. @return [void]

# File lib/xcprofiler/plugin.rb, line 52
def report(product_name, derived_data_path = nil)
  profiler = Xcprofiler::Profiler.by_product_name(product_name, derived_data_path)
  profiler.reporters = [
    DangerReporter.new(@dangerfile, thresholds, inline_mode, working_dir, ignored_files)
  ]
  profiler.report!
rescue Xcprofiler::DerivedDataNotFound, Xcprofiler::BuildFlagIsNotEnabled => e
  warn(e.message)
end