Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion lib/kintsugi/apply_change_to_project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,8 @@ def add_child_to_component(component, change, change_path)
add_file_reference(component, change, change_path)
when "PBXGroup"
add_group(component, change, change_path)
when "PBXFileSystemSynchronizedRootGroup"
add_file_system_synchronized_root_group(component, change, change_path)
when "PBXContainerItemProxy"
add_container_item_proxy(component, change, change_path)
when "PBXTargetDependency"
Expand Down Expand Up @@ -1006,7 +1008,7 @@ def add_group(containing_component, change, change_path)
new_group = containing_component[:project_ref].project.new(Xcodeproj::Project::PBXGroup)
containing_component[:product_group] = new_group
add_attributes_to_component(new_group, change, change_path)
when Xcodeproj::Project::PBXGroup
when Xcodeproj::Project::PBXGroup, Xcodeproj::Project::PBXFileSystemSynchronizedRootGroup
# Adding groups to groups is handled by another part of the code.
else
raise MergeError, "Trying to add group to an unsupported component type " \
Expand All @@ -1015,6 +1017,29 @@ def add_group(containing_component, change, change_path)
end
end

def add_file_system_synchronized_root_group(containing_component, change, change_path)
case containing_component
when Xcodeproj::Project::PBXNativeTarget
group = containing_component.project.new(Xcodeproj::Project::PBXFileSystemSynchronizedRootGroup)
containing_component.file_system_synchronized_groups << group
add_attributes_to_component(group, change, change_path)
when Xcodeproj::Project::PBXGroup, Xcodeproj::Project::PBXFileSystemSynchronizedRootGroup
# Adding file system synchronized root groups to groups is handled by another part of
# the code.
else
if containing_component.respond_to?(:file_system_synchronized_groups)
group = containing_component.project.new(Xcodeproj::Project::PBXFileSystemSynchronizedRootGroup)
containing_component.file_system_synchronized_groups << group
add_attributes_to_component(group, change, change_path)
return
end

raise MergeError, "Trying to add file system synchronized root group to an unsupported " \
"component type #{containing_component.isa}. Change is: #{change}. " \
"Change path: #{change_path}"
end
end

def add_attributes_to_component(component, change, change_path, ignore_keys: [])
change.each do |change_name, change_value|
next if (%w[isa displayName] + ignore_keys).include?(change_name)
Expand Down