Class: Pandan::Parser
- Inherits:
-
Object
- Object
- Pandan::Parser
- Defined in:
- lib/pandan/parser.rb
Instance Attribute Summary collapse
-
#regex ⇒ Object
readonly
Returns the value of attribute regex.
-
#workspace ⇒ Object
readonly
Returns the value of attribute workspace.
-
#workspace_dir ⇒ Object
readonly
Returns the value of attribute workspace_dir.
Instance Method Summary collapse
- #all_targets ⇒ Object
-
#initialize(workspace_path, filter) ⇒ Parser
constructor
A new instance of Parser.
- #other_linker_flags ⇒ Object
Constructor Details
#initialize(workspace_path, filter) ⇒ Parser
Returns a new instance of Parser.
9 10 11 12 13 14 |
# 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 |
Instance Attribute Details
#regex ⇒ Object (readonly)
Returns the value of attribute regex.
7 8 9 |
# File 'lib/pandan/parser.rb', line 7 def regex @regex end |
#workspace ⇒ Object (readonly)
Returns the value of attribute workspace.
7 8 9 |
# File 'lib/pandan/parser.rb', line 7 def workspace @workspace end |
#workspace_dir ⇒ Object (readonly)
Returns the value of attribute workspace_dir.
7 8 9 |
# File 'lib/pandan/parser.rb', line 7 def workspace_dir @workspace_dir end |
Instance Method Details
#all_targets ⇒ Object
16 17 18 19 |
# 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 ⇒ Object
21 22 23 24 25 26 27 28 |
# 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 |