class Pod::Installer::UserProjectIntegrator::TargetIntegrator

Constants

BUGSNAG_PHASE_INPUT_PATHS
BUGSNAG_PHASE_NAME
BUGSNAG_PHASE_SCRIPT
BUGSNAG_PHASE_SHELL_PATH

Public Instance Methods

add_bugsnag_upload_script_phase() click to toggle source
# File lib/cocoapods_bugsnag.rb, line 68
def add_bugsnag_upload_script_phase
  native_targets.each do |native_target|
    phase = native_target.shell_script_build_phases.select do |bp|
      bp.name == BUGSNAG_PHASE_NAME
    end.first || add_shell_script_build_phase(native_target, BUGSNAG_PHASE_NAME)

    phase.input_paths = dsym_phase_input_paths(phase)
    phase.shell_path = BUGSNAG_PHASE_SHELL_PATH
    phase.shell_script = BUGSNAG_PHASE_SCRIPT
    phase.show_env_vars_in_log = '0'
  end
end
add_shell_script_build_phase(native_target, name) click to toggle source
# File lib/cocoapods_bugsnag.rb, line 81
def add_shell_script_build_phase(native_target, name)
  UI.puts "Adding '#{name}' build phase to '#{native_target.name}'"
  native_target.new_shell_script_build_phase(name)
end
dsym_phase_input_paths(phase) click to toggle source
# File lib/cocoapods_bugsnag.rb, line 86
def dsym_phase_input_paths(phase)
  (phase.input_paths + BUGSNAG_PHASE_INPUT_PATHS + target.framework_dsym_paths).uniq
end
integrate!() click to toggle source
# File lib/cocoapods_bugsnag.rb, line 58
def integrate!
  integrate_without_bugsnag!
  return unless should_add_build_phase?

  UI.section("Integrating with Bugsnag") do
    add_bugsnag_upload_script_phase
    user_project.save
  end
end
Also aliased as: integrate_without_bugsnag!
integrate_without_bugsnag!()
Alias for: integrate!
should_add_build_phase?() click to toggle source
# File lib/cocoapods_bugsnag.rb, line 90
def should_add_build_phase?
  has_bugsnag_dep = target.target_definition.dependencies.any? do |dep|
    dep.name.match?(/bugsnag/i)
  end
  uses_bugsnag_plugin = target.target_definition.podfile.plugins.key?('cocoapods-bugsnag')
  return has_bugsnag_dep && uses_bugsnag_plugin
end