Class: Xcake::FileReferenceInstaller
- Includes:
- Dependency, Plugin, Visitor
- Defined in:
- lib/xcake/file_reference_installer.rb
Overview
This generator handles adding nodes to the project and creating a build phase for it.
Direct Known Subclasses
CompileSourceFileReferenceInstaller, CopyResourcesFileReferenceInstaller, HeaderFileReferenceInstaller, LinkLibraryFileReferenceInstaller
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
Visitable collapse
Class Method Summary collapse
-
.can_install_node(_node) ⇒ Boolean
This should be overidden by subclasses.
- .plugins_location ⇒ Object
Instance Method Summary collapse
-
#add_file_reference_to_target(_file_reference, _target) ⇒ Object
Adds file reference to the target.
-
#initialize(context) ⇒ FileReferenceInstaller
constructor
A new instance of FileReferenceInstaller.
Methods included from Visitor
Methods included from Plugin
Methods included from Dependency
Constructor Details
#initialize(context) ⇒ FileReferenceInstaller
13 14 15 |
# File 'lib/xcake/file_reference_installer.rb', line 13 def initialize(context) @context = context end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
11 12 13 |
# File 'lib/xcake/file_reference_installer.rb', line 11 def context @context end |
Class Method Details
.can_install_node(_node) ⇒ Boolean
This should be overidden by subclasses.
28 29 30 |
# File 'lib/xcake/file_reference_installer.rb', line 28 def self.can_install_node(_node) true end |
.plugins_location ⇒ Object
17 18 19 |
# File 'lib/xcake/file_reference_installer.rb', line 17 def self.plugins_location "#{File.dirname(__FILE__)}/file_reference_installer/*.rb" end |
Instance Method Details
#add_file_reference_to_target(_file_reference, _target) ⇒ Object
Adds file reference to the target.
This should be overidden in subclasses to add the file reference the correct build phase.
42 43 |
# File 'lib/xcake/file_reference_installer.rb', line 42 def add_file_reference_to_target(_file_reference, _target) end |
#visit_node(node) ⇒ Object
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/xcake/file_reference_installer.rb', line 47 def visit_node(node) native_group = @context.native_object_for(node) file_reference = native_group[node.component] || native_group.new_reference(node.component) node.targets.each do |t| add_file_reference_to_target(file_reference, t) end end |