mirror of
https://github.com/status-im/instabug-reactnative.git
synced 2025-03-03 06:30:41 +00:00
🤝 Merge pull request #99 from Instabug/hotfix/fix_link_script_if_condition
📝 Update script to add brackets to if condition as it did not get eva…
This commit is contained in:
commit
e79aa9eee2
7
link.rb
7
link.rb
@ -26,13 +26,13 @@ project = Xcodeproj::Project.open(project_location)
|
||||
frameworks_group = project.groups.find { |group| group.display_name == 'Frameworks' }
|
||||
frameworks_group ||= project.new_group('Frameworks')
|
||||
default_target = project.targets.find { |target| target.to_s == default_target_name }
|
||||
targets = project.targets
|
||||
targets = project.targets.select { |target| (target.is_a? Xcodeproj::Project::Object::PBXNativeTarget) &&
|
||||
(target.product_type == "com.apple.product-type.application") &&
|
||||
(target.platform_name == :ios) }
|
||||
framework_ref = frameworks_group.new_file("#{framework_root}/#{framework_name}")
|
||||
|
||||
# Add Instabug to every target that is of type application
|
||||
targets.each do |target|
|
||||
if target.is_a? Xcodeproj::Project::Object::PBXNativeTarget && (target.product_type == "com.apple.product-type.application") && (target.platform_name == :ios)
|
||||
|
||||
# Add new "Embed Frameworks" build phase to target
|
||||
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
|
||||
@ -69,7 +69,6 @@ targets.each do |target|
|
||||
phase = target.new_shell_script_build_phase(INSTABUG_PHASE_NAME)
|
||||
phase.shell_script = INSTABUG_PHASE_SCRIPT
|
||||
end
|
||||
end
|
||||
|
||||
# Save Xcode project
|
||||
project.save
|
||||
|
@ -19,7 +19,9 @@ INSTABUG_PHASE_NAME = "Strip Frameworks"
|
||||
# Get useful variables
|
||||
project = Xcodeproj::Project.open(project_location)
|
||||
frameworks_group = project.groups.find { |group| group.display_name == 'Frameworks' }
|
||||
targets = project.targets
|
||||
targets = project.targets.select { |target| (target.is_a? Xcodeproj::Project::Object::PBXNativeTarget) &&
|
||||
(target.product_type == "com.apple.product-type.application") &&
|
||||
(target.platform_name == :ios) }
|
||||
framework_ref = frameworks_group.files.find { |file_reference| file_reference.path == "#{framework_root}/#{framework_name}"}
|
||||
|
||||
# Remove Instabug's framework from the Frameworks group
|
||||
@ -27,8 +29,6 @@ frameworks_group.children.delete(framework_ref)
|
||||
|
||||
# Remove Instabug to every target that is of type application
|
||||
targets.each do |target|
|
||||
if target.is_a? Xcodeproj::Project::Object::PBXNativeTarget && (target.product_type == "com.apple.product-type.application") && (target.platform_name == :ios)
|
||||
|
||||
# Remove "Embed Frameworks" build phase to target
|
||||
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
|
||||
@ -46,7 +46,6 @@ targets.each do |target|
|
||||
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)
|
||||
end
|
||||
end
|
||||
|
||||
# Save Xcode project
|
||||
project.save
|
||||
|
Loading…
x
Reference in New Issue
Block a user