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 4, 2021
1 parent a4ef245 commit 915534c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/censorius.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,17 @@ def generate_paths_group(group)

def generate_paths_file_reference(file_reference)
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}"

# require 'pry'; binding.pry if file_reference.full_path.to_s == '${BUILT_PRODUCTS_DIR}/Zip.framework'
@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 915534c

Please sign in to comment.