class Pod::Project


through the installation process.
Model class which provides helpers for working with the Pods project
The Pods project.

def add_file_reference(absolute_path, group)

Returns:
  • (PBXFileReference) - The new file reference.

Parameters:
  • group (PBXGroup) --
  • absolute_path (Array) --
def add_file_reference(absolute_path, group)
  unless Pathname.new(absolute_path).absolute?
    raise ArgumentError, "Paths must be absolute #{absolute_path}"
  end
  if ref = reference_for_path(absolute_path)
    ref
  else
    ref = group.new_file(absolute_path)
    @refs_by_absolute_path[absolute_path.to_s] = ref
  end
end

def add_pod_group(pod_name, path, development = false, absolute = false)

Returns:
  • (PBXGroup) - The new group.

Parameters:
  • absolute (Bool) --
  • development (Bool) --
  • path (#to_s) --
  • pod_name (String) --
def add_pod_group(pod_name, path, development = false, absolute = false)
  raise "[BUG]" if pod_group(pod_name)
  parent_group = development ? development_pods : pods
  source_tree = absolute ? :absolute : :group
  group = parent_group.new_group(pod_name, path, source_tree)
  group
end

def add_podfile(podfile_path)

Returns:
  • (PBXFileReference) - The new file reference.

Parameters:
  • podfile_path (#to_s) --
def add_podfile(podfile_path)
  podfile_ref = new_file(podfile_path, :project)
  podfile_ref.xc_language_specification_identifier = 'xcode.lang.ruby'
  podfile_ref.last_known_file_type = 'text'
  podfile_ref
end

def group_for_spec(spec_name, subgroup_key = nil)

Returns:
  • (PBXGroup) - The group.

Parameters:
  • spec_name (String) --
def group_for_spec(spec_name, subgroup_key = nil)
  pod_name = Specification.root_name(spec_name)
  group = pod_group(pod_name)
  raise "[Bug] Unable to locate group for Pod named `#{pod_name}`" unless group
  if spec_name != pod_name
    subspecs_names = spec_name.gsub(pod_name + '/', '').split('/')
    subspecs_names.each do |name|
      group = group[name] || group.new_group(name)
    end
  end
  if subgroup_key
    subgroup_name = SPEC_SUBGROUPS[subgroup_key]
    raise ArgumentError, "Unrecognized subgroup key `#{subgroup_key}`" unless subgroup_name
    group = group[subgroup_name] || group.new_group(subgroup_name)
  end
  group
end

def initialize(path, skip_initialization = false)

Parameters:
  • skip_initialization (Bool) --
  • path (Pathname, String) -- @see path
def initialize(path, skip_initialization = false)
  super(path, skip_initialization)
  @support_files_group = new_group('Targets Support Files')
  @refs_by_absolute_path = {}
  @pods = new_group('Pods')
  @development_pods = new_group('Development Pods')
end

def pod_group(pod_name)

Returns:
  • (PBXGroup) - The group.

Parameters:
  • pod_name (String) --
def pod_group(pod_name)
  pod_groups.find { |group| group.name == pod_name }
end

def pod_groups

Returns:
  • (Array) - Returns all the group of the Pods.
def pod_groups
  pods.children.objects + development_pods.children.objects
end

def pod_support_files_group(pod_name)

Returns:
  • (PBXGroup) - The group.

Parameters:
  • pod_name (String) --
def pod_support_files_group(pod_name)
  group = pod_group(pod_name)
  support_files_group = group['Support Files']
  unless support_files_group
    support_files_group = group.new_group('Support Files')
    support_files_group.source_tree = 'SOURCE_ROOT'
  end
  support_files_group
end

def reference_for_path(absolute_path)

Returns:
  • (Nil) - If no file reference could be found.
  • (PBXFileReference) - The file reference.

Parameters:
  • absolute_path (#to_s) --
def reference_for_path(absolute_path)
  unless Pathname.new(absolute_path).absolute?
    raise ArgumentError, "Paths must be absolute #{absolute_path}"
  end
  refs_by_absolute_path[absolute_path.to_s]
end