|
1 | | -Pod::Installer::UserProjectIntegrator::TargetIntegrator.class_eval do |
2 | | - unless method_defined?(:integrate_with_instabug!) |
| 1 | +Pod::Spec.new do |s| |
| 2 | + Pod::Installer::UserProjectIntegrator::TargetIntegrator.class_eval do |
| 3 | + unless method_defined?(:integrate_with_instabug!) |
3 | 4 |
|
4 | | - INSTABUG_PHASE_NAME = "Upload Instabug dSYM" |
5 | | - INSTABUG_PHASE_SCRIPT = <<'END' |
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 | | -END |
| 5 | + INSTABUG_PHASE_NAME = "Upload Instabug dSYM" |
| 6 | + INSTABUG_PHASE_SCRIPT = <<'END' |
| 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 | + END |
14 | 15 |
|
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 |
| 16 | + def integrate_with_instabug! |
| 17 | + integrate_without_instabug! |
| 18 | + return if instabug_native_targets.empty? |
| 19 | + UI.section("Integrating with Instabug") do |
| 20 | + add_instabug_upload_script_phase |
| 21 | + user_project.save |
| 22 | + end |
21 | 23 | end |
22 | | - end |
23 | 24 |
|
24 | | - alias integrate_without_instabug! integrate! |
25 | | - alias integrate! integrate_with_instabug! |
| 25 | + alias integrate_without_instabug! integrate! |
| 26 | + alias integrate! integrate_with_instabug! |
26 | 27 |
|
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) |
| 28 | + def add_instabug_upload_script_phase |
| 29 | + instabug_native_targets.each do |native_target| |
| 30 | + phase = native_target.shell_script_build_phases.select{ |bp| bp.name == INSTABUG_PHASE_NAME }.first || |
| 31 | + native_target.new_shell_script_build_phase(INSTABUG_PHASE_NAME) |
31 | 32 |
|
32 | | - phase.shell_path = "/bin/sh" |
33 | | - phase.shell_script = INSTABUG_PHASE_SCRIPT |
34 | | - phase.show_env_vars_in_log = '0' |
| 33 | + phase.shell_path = "/bin/sh" |
| 34 | + phase.shell_script = INSTABUG_PHASE_SCRIPT |
| 35 | + phase.show_env_vars_in_log = '0' |
| 36 | + end |
35 | 37 | end |
36 | | - end |
37 | 38 |
|
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" |
| 39 | + def instabug_native_targets |
| 40 | + @instabug_native_targets ||=( |
| 41 | + target_uuids = target.user_target_uuids |
| 42 | + native_targets = target_uuids.map do |uuid| |
| 43 | + native_target = user_project.objects_by_uuid[uuid] |
| 44 | + unless native_target |
| 45 | + raise Informative, "[Error] Unable to find the target with " \ |
| 46 | + "the `#{uuid}` UUID for the `#{target}` integration library" |
| 47 | + end |
| 48 | + native_target |
46 | 49 | end |
47 | | - native_target |
48 | | - end |
49 | 50 |
|
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 |
| 51 | + native_targets.reject do |native_target| |
| 52 | + native_target.shell_script_build_phases.any? do |bp| |
| 53 | + bp.name == INSTABUG_PHASE_NAME && bp.shell_script == INSTABUG_PHASE_SCRIPT |
| 54 | + end |
53 | 55 | end |
54 | | - end |
55 | | - ) |
| 56 | + ) |
| 57 | + end |
56 | 58 | end |
57 | 59 | end |
58 | | -end |
59 | | - |
60 | | -Pod::Spec.new do |s| |
| 60 | + |
61 | 61 | s.name = "Instabug" |
62 | 62 | s.version = "3.4" |
63 | 63 | s.summary = "Bug reporting for mobile apps. Learn more at http://instabug.com" |
|
0 commit comments