Class: Xcake::CopyResourcesFileReferenceInstaller

Inherits:
FileReferenceInstaller show all
Defined in:
lib/xcake/file_reference_installer/copy_resources_file_reference_installer.rb

Overview

This build phase generator detects files and adds them to the copy resources phase.

Note: This installer is always the last to be executed.

Direct Known Subclasses

CopyXCAssetsFileReferenceInstaller

Instance Attribute Summary

Attributes inherited from FileReferenceInstaller

#context

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from FileReferenceInstaller

#initialize, plugins_location, #visit_node

Methods included from Visitor

#item_name, #leave, #visit

Methods included from Plugin

included

Methods included from Dependency

included

Constructor Details

This class inherits a constructor from Xcake::FileReferenceInstaller

Class Method Details

.can_install_node(node) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/xcake/file_reference_installer/copy_resources_file_reference_installer.rb', line 13

def self.can_install_node(node)
  extension = File.extname(node.path)
  (!File.directory?(node.path) ||
    (File.directory?(node.path) &&
        !['.xcassets', '.xcdatamodeld', '.lproj'].include?(extension) &&
        node.children.count == 0))
end

.dependenciesObject



7
8
9
10
11
# File 'lib/xcake/file_reference_installer/copy_resources_file_reference_installer.rb', line 7

def self.dependencies
  FileReferenceInstaller.descendants.select do |i|
    i != self
  end
end

Instance Method Details

#add_file_reference_to_target(file_reference, target) ⇒ Object



21
22
23
# File 'lib/xcake/file_reference_installer/copy_resources_file_reference_installer.rb', line 21

def add_file_reference_to_target(file_reference, target)
  target.resources_build_phase.add_file_reference(file_reference, true)
end