class Pandan::Parser

Attributes

regex[R]
workspace[R]
workspace_dir[R]

Public Class Methods

new(workspace_path, filter) click to toggle source
# File lib/pandan/parser.rb, line 9
def initialize(workspace_path, filter)
  @workspace_dir = File.dirname(workspace_path)
  @workspace = Xcodeproj::Workspace.new_from_xcworkspace(workspace_path)
  @regex = filter
  @regex ||= '.*' # Match everything
end

Public Instance Methods

all_targets() click to toggle source
# File lib/pandan/parser.rb, line 16
def all_targets
  @projects ||= projects
  projects.flat_map(&:targets).select { |target| target.name =~ /#{regex}/ }
end
other_linker_flags() click to toggle source
# File lib/pandan/parser.rb, line 21
def other_linker_flags
  @projects ||= projects
  ld_flags_info = {}
  projects.flat_map(&:targets).each do |target|
    ld_flags_info[target] = target.resolved_build_setting('OTHER_LDFLAGS', true)
  end
  ld_flags_info
end

Private Instance Methods

projects() click to toggle source
# File lib/pandan/parser.rb, line 32
def projects
  all_project_paths = workspace.file_references.map(&:path)
  all_project_paths.map do |project_path|
    Xcodeproj::Project.open(File.expand_path(project_path, @workspace_dir))
  end
end