Sha256: da8fdece2e2acd575c892f0f4b79006e1475c1739cd5a1e34fb5b9bfff301b09

Contents?: true

Size: 1.29 KB

Versions: 19

Compression:

Stored size: 1.29 KB

Contents

module Xcake
  PUBLIC_HEADER_ATTRIBUTE = { 'ATTRIBUTES' => ['Public'] }.freeze
  PRIVATE_HEADER_ATTRIBUTE = { 'ATTRIBUTES' => ['Private'] }.freeze

  # This class is used to represent a copy headers build phase
  #
  class HeadersBuildPhase < BuildPhase
    attr_accessor :public
    attr_accessor :private
    attr_accessor :project

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

      yield(self) if block_given?
    end

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

    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

    def to_s
      'BuildPhase<Copy Headers>'
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
xcake-0.13.0 lib/xcake/dsl/build_phase/headers_build_phase.rb
xcake-0.12.1 lib/xcake/dsl/build_phase/headers_build_phase.rb
xcake-0.12.0 lib/xcake/dsl/build_phase/headers_build_phase.rb
xcake-0.11.0 lib/xcake/dsl/build_phase/headers_build_phase.rb
xcake-0.10.0 lib/xcake/dsl/build_phase/headers_build_phase.rb
xcake-0.9.4 lib/xcake/dsl/build_phase/headers_build_phase.rb
xcake-0.9.3 lib/xcake/dsl/build_phase/headers_build_phase.rb
xcake-0.9.2 lib/xcake/dsl/build_phase/headers_build_phase.rb
xcake-0.9.1 lib/xcake/dsl/build_phase/headers_build_phase.rb
xcake-0.9.0 lib/xcake/dsl/build_phase/headers_build_phase.rb
xcake-0.8.13 lib/xcake/dsl/build_phase/headers_build_phase.rb
xcake-0.8.12 lib/xcake/dsl/build_phase/headers_build_phase.rb
xcake-0.8.10 lib/xcake/dsl/build_phase/headers_build_phase.rb
xcake-0.8.9 lib/xcake/dsl/build_phase/headers_build_phase.rb
xcake-0.8.8 lib/xcake/dsl/build_phase/headers_build_phase.rb
xcake-0.8.7 lib/xcake/dsl/build_phase/headers_build_phase.rb
xcake-0.8.6 lib/xcake/dsl/build_phase/headers_build_phase.rb
xcake-0.8.3 lib/xcake/dsl/build_phase/headers_build_phase.rb
xcake-0.8.1 lib/xcake/build_phase/headers_build_phase.rb