Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion kintsugi.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]

spec.add_dependency "tty-prompt", "~> 0"
spec.add_dependency "xcodeproj", ">= 1.19.0", "<= 1.27.0"
spec.add_dependency "xcodeproj", ">= 1.26.0", "<= 1.27.0"

spec.add_development_dependency "git", "~> 1.11"
spec.add_development_dependency "rake", "~> 13.0"
Expand Down
20 changes: 19 additions & 1 deletion lib/kintsugi/apply_change_to_project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def flatten_change(change, path)

def apply_group_additions(project, additions, force_create_containing_group: false)
additions.each do |change, path|
next unless %w[PBXGroup PBXVariantGroup].include?(change["isa"])
next unless %w[PBXGroup PBXVariantGroup PBXFileSystemSynchronizedRootGroup].include?(change["isa"])

group_type = Module.const_get("Xcodeproj::Project::#{change["isa"]}")
containing_group = project.group_or_file_at_path(path)
Expand Down 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 @@ -1015,6 +1017,22 @@ 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::ObjectDictionary
# It is assumed that an `ObjectDictionary` always represents a project reference.
new_group = containing_component[:project_ref].project.new(Xcodeproj::Project::PBXFileSystemSynchronizedRootGroup)
containing_component[:product_group] = new_group
add_attributes_to_component(new_group, change, change_path)
when Xcodeproj::Project::PBXGroup
# Adding file system synchronized root groups to groups is handled by another part of the code.
Copy link

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is vague and doesn't explain where or how this case is actually handled. Consider providing more specific information about which part of the code handles this scenario or what the expected behavior is.

Suggested change
# Adding file system synchronized root groups to groups is handled by another part of the code.
# No action is taken when attempting to add a file system synchronized root group to a PBXGroup.
# This scenario is intentionally ignored because PBXGroups cannot contain file system synchronized root groups.

Copilot uses AI. Check for mistakes.

else
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
Loading