Skip to content

Commit 89fa24e

Browse files
committed
v3.4.2
1 parent 8352e7a commit 89fa24e

File tree

3 files changed

+45
-62
lines changed

3 files changed

+45
-62
lines changed

Instabug.podspec

Lines changed: 5 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,6 @@
11
Pod::Spec.new do |s|
2-
Pod::Installer::UserProjectIntegrator::TargetIntegrator.class_eval do
3-
unless method_defined?(:integrate_with_instabug!)
4-
INSTABUG_PHASE_NAME = "Upload Instabug dSYM"
5-
INSTABUG_PHASE_SCRIPT = <<-SCRIPTEND
6-
# SKIP_SIMULATOR_BUILDS=1
7-
SCRIPT_SRC=$(find "$PROJECT_DIR" -name 'Instabug_dsym_upload.sh')
8-
if [ ! "${SCRIPT_SRC}" ]; then
9-
echo "Instabug: err: script not found. Make sure that you're including Instabug.bundle in your project directory"
10-
exit 1
11-
fi
12-
source "${SCRIPT_SRC}"
13-
SCRIPTEND
14-
15-
def integrate_with_instabug!
16-
integrate_without_instabug!
17-
return if instabug_native_targets.empty?
18-
UI.section("Integrating with Instabug") do
19-
add_instabug_upload_script_phase
20-
user_project.save
21-
end
22-
end
23-
24-
alias integrate_without_instabug! integrate!
25-
alias integrate! integrate_with_instabug!
26-
27-
def add_instabug_upload_script_phase
28-
instabug_native_targets.each do |native_target|
29-
phase = native_target.shell_script_build_phases.select{ |bp| bp.name == INSTABUG_PHASE_NAME }.first ||
30-
native_target.new_shell_script_build_phase(INSTABUG_PHASE_NAME)
31-
32-
phase.shell_path = "/bin/sh"
33-
phase.shell_script = INSTABUG_PHASE_SCRIPT
34-
phase.show_env_vars_in_log = '0'
35-
end
36-
end
37-
38-
def instabug_native_targets
39-
@instabug_native_targets ||=(
40-
target_uuids = target.user_target_uuids
41-
native_targets = target_uuids.map do |uuid|
42-
native_target = user_project.objects_by_uuid[uuid]
43-
unless native_target
44-
raise Informative, "[Error] Unable to find the target with " \
45-
"the `#{uuid}` UUID for the `#{target}` integration library"
46-
end
47-
native_target
48-
end
49-
50-
native_targets.reject do |native_target|
51-
native_target.shell_script_build_phases.any? do |bp|
52-
bp.name == INSTABUG_PHASE_NAME && bp.shell_script == INSTABUG_PHASE_SCRIPT
53-
end
54-
end
55-
)
56-
end
57-
end
58-
end
59-
602
s.name = "Instabug"
61-
s.version = "3.4.1"
3+
s.version = "3.4.2"
624
s.summary = "Bug reporting for mobile apps. Learn more at http://instabug.com"
635
s.homepage = "http://instabug.com"
646
s.license = {
@@ -81,12 +23,13 @@ Pod::Spec.new do |s|
8123
}
8224
s.author = { "Instabug" => "[email protected]" }
8325
s.platform = :ios, '5.0'
84-
s.source = { :git => "https://github.com/Instabug/Instabug-iOS.git", :tag => "3.4.1" }
26+
s.source = { :git => "https://github.com/Instabug/Instabug-iOS.git", :tag => "3.4.2" }
8527
s.source_files = 'Instabug.framework/Versions/A/Headers/*.{h}'
86-
s.resources = 'Instabug.bundle'
87-
s.preserve_paths = 'Instabug.framework/*', 'Instabug.bundle'
28+
s.resources = 'Instabug.bundle', 'add_instabug_build_script.rb'
29+
s.preserve_paths = 'Instabug.framework/*', 'Instabug.bundle', 'add_instabug_build_script.rb'
8830
s.frameworks = 'QuartzCore', 'CoreGraphics', 'CoreMotion', 'CoreFoundation', 'SystemConfiguration', 'Foundation', 'AVFoundation', 'OpenGLES', 'AudioToolbox', 'GLKit', 'CoreTelephony', 'UIKit', 'CoreLocation', 'MessageUI', 'MobileCoreServices', 'Instabug'
8931
s.libraries = 'c++'
9032
s.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '"$(PODS_ROOT)/Instabug/"', 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++11', 'CLANG_CXX_LIBRARY' => 'libc++' }
9133
s.requires_arc = true
34+
s.prepare_command = "ruby add_instabug_build_script.rb"
9235
end

add_instabug_build_script.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
require 'xcodeproj'
2+
require 'logger'
3+
$LOG = Logger.new('./log_file.log', 'monthly')
4+
5+
INSTABUG_PHASE_NAME = "Upload Instabug dSYM"
6+
INSTABUG_PHASE_SCRIPT = <<-SCRIPTEND
7+
# SKIP_SIMULATOR_BUILDS=1
8+
SCRIPT_SRC=$(find "$PROJECT_DIR" -name 'Instabug_dsym_upload.sh')
9+
if [ ! "${SCRIPT_SRC}" ]; then
10+
echo "Instabug: err: script not found. Make sure that you're including Instabug.bundle in your project directory"
11+
exit 1
12+
fi
13+
source "${SCRIPT_SRC}"
14+
SCRIPTEND
15+
16+
$LOG.debug("env: #{ENV["PWD"]}")
17+
project_path = Dir.glob("#{ENV["PWD"]}/*.xcodeproj")
18+
project = Xcodeproj::Project.open(project_path.first)
19+
main_target = project.targets.first
20+
phase = main_target.new_shell_script_build_phase(INSTABUG_PHASE_NAME)
21+
phase.shell_script = INSTABUG_PHASE_SCRIPT
22+
project.save()

log_file.log

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Logfile created on 2014-08-06 22:12:42 +0300 by logger.rb/36483
2+
D, [2014-08-06T22:12:42.629588 #83775] DEBUG -- : project_path: []
3+
D, [2014-08-06T22:14:29.421162 #84526] DEBUG -- : project_path: [], env: /Users/Moataz/Instabug-iOS
4+
D, [2014-08-06T22:21:52.320332 #87698] DEBUG -- : project_path: [], env: /Users/Moataz/Instabug-iOS
5+
D, [2014-08-06T22:32:53.184109 #92418] DEBUG -- : project_path: [], env: /Users/Moataz/Instabug-iOS
6+
D, [2014-08-06T22:33:43.418795 #92815] DEBUG -- : project_path: $(PODS_ROOT)
7+
D, [2014-08-06T22:34:24.820212 #93142] DEBUG -- : project_path:
8+
D, [2014-08-06T22:36:22.760319 #94029] DEBUG -- : project_dir:
9+
D, [2014-08-06T22:36:22.760431 #94029] DEBUG -- : project_path:
10+
D, [2014-08-06T22:36:58.252062 #94347] DEBUG -- : project_dir:
11+
D, [2014-08-06T22:36:58.252177 #94347] DEBUG -- : project_path:
12+
D, [2014-08-06T22:37:27.630643 #94545] DEBUG -- : project_dir:
13+
D, [2014-08-06T22:37:27.630759 #94545] DEBUG -- : project_path:
14+
D, [2014-08-06T22:38:53.436259 #95215] DEBUG -- : project_dir:
15+
D, [2014-08-06T22:38:53.436369 #95215] DEBUG -- : project_path:
16+
D, [2014-08-06T22:54:29.270806 #2087] DEBUG -- : project_path: , env: /Users/Moataz/Instabug-iOS
17+
D, [2014-08-07T09:59:27.542086 #34951] DEBUG -- : project_path: , env: /Users/Moataz/Instabug-iOS
18+
D, [2014-08-07T10:01:53.915348 #36154] DEBUG -- : project_path: , env: /Users/Moataz/Instabug-iOS

0 commit comments

Comments
 (0)