cocoapods-bugsnag 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 52c681af1a4ec0233a2dedcf5577e4d00b0b1009
4
+ data.tar.gz: 3f87de8cd0c5074e96c45c2f21fe5a5460e046ea
5
+ SHA512:
6
+ metadata.gz: 566e861732f79ca5290f368dd95b01276c9c12a6b023747de76b56d8525267cad2d54af05851c8a0fb8228054f9276add6ec970de20a68b8ceed376e44afeaef
7
+ data.tar.gz: 2bd2821d340e786374ac2060eb3c5b9cc886c4473a7bce1504d70b32508c1e48ff999c6454703a9e130d69a084adeaac1b4058c81bbac2afe95116d06c821d5e
@@ -0,0 +1,61 @@
1
+ module Pod
2
+ class Installer::UserProjectIntegrator::TargetIntegrator
3
+
4
+ BUGSNAG_PHASE_NAME = "Upload Bugsnag dSYM"
5
+ BUGSNAG_PHASE_SCRIPT = <<'RUBY'
6
+ fork do
7
+ Process.setsid
8
+ STDIN.reopen("/dev/null")
9
+ STDOUT.reopen("/dev/null", "a")
10
+ STDERR.reopen("/dev/null", "a")
11
+
12
+ require 'shellwords'
13
+
14
+ Dir["#{ENV["DWARF_DSYM_FOLDER_PATH"]}/*/Contents/Resources/DWARF/*"].each do |dsym|
15
+ system("curl -F dsym=@#{Shellwords.escape(dsym)} -F projectRoot=#{Shellwords.escape(ENV["PROJECT_DIR"])} https://upload.bugsnag.com/")
16
+ end
17
+ end
18
+ RUBY
19
+
20
+ alias_method :integrate_without_bugsnag!, :integrate!
21
+ def integrate!
22
+ integrate_without_bugsnag!
23
+ return unless has_bugsnag_dependency?
24
+ return if bugsnag_native_targets.empty?
25
+ UI.section("Integrating with Bugsnag") do
26
+ add_bugsnag_upload_script_phase
27
+ user_project.save
28
+ end
29
+ UI.puts "Added 'Upload Bugsnag dSYM' build phase"
30
+ end
31
+
32
+
33
+ def add_bugsnag_upload_script_phase
34
+ bugsnag_native_targets.each do |native_target|
35
+ phase = native_target.shell_script_build_phases.select do |bp|
36
+ bp.name == BUGSNAG_PHASE_NAME
37
+ end.first || native_target.new_shell_script_build_phase(BUGSNAG_PHASE_NAME)
38
+
39
+ phase.shell_path = "/usr/bin/env ruby"
40
+ phase.shell_script = BUGSNAG_PHASE_SCRIPT
41
+ phase.show_env_vars_in_log = '0'
42
+ end
43
+ end
44
+
45
+ def has_bugsnag_dependency?
46
+ target.target_definition.dependencies.detect do |dep|
47
+ dep.name.include?('Bugsnag')
48
+ end != nil
49
+ end
50
+
51
+ def bugsnag_native_targets
52
+ @bugsnag_native_targets ||=(
53
+ native_targets.reject do |native_target|
54
+ native_target.shell_script_build_phases.any? do |bp|
55
+ bp.name == BUGSNAG_PHASE_NAME && bp.shell_script == BUGSNAG_PHASE_SCRIPT
56
+ end
57
+ end
58
+ )
59
+ end
60
+ end
61
+ end
@@ -0,0 +1 @@
1
+ require 'cocoapods_bugsnag'
@@ -0,0 +1,3 @@
1
+ require 'bacon'
2
+
3
+
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cocoapods-bugsnag
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Delisa Mason
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-12-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bacon
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Configures the dSYM upload phase of your project when integrated with
42
+ bugsnag.
43
+ email:
44
+ - delisa@bugsnag.com
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - lib/cocoapods_bugsnag.rb
50
+ - lib/cocoapods_plugin.rb
51
+ - spec/cocoapods_bugsnag_spec.rb
52
+ homepage: https://bugsnag.com
53
+ licenses:
54
+ - MIT
55
+ metadata: {}
56
+ post_install_message:
57
+ rdoc_options: []
58
+ require_paths:
59
+ - lib
60
+ required_ruby_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - '>='
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ requirements: []
71
+ rubyforge_project:
72
+ rubygems_version: 2.0.14
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: To get meaningful stacktraces from your crashes, the Bugsnag service needs
76
+ your dSYM file for your build. This plugin adds an upload phase to your project
77
+ where needed.
78
+ test_files:
79
+ - spec/cocoapods_bugsnag_spec.rb