From 1d6fdb13a9920c3d52a08450a9c7048d2512359f Mon Sep 17 00:00:00 2001 From: Salma ElTarzi Date: Tue, 5 Sep 2017 17:20:20 +0200 Subject: [PATCH 1/8] :ambulance: Add preunlink script to remove Instabug.framework from the project. --- link.rb | 11 +++++++++-- package.json | 3 ++- unlink.rb | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 unlink.rb diff --git a/link.rb b/link.rb index a5a1c7b4c..0c2c8b33b 100644 --- a/link.rb +++ b/link.rb @@ -38,8 +38,15 @@ # Add framework search path to target ['Debug', 'Release'].each do |config| - paths = ['$(inherited)', framework_root] - target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'] = paths + paths = ['$(inherited', framework_root] + if target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'] == nil + target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'] = paths + elsif target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'].kind_of?(Array) + target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'] << framework_root unless target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'].include? framework_root + else + paths = [target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'], framework_root] + target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'] = paths + end end # Add framework to target as "Embedded Frameworks" diff --git a/package.json b/package.json index f40e38e7f..7abd40118 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,8 @@ "homepage": "https://github.com/Instabug/instabug-reactnative#readme", "rnpm": { "commands": { - "postlink": "ruby ./node_modules/instabug-reactnative/link.rb || echo \"Ruby doesn't exist, if you're building this for Android only, then feel free to ignore this error, otherwise please install Ruby and run 'react-native link instabug-reactnative' again\"" + "postlink": "ruby ./node_modules/instabug-reactnative/link.rb || echo \"Ruby doesn't exist, if you're building this for Android only, then feel free to ignore this error, otherwise please install Ruby and run 'react-native link instabug-reactnative' again\"", + "preunlink": "ruby ./node_modules/instabug-reactnative/unlink.rb || echo \"Ruby doesn't exist, if you're building this for Android only, then feel free to ignore this error, otherwise please install Ruby and run 'react-native link instabug-reactnative' again\"" }, "android": { "packageInstance": "\t\tnew RNInstabugReactnativePackage.Builder(\"YOUR_ANDROID_APPLICATION_TOKEN\",MainApplication.this)\n\t\t\t\t\t\t\t.setInvocationEvent(\"shake\")\n\t\t\t\t\t\t\t.setPrimaryColor(\"#1D82DC\")\n\t\t\t\t\t\t\t.setFloatingEdge(\"left\")\n\t\t\t\t\t\t\t.setFloatingButtonOffsetFromTop(250)\n\t\t\t\t\t\t\t.build()" diff --git a/unlink.rb b/unlink.rb new file mode 100644 index 000000000..866985c04 --- /dev/null +++ b/unlink.rb @@ -0,0 +1,46 @@ +#!/usr/bin/env ruby +begin + require 'xcodeproj' +rescue LoadError + puts('xcodeproj doesn\'t exist') + Kernel.exit(0) +end +require 'fileutils' + +# Replace these with your values +current_path = Dir.pwd +project_path = Dir.glob("#{current_path}/ios/*.xcodeproj").first +file_name = File.basename(project_path, ".xcodeproj") +project_location = './ios/'+file_name+'.xcodeproj' +target_name = file_name +framework_root = '../node_modules/instabug-reactnative/ios' +framework_name = 'Instabug.framework' + +INSTABUG_PHASE_NAME = "Strip Frameworks" + +# Get useful variables +project = Xcodeproj::Project.open(project_location) +frameworks_group = project.groups.find { |group| group.display_name == 'Frameworks' } +target = project.targets.find { |target| target.to_s == target_name } +frameworks_build_phase = target.build_phases.find { |build_phase| build_phase.to_s == 'FrameworksBuildPhase' } + +# Remove "Embed Frameworks" build phase to target +embed_frameworks_build_phase = target.build_phases.find { |build_phase| build_phase.to_s == 'Embed Frameworks'} +target.build_phases.delete(embed_frameworks_build_phase) + +# Remove framework search path from target +['Debug', 'Release'].each do |config| + target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'].delete(framework_root) +end + +# Remove framework from target from "Embedded Frameworks" +framework_ref = frameworks_group.files.find { |file_reference| file_reference.path == "#{framework_root}/#{framework_name}"} +frameworks_build_phase.remove_file_reference(framework_ref) +framework_ref.remove_from_project + +#Delete New Run Script Phase from Build Phases +shell_script_build_phase = target.shell_script_build_phases.find { |build_phase| build_phase.to_s == INSTABUG_PHASE_NAME } +target.build_phases.delete(shell_script_build_phase) + +# Save Xcode project +project.save \ No newline at end of file From 963bea72bff718ba6a3c3a2c63bae06196164864 Mon Sep 17 00:00:00 2001 From: Salma ElTarzi Date: Thu, 7 Sep 2017 19:43:17 +0200 Subject: [PATCH 2/8] =?UTF-8?q?=F0=9F=8E=A8=20Reformat=20the=20structure?= =?UTF-8?q?=20of=20the=20linking=20and=20unlinking=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- link.rb | 54 ++++++++++++++++++++++++++++++------------------------ unlink.rb | 9 ++++----- 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/link.rb b/link.rb index 0c2c8b33b..45eb2cdb3 100644 --- a/link.rb +++ b/link.rb @@ -5,18 +5,18 @@ puts('xcodeproj doesn\'t exist') Kernel.exit(0) end -require 'fileutils' # Replace these with your values current_path = Dir.pwd project_path = Dir.glob("#{current_path}/ios/*.xcodeproj").first file_name = File.basename(project_path, ".xcodeproj") -project_location = './ios/'+file_name+'.xcodeproj' +project_location = "./ios/#{file_name}.xcodeproj" target_name = file_name framework_root = '../node_modules/instabug-reactnative/ios' framework_name = 'Instabug.framework' INSTABUG_PHASE_NAME = "Strip Frameworks" + INSTABUG_PHASE_SCRIPT = <<-SCRIPTEND bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Instabug.framework/Instabug.bundle/strip-frameworks.sh" SCRIPTEND @@ -24,40 +24,46 @@ # Get useful variables project = Xcodeproj::Project.open(project_location) frameworks_group = project.groups.find { |group| group.display_name == 'Frameworks' } -if frameworks_group == nil - frameworks_group = project.new_group('Frameworks') -end +frameworks_group = project.new_group('Frameworks') if frameworks_group == nil target = project.targets.find { |target| target.to_s == target_name } frameworks_build_phase = target.build_phases.find { |build_phase| build_phase.to_s == 'FrameworksBuildPhase' } # Add new "Embed Frameworks" build phase to target -embed_frameworks_build_phase = project.new(Xcodeproj::Project::Object::PBXCopyFilesBuildPhase) -embed_frameworks_build_phase.name = 'Embed Frameworks' -embed_frameworks_build_phase.symbol_dst_subfolder_spec = :frameworks -target.build_phases << embed_frameworks_build_phase +embed_frameworks_build_phase = target.build_phases.find { |build_phase| build_phase.to_s == 'Embed Frameworks'} +if embed_frameworks_build_phase == nil + embed_frameworks_build_phase = project.new(Xcodeproj::Project::Object::PBXCopyFilesBuildPhase) + embed_frameworks_build_phase.name = 'Embed Frameworks' + embed_frameworks_build_phase.symbol_dst_subfolder_spec = :frameworks + target.build_phases << embed_frameworks_build_phase +end # Add framework search path to target ['Debug', 'Release'].each do |config| - paths = ['$(inherited', framework_root] - if target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'] == nil - target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'] = paths - elsif target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'].kind_of?(Array) - target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'] << framework_root unless target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'].include? framework_root - else - paths = [target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'], framework_root] - target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'] = paths - end + paths = ['$(inherited)', framework_root] + framework_search_paths = target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'] + + framework_search_paths ||= ['$(inherited)'] + framework_search_paths = [framework_search_paths] unless framework_search_paths.is_a?(Array) + framework_search_paths << framework_root unless framework_search_paths.include? framework_root + + target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'] = framework_search_paths end # Add framework to target as "Embedded Frameworks" -framework_ref = frameworks_group.new_file("#{framework_root}/#{framework_name}") -build_file = embed_frameworks_build_phase.add_file_reference(framework_ref) -frameworks_build_phase.add_file_reference(framework_ref) -build_file.settings = { 'ATTRIBUTES' => ['CodeSignOnCopy', 'RemoveHeadersOnCopy'] } +framework_ref = frameworks_group.files.find { |file_reference| file_reference.path == "#{framework_root}/#{framework_name}"} +if framework_ref == nil + framework_ref = frameworks_group.new_file("#{framework_root}/#{framework_name}") + build_file = embed_frameworks_build_phase.add_file_reference(framework_ref) + frameworks_build_phase.add_file_reference(framework_ref) + build_file.settings = { 'ATTRIBUTES' => ['CodeSignOnCopy', 'RemoveHeadersOnCopy'] } +end #Add New Run Script Phase to Build Phases -phase = target.new_shell_script_build_phase(INSTABUG_PHASE_NAME) -phase.shell_script = INSTABUG_PHASE_SCRIPT +shell_script_build_phase = target.shell_script_build_phases.find { |build_phase| build_phase.to_s == INSTABUG_PHASE_NAME } +if shell_script_build_phase == nil + phase = target.new_shell_script_build_phase(INSTABUG_PHASE_NAME) + phase.shell_script = INSTABUG_PHASE_SCRIPT +end # Save Xcode project project.save \ No newline at end of file diff --git a/unlink.rb b/unlink.rb index 866985c04..ff653d25a 100644 --- a/unlink.rb +++ b/unlink.rb @@ -5,13 +5,12 @@ puts('xcodeproj doesn\'t exist') Kernel.exit(0) end -require 'fileutils' # Replace these with your values current_path = Dir.pwd project_path = Dir.glob("#{current_path}/ios/*.xcodeproj").first file_name = File.basename(project_path, ".xcodeproj") -project_location = './ios/'+file_name+'.xcodeproj' +project_location = "./ios/#{file_name}.xcodeproj" target_name = file_name framework_root = '../node_modules/instabug-reactnative/ios' framework_name = 'Instabug.framework' @@ -26,7 +25,7 @@ # Remove "Embed Frameworks" build phase to target embed_frameworks_build_phase = target.build_phases.find { |build_phase| build_phase.to_s == 'Embed Frameworks'} -target.build_phases.delete(embed_frameworks_build_phase) +target.build_phases.delete(embed_frameworks_build_phase) if embed_frameworks_build_phase # Remove framework search path from target ['Debug', 'Release'].each do |config| @@ -36,11 +35,11 @@ # Remove framework from target from "Embedded Frameworks" framework_ref = frameworks_group.files.find { |file_reference| file_reference.path == "#{framework_root}/#{framework_name}"} frameworks_build_phase.remove_file_reference(framework_ref) -framework_ref.remove_from_project +framework_ref.remove_from_project if framework_ref #Delete New Run Script Phase from Build Phases shell_script_build_phase = target.shell_script_build_phases.find { |build_phase| build_phase.to_s == INSTABUG_PHASE_NAME } -target.build_phases.delete(shell_script_build_phase) +target.build_phases.delete(shell_script_build_phase) if shell_script_build_phase # Save Xcode project project.save \ No newline at end of file From 80279ae46578d26a1d54f86046b6a06da12b13e8 Mon Sep 17 00:00:00 2001 From: nmartin Date: Thu, 7 Sep 2017 14:06:24 -0600 Subject: [PATCH 3/8] Rename ios exported method 'logout' to 'logOut'. This matches the android implementation. --- ios/RNInstabug/InstabugReactBridge.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/RNInstabug/InstabugReactBridge.m b/ios/RNInstabug/InstabugReactBridge.m index cee604368..fd6952ee8 100644 --- a/ios/RNInstabug/InstabugReactBridge.m +++ b/ios/RNInstabug/InstabugReactBridge.m @@ -229,7 +229,7 @@ - (dispatch_queue_t)methodQueue { [Instabug identifyUserWithEmail:email name:name]; } -RCT_EXPORT_METHOD(logout) { +RCT_EXPORT_METHOD(logOut) { [Instabug logOut]; } From 7f1254bd8c82500bd8cc02b47195206b6cbd8e1b Mon Sep 17 00:00:00 2001 From: Salma ElTarzi Date: Sat, 9 Sep 2017 15:45:50 +0200 Subject: [PATCH 4/8] :bug: Fix a bug when the unlinking script run twice changed the parsing of the iOS project. --- link.rb | 4 +++- unlink.rb | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/link.rb b/link.rb index 45eb2cdb3..56b1ac8e4 100644 --- a/link.rb +++ b/link.rb @@ -51,7 +51,9 @@ # Add framework to target as "Embedded Frameworks" framework_ref = frameworks_group.files.find { |file_reference| file_reference.path == "#{framework_root}/#{framework_name}"} +is_linked = true if framework_ref == nil + is_linked = false framework_ref = frameworks_group.new_file("#{framework_root}/#{framework_name}") build_file = embed_frameworks_build_phase.add_file_reference(framework_ref) frameworks_build_phase.add_file_reference(framework_ref) @@ -66,4 +68,4 @@ end # Save Xcode project -project.save \ No newline at end of file +project.save unless is_linked \ No newline at end of file diff --git a/unlink.rb b/unlink.rb index ff653d25a..3e1b2ebb6 100644 --- a/unlink.rb +++ b/unlink.rb @@ -27,9 +27,12 @@ embed_frameworks_build_phase = target.build_phases.find { |build_phase| build_phase.to_s == 'Embed Frameworks'} target.build_phases.delete(embed_frameworks_build_phase) if embed_frameworks_build_phase +is_string = false; + # Remove framework search path from target ['Debug', 'Release'].each do |config| - target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'].delete(framework_root) + is_string ||= target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'].is_a? String + target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'].delete(framework_root) end # Remove framework from target from "Embedded Frameworks" @@ -42,4 +45,4 @@ target.build_phases.delete(shell_script_build_phase) if shell_script_build_phase # Save Xcode project -project.save \ No newline at end of file +project.save unless is_string \ No newline at end of file From 24b3714c1ef9dcadd7c1c1eca31b4e1684810143 Mon Sep 17 00:00:00 2001 From: Salma ElTarzi Date: Sun, 10 Sep 2017 12:10:03 +0200 Subject: [PATCH 5/8] =?UTF-8?q?=F0=9F=8E=A8=20Improve=20the=20format=20of?= =?UTF-8?q?=20the=20unlink,=20and=20linking=20scripts.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- link.rb | 10 ++++++---- unlink.rb | 9 ++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/link.rb b/link.rb index 56b1ac8e4..723f0397d 100644 --- a/link.rb +++ b/link.rb @@ -30,16 +30,19 @@ # Add new "Embed Frameworks" build phase to target embed_frameworks_build_phase = target.build_phases.find { |build_phase| build_phase.to_s == 'Embed Frameworks'} +is_linked = true if embed_frameworks_build_phase == nil + is_linked = false embed_frameworks_build_phase = project.new(Xcodeproj::Project::Object::PBXCopyFilesBuildPhase) embed_frameworks_build_phase.name = 'Embed Frameworks' embed_frameworks_build_phase.symbol_dst_subfolder_spec = :frameworks target.build_phases << embed_frameworks_build_phase end +Kernel.exit(0) if is_linked + # Add framework search path to target ['Debug', 'Release'].each do |config| - paths = ['$(inherited)', framework_root] framework_search_paths = target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'] framework_search_paths ||= ['$(inherited)'] @@ -51,9 +54,8 @@ # Add framework to target as "Embedded Frameworks" framework_ref = frameworks_group.files.find { |file_reference| file_reference.path == "#{framework_root}/#{framework_name}"} -is_linked = true + if framework_ref == nil - is_linked = false framework_ref = frameworks_group.new_file("#{framework_root}/#{framework_name}") build_file = embed_frameworks_build_phase.add_file_reference(framework_ref) frameworks_build_phase.add_file_reference(framework_ref) @@ -68,4 +70,4 @@ end # Save Xcode project -project.save unless is_linked \ No newline at end of file +project.save \ No newline at end of file diff --git a/unlink.rb b/unlink.rb index 3e1b2ebb6..4629857b8 100644 --- a/unlink.rb +++ b/unlink.rb @@ -25,14 +25,13 @@ # Remove "Embed Frameworks" build phase to target embed_frameworks_build_phase = target.build_phases.find { |build_phase| build_phase.to_s == 'Embed Frameworks'} +Kernel.exit(0) unless embed_frameworks_build_phase target.build_phases.delete(embed_frameworks_build_phase) if embed_frameworks_build_phase -is_string = false; - # Remove framework search path from target ['Debug', 'Release'].each do |config| - is_string ||= target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'].is_a? String - target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'].delete(framework_root) + # is_string ||= target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'].is_a? String + target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'].delete(framework_root) if target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'].is_a? Array end # Remove framework from target from "Embedded Frameworks" @@ -45,4 +44,4 @@ target.build_phases.delete(shell_script_build_phase) if shell_script_build_phase # Save Xcode project -project.save unless is_string \ No newline at end of file +project.save \ No newline at end of file From 1e00576cbdc981601d4d600988d632ac639d1c60 Mon Sep 17 00:00:00 2001 From: Salma ElTarzi Date: Sun, 10 Sep 2017 12:22:26 +0200 Subject: [PATCH 6/8] =?UTF-8?q?=F0=9F=8E=A8=20Improve=20the=20format=20of?= =?UTF-8?q?=20the=20linking=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- link.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/link.rb b/link.rb index 723f0397d..fd9553438 100644 --- a/link.rb +++ b/link.rb @@ -30,16 +30,15 @@ # Add new "Embed Frameworks" build phase to target embed_frameworks_build_phase = target.build_phases.find { |build_phase| build_phase.to_s == 'Embed Frameworks'} -is_linked = true +Kernel.exit(0) if embed_frameworks_build_phase + if embed_frameworks_build_phase == nil is_linked = false embed_frameworks_build_phase = project.new(Xcodeproj::Project::Object::PBXCopyFilesBuildPhase) embed_frameworks_build_phase.name = 'Embed Frameworks' embed_frameworks_build_phase.symbol_dst_subfolder_spec = :frameworks target.build_phases << embed_frameworks_build_phase -end - -Kernel.exit(0) if is_linked +end # Add framework search path to target ['Debug', 'Release'].each do |config| From dacff620364345e50c8fed43a530f710638741ee Mon Sep 17 00:00:00 2001 From: Salma ElTarzi Date: Sun, 10 Sep 2017 12:35:13 +0200 Subject: [PATCH 7/8] =?UTF-8?q?=F0=9F=94=A5=20Remove=20redundant=20code=20?= =?UTF-8?q?from=20linking,=20and=20unlinking=20scripts.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- link.rb | 32 +++++++++++--------------------- unlink.rb | 9 ++++----- 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/link.rb b/link.rb index fd9553438..fc7c045a0 100644 --- a/link.rb +++ b/link.rb @@ -24,21 +24,17 @@ # Get useful variables project = Xcodeproj::Project.open(project_location) frameworks_group = project.groups.find { |group| group.display_name == 'Frameworks' } -frameworks_group = project.new_group('Frameworks') if frameworks_group == nil +frameworks_group ||= project.new_group('Frameworks') target = project.targets.find { |target| target.to_s == target_name } frameworks_build_phase = target.build_phases.find { |build_phase| build_phase.to_s == 'FrameworksBuildPhase' } # Add new "Embed Frameworks" build phase to target embed_frameworks_build_phase = target.build_phases.find { |build_phase| build_phase.to_s == 'Embed Frameworks'} Kernel.exit(0) if embed_frameworks_build_phase - -if embed_frameworks_build_phase == nil - is_linked = false - embed_frameworks_build_phase = project.new(Xcodeproj::Project::Object::PBXCopyFilesBuildPhase) - embed_frameworks_build_phase.name = 'Embed Frameworks' - embed_frameworks_build_phase.symbol_dst_subfolder_spec = :frameworks - target.build_phases << embed_frameworks_build_phase -end +embed_frameworks_build_phase = project.new(Xcodeproj::Project::Object::PBXCopyFilesBuildPhase) +embed_frameworks_build_phase.name = 'Embed Instabug Framework' +embed_frameworks_build_phase.symbol_dst_subfolder_spec = :frameworks +target.build_phases << embed_frameworks_build_phase # Add framework search path to target ['Debug', 'Release'].each do |config| @@ -52,21 +48,15 @@ end # Add framework to target as "Embedded Frameworks" -framework_ref = frameworks_group.files.find { |file_reference| file_reference.path == "#{framework_root}/#{framework_name}"} +framework_ref = frameworks_group.new_file("#{framework_root}/#{framework_name}") +build_file = embed_frameworks_build_phase.add_file_reference(framework_ref) +frameworks_build_phase.add_file_reference(framework_ref) +build_file.settings = { 'ATTRIBUTES' => ['CodeSignOnCopy', 'RemoveHeadersOnCopy'] } -if framework_ref == nil - framework_ref = frameworks_group.new_file("#{framework_root}/#{framework_name}") - build_file = embed_frameworks_build_phase.add_file_reference(framework_ref) - frameworks_build_phase.add_file_reference(framework_ref) - build_file.settings = { 'ATTRIBUTES' => ['CodeSignOnCopy', 'RemoveHeadersOnCopy'] } -end #Add New Run Script Phase to Build Phases -shell_script_build_phase = target.shell_script_build_phases.find { |build_phase| build_phase.to_s == INSTABUG_PHASE_NAME } -if shell_script_build_phase == nil - phase = target.new_shell_script_build_phase(INSTABUG_PHASE_NAME) - phase.shell_script = INSTABUG_PHASE_SCRIPT -end +phase = target.new_shell_script_build_phase(INSTABUG_PHASE_NAME) +phase.shell_script = INSTABUG_PHASE_SCRIPT # Save Xcode project project.save \ No newline at end of file diff --git a/unlink.rb b/unlink.rb index 4629857b8..d994fb6f4 100644 --- a/unlink.rb +++ b/unlink.rb @@ -26,22 +26,21 @@ # Remove "Embed Frameworks" build phase to target embed_frameworks_build_phase = target.build_phases.find { |build_phase| build_phase.to_s == 'Embed Frameworks'} Kernel.exit(0) unless embed_frameworks_build_phase -target.build_phases.delete(embed_frameworks_build_phase) if embed_frameworks_build_phase +target.build_phases.delete(embed_frameworks_build_phase) # Remove framework search path from target ['Debug', 'Release'].each do |config| - # is_string ||= target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'].is_a? String - target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'].delete(framework_root) if target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'].is_a? Array + target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'].delete(framework_root) end # Remove framework from target from "Embedded Frameworks" framework_ref = frameworks_group.files.find { |file_reference| file_reference.path == "#{framework_root}/#{framework_name}"} frameworks_build_phase.remove_file_reference(framework_ref) -framework_ref.remove_from_project if framework_ref +framework_ref.remove_from_project #Delete New Run Script Phase from Build Phases shell_script_build_phase = target.shell_script_build_phases.find { |build_phase| build_phase.to_s == INSTABUG_PHASE_NAME } -target.build_phases.delete(shell_script_build_phase) if shell_script_build_phase +target.build_phases.delete(shell_script_build_phase) # Save Xcode project project.save \ No newline at end of file From 9500e0862e65da2b92507ffa569ffbef083aaaa2 Mon Sep 17 00:00:00 2001 From: Salma ElTarzi Date: Sun, 10 Sep 2017 13:09:36 +0200 Subject: [PATCH 8/8] =?UTF-8?q?=F0=9F=93=9D=20Change=20the=20Embed=20Insta?= =?UTF-8?q?bug=20framework=20name.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- link.rb | 2 +- unlink.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/link.rb b/link.rb index fc7c045a0..b3b5e23f6 100644 --- a/link.rb +++ b/link.rb @@ -29,7 +29,7 @@ frameworks_build_phase = target.build_phases.find { |build_phase| build_phase.to_s == 'FrameworksBuildPhase' } # Add new "Embed Frameworks" build phase to target -embed_frameworks_build_phase = target.build_phases.find { |build_phase| build_phase.to_s == 'Embed Frameworks'} +embed_frameworks_build_phase = target.build_phases.find { |build_phase| build_phase.to_s == 'Embed Instabug Framework'} Kernel.exit(0) if embed_frameworks_build_phase embed_frameworks_build_phase = project.new(Xcodeproj::Project::Object::PBXCopyFilesBuildPhase) embed_frameworks_build_phase.name = 'Embed Instabug Framework' diff --git a/unlink.rb b/unlink.rb index d994fb6f4..014d4dcae 100644 --- a/unlink.rb +++ b/unlink.rb @@ -24,7 +24,7 @@ frameworks_build_phase = target.build_phases.find { |build_phase| build_phase.to_s == 'FrameworksBuildPhase' } # Remove "Embed Frameworks" build phase to target -embed_frameworks_build_phase = target.build_phases.find { |build_phase| build_phase.to_s == 'Embed Frameworks'} +embed_frameworks_build_phase = target.build_phases.find { |build_phase| build_phase.to_s == 'Embed Instabug Framework'} Kernel.exit(0) unless embed_frameworks_build_phase target.build_phases.delete(embed_frameworks_build_phase)