Skip to content

Commit

Permalink
disambiguate file refs better
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-makarov committed Aug 5, 2021
1 parent a4ef245 commit c55eac0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/censorius.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,18 @@ def generate_paths_group(group)
end
end

def generate_paths_file_reference(file_reference)
def generate_paths_file_reference(file_reference) # rubocop:disable Metrics/AbcSize
project_path = @paths_by_object[file_reference.project.root_object]
@paths_by_object[file_reference] = "#{project_path}/PBXFileReference(#{file_reference.full_path})"
params = []
if !file_reference.name.nil? &&
!file_reference.name.empty? &&
file_reference.name != File.basename(file_reference.full_path, '.*') &&
file_reference.name != File.basename(file_reference.full_path)
params << "name: #{file_reference.name}"
end
params << file_reference.full_path.to_s

@paths_by_object[file_reference] = "#{project_path}/PBXFileReference(#{params.join(', ')})"
end

def generate_paths_target_dependency(dependency, parent_path)
Expand Down

0 comments on commit c55eac0

Please sign in to comment.