🐛 Fix a bug where linking failed if project doesn't have a target named like the project

This commit is contained in:
Salma ElTarzi 2018-03-18 12:47:21 +02:00
parent 5db2aabf0c
commit f681a840eb
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,7 @@ bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/InstabugCore.framework/str
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 }
default_target = project.targets.find { |target| target.to_s == default_target_name } || project.targets.first
targets = project.targets.select { |target| (target.is_a? Xcodeproj::Project::Object::PBXNativeTarget) &&
(target.product_type == "com.apple.product-type.application") &&
(target.platform_name == :ios) }