Class: Xcake::HeadersBuildPhase

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

Overview

This class is used to represent a copy headers build phase

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ HeadersBuildPhase

Returns a new instance of HeadersBuildPhase.

Yields:

  • (_self)

Yield Parameters:



12
13
14
15
16
17
18
# File 'lib/xcake/dsl/build_phase/headers_build_phase.rb', line 12

def initialize
  @public = []
  @private = []
  @project = []

  yield(self) if block_given?
end

Instance Attribute Details

#privateObject

Returns the value of attribute private.



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

def private
  @private
end

#projectObject

Returns the value of attribute project.



10
11
12
# File 'lib/xcake/dsl/build_phase/headers_build_phase.rb', line 10

def project
  @project
end

#publicObject

Returns the value of attribute public.



8
9
10
# File 'lib/xcake/dsl/build_phase/headers_build_phase.rb', line 8

def public
  @public
end

Instance Method Details

#build_phase_typeObject



20
21
22
# File 'lib/xcake/dsl/build_phase/headers_build_phase.rb', line 20

def build_phase_type
  Xcodeproj::Project::Object::PBXHeadersBuildPhase
end

#configure_native_build_phase(native_build_phase, context) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/xcake/dsl/build_phase/headers_build_phase.rb', line 24

def configure_native_build_phase(native_build_phase, context)
  @public.each do |file|
    file_reference = context.file_reference_for_path(file)
    build_file = native_build_phase.add_file_reference(file_reference)
    build_file.settings = PUBLIC_HEADER_ATTRIBUTE
  end

  @private.each do |file|
    file_reference = context.file_reference_for_path(file)
    build_file = native_build_phase.add_file_reference(file_reference)
    build_file.settings = PRIVATE_HEADER_ATTRIBUTE
  end

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

#to_sObject



43
44
45
# File 'lib/xcake/dsl/build_phase/headers_build_phase.rb', line 43

def to_s
  'BuildPhase<Copy Headers>'
end