Commit e01bf9f9 authored by Imre Mihaly's avatar Imre Mihaly Committed by Kyle Fuller

Some parameters renamed, and a clarifying comment added

parent 66476792
...@@ -152,20 +152,20 @@ module Pod ...@@ -152,20 +152,20 @@ module Pod
# @param [Symbol] group_key # @param [Symbol] group_key
# The key of the group of the Pods project. # The key of the group of the Pods project.
# #
# @param [Bool] group_if_development # @param [Bool] reflect_file_system_structure_for_development
# Wether organizing the a local pod's files in subgroups inside # Wether organizing the a local pod's files in subgroups inside
# the pod's group is allowed. # the pod's group is allowed.
# #
# @return [void] # @return [void]
# #
def add_file_accessors_paths_to_pods_group(file_accessor_key, group_key = nil, group_if_development = false) def add_file_accessors_paths_to_pods_group(file_accessor_key, group_key = nil, reflect_file_system_structure_for_development = false)
file_accessors.each do |file_accessor| file_accessors.each do |file_accessor|
pod_name = file_accessor.spec.name pod_name = file_accessor.spec.name
local = sandbox.local?(pod_name) local = sandbox.local?(pod_name)
paths = file_accessor.send(file_accessor_key) paths = file_accessor.send(file_accessor_key)
paths.each do |path| paths.each do |path|
group = pods_project.group_for_spec(file_accessor.spec.name, group_key) group = pods_project.group_for_spec(file_accessor.spec.name, group_key)
pods_project.add_file_reference(path, group, local && group_if_development) pods_project.add_file_reference(path, group, local && reflect_file_system_structure_for_development)
end end
end end
end end
......
...@@ -145,20 +145,23 @@ module Pod ...@@ -145,20 +145,23 @@ module Pod
# @param [PBXGroup] group # @param [PBXGroup] group
# The group for the new file reference. # The group for the new file reference.
# #
# @param [Bool] development # @param [Bool] reflect_file_system_structure
# Wether the file is part of a development pod. # Wether group structure should reflect the file system structure.
# If it is then groups will be created to reflect the code's structure in the filesystem. # If yes, where needed, intermediate groups are created, similar to
# how mkdir -p operates.
# #
# @return [PBXFileReference] The new file reference. # @return [PBXFileReference] The new file reference.
# #
def add_file_reference(absolute_path, group, development = false) def add_file_reference(absolute_path, group, reflect_file_system_structure = false)
unless Pathname.new(absolute_path).absolute? file_path_name = Pathname.new(absolute_path)
unless file_path_name.absolute?
raise ArgumentError, "Paths must be absolute #{absolute_path}" raise ArgumentError, "Paths must be absolute #{absolute_path}"
end end
if development if reflect_file_system_structure
relative_path = Pathname.new(absolute_path).relative_path_from(group.real_path).dirname relative_path = file_path_name.relative_path_from(group.real_path)
relative_path.each_filename do|name| relative_dir = relative_path.dirname
relative_dir.each_filename do|name|
next if name == "." next if name == "."
group = group[name] || group.new_group(name, name) group = group[name] || group.new_group(name, name)
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment