Sha256: f67e31d13274b1b5d2c9025509afe7d3ce511c349dbcc32d36882d95121198ed

Contents?: true

Size: 1.11 KB

Versions: 16

Compression:

Stored size: 1.11 KB

Contents

module Xcake
  # This generator handles adding nodes
  # to the project and creating a build phase
  # for it.
  #
  class FileReferenceInstaller

    include Dependency
    include Plugin
    include Visitor

    attr_accessor :context

    def initialize(context)
      @context = context
    end

    # This should be overidden
    # by subclasses.
    #
    # @param [Node] the node
    #
    # @return [Boolean] true if build phase can handle the node.
    #
    def self.can_install_node(node)
      true
    end

    # Adds file reference to the target.
    #
    # This should be overidden in subclasses
    # to add the file reference the correct
    # build phase.
    #
    # @param [PBXFileReference] the file reference
    #
    # @param [PBXTarget] the xcode target
    #
    def add_file_reference_to_target(_file_reference, _target)
    end

    # @!group Visitable

    def visit_node(node)
      native_group = @context.native_object_for(node)

      file_reference = native_group.new_reference(node.path)

      node.targets.each do |t|
         add_file_reference_to_target(file_reference, t)
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
xcake-0.6.19 lib/xcake/file_reference_installer.rb
xcake-0.6.18 lib/xcake/file_reference_installer.rb
xcake-0.6.17 lib/xcake/file_reference_installer.rb
xcake-0.6.16 lib/xcake/file_reference_installer.rb
xcake-0.6.14 lib/xcake/file_reference_installer.rb
xcake-0.6.13 lib/xcake/file_reference_installer.rb
xcake-0.6.12 lib/xcake/file_reference_installer.rb
xcake-0.6.11 lib/xcake/file_reference_installer.rb
xcake-0.6.10 lib/xcake/file_reference_installer.rb
xcake-0.6.9 lib/xcake/file_reference_installer.rb
xcake-0.6.8 lib/xcake/file_reference_installer.rb
xcake-0.6.7 lib/xcake/file_reference_installer.rb
xcake-0.6.6 lib/xcake/file_reference_installer.rb
xcake-0.6.5 lib/xcake/file_reference_installer.rb
xcake-0.6.4 lib/xcake/file_reference_installer.rb
xcake-0.6.2 lib/xcake/file_reference_installer.rb