Skip to content

Commit

Permalink
removing annoying dsym upload from podspec
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Reinhardt committed Mar 2, 2014
1 parent c284c07 commit 300ddcc
Showing 1 changed file with 0 additions and 69 deletions.
69 changes: 0 additions & 69 deletions Bugsnag/3.1.0.fork/Bugsnag.podspec
@@ -1,72 +1,3 @@
Pod::Installer::UserProjectIntegrator::TargetIntegrator.class_eval do
unless method_defined?(:integrate_with_bugsnag!)

BUGSNAG_PHASE_NAME = "Upload Bugsnag dSYM"
BUGSNAG_PHASE_SCRIPT = <<'RUBY'
if ENV["DEBUG_INFORMATION_FORMAT"] != "dwarf-with-dsym" or ENV["PLATFORM_NAME"] == "iphonesimulator"
exit
end
fork do
Process.setsid
STDIN.reopen("/dev/null")
STDOUT.reopen("/dev/null", "a")
STDERR.reopen("/dev/null", "a")
require 'shellwords'
Dir["#{ENV["DWARF_DSYM_FOLDER_PATH"]}/#{ENV["DWARF_DSYM_FILE_NAME"]}/Contents/Resources/DWARF/*"].each do |dsym|
system("curl -F dsym=@#{Shellwords.escape(dsym)} -F projectRoot=#{Shellwords.escape(ENV["PROJECT_DIR"])} https://upload.bugsnag.com/")
end
end
RUBY

def integrate_with_bugsnag!
integrate_without_bugsnag!
return if bugsnag_native_targets.empty?
UI.section("Integrating with Bugsnag") do
add_bugsnag_upload_script_phase
user_project.save
end
end

alias integrate_without_bugsnag! integrate!
alias integrate! integrate_with_bugsnag!

def add_bugsnag_upload_script_phase
bugsnag_native_targets.each do |native_target|
phase = native_target.shell_script_build_phases.select{ |bp| bp.name == BUGSNAG_PHASE_NAME }.first ||
native_target.new_shell_script_build_phase(BUGSNAG_PHASE_NAME)

phase.shell_path = "/usr/bin/ruby"
phase.shell_script = BUGSNAG_PHASE_SCRIPT
phase.show_env_vars_in_log = '0'
end
end

def bugsnag_native_targets
@bugsnag_native_targets ||=(
target_uuids = target.user_target_uuids
native_targets = target_uuids.map do |uuid|
native_target = user_project.objects_by_uuid[uuid]
unless native_target
raise Informative, "[Bug] Unable to find the target with " \
"the `#{uuid}` UUID for the `#{target}` integration library"
end
native_target
end

native_targets.reject do |native_target|
native_target.shell_script_build_phases.any? do |bp|
bp.name == BUGSNAG_PHASE_NAME && bp.shell_script == BUGSNAG_PHASE_SCRIPT
end
end
)
end
end
end

Pod::Spec.new do |s|
s.name = "Bugsnag"
s.version = "3.1.0.fork"
Expand Down

0 comments on commit 300ddcc

Please sign in to comment.