Class: Xcake::CopyFilesBuildPhase

Inherits:
BuildPhase show all
Defined in:
lib/xcake/dsl/build_phase/copy_files_build_phase.rb

Overview

This class is used to represent a copy files build phase

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BuildPhase

#initialize

Constructor Details

This class inherits a constructor from Xcake::BuildPhase

Instance Attribute Details

#filesObject

The name of files to copy



9
10
11
# File 'lib/xcake/dsl/build_phase/copy_files_build_phase.rb', line 9

def files
  @files
end

#nameObject

The name of the build phase as shown in Xcode



6
7
8
# File 'lib/xcake/dsl/build_phase/copy_files_build_phase.rb', line 6

def name
  @name
end

Instance Method Details

#build_phase_typeObject



11
12
13
# File 'lib/xcake/dsl/build_phase/copy_files_build_phase.rb', line 11

def build_phase_type
  Xcodeproj::Project::Object::PBXCopyFilesBuildPhase
end

#configure_native_build_phase(native_build_phase, _context) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/xcake/dsl/build_phase/copy_files_build_phase.rb', line 15

def configure_native_build_phase(native_build_phase, _context)
  native_build_phase.name = name

  @files.each do |file|
    file_reference = context.file_reference_for_path(file)
    native_build_phase.add_file_reference(file_reference)
  end
end

#to_sObject



24
25
26
# File 'lib/xcake/dsl/build_phase/copy_files_build_phase.rb', line 24

def to_s
  "BuildPhase<#{name}>"
end