Method: Xcodeproj::Workspace::FileReference#absolute_path

Defined in:
lib/xcodeproj/workspace/file_reference.rb

#absolute_path(workspace_dir_path) ⇒ String

Returns the absolute path of a file reference given the path of the directory containing workspace.

Parameters:

  • workspace_dir_path (#to_s)

    The Path of the directory containing the workspace.

Returns:

  • (String)

    The absolute path to the project.



64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/xcodeproj/workspace/file_reference.rb', line 64

def absolute_path(workspace_dir_path)
  workspace_dir_path = workspace_dir_path.to_s
  case type
  when 'group', 'container', 'self'
    File.expand_path(File.join(workspace_dir_path, path))
  when 'absolute'
    File.expand_path(path)
  when 'developer'
    raise "Developer workspace file reference type is not yet supported (#{path})"
  else
    raise "Unsupported workspace file reference type `#{type}`"
  end
end