Sha256: c75091e5d1c838c017c8878745f094e023bda28b669c67e1ca54cb7a5271f511

Contents?: true

Size: 1.09 KB

Versions: 3

Compression:

Stored size: 1.09 KB

Contents

module Xcake
  # This class is used to represent a copy files build phase
  #
  class CopyFilesBuildPhase < BuildPhase
    # The name of the build phase as shown in Xcode
    attr_accessor :name

    # The name of files to copy
    attr_accessor :files

    # The destination
    attr_accessor :destination

    # The destination path
    attr_accessor :destination_path

    # Whether the files should be code signed on copy
    attr_accessor :code_sign

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

    def configure_native_build_phase(native_build_phase, context)
      native_build_phase.name = name
      native_build_phase.dst_path = destination_path
      native_build_phase.symbol_dst_subfolder_spec = destination

      @files.each do |file|
        file_reference = context.file_reference_for_path(file)
        build_file = native_build_phase.add_file_reference(file_reference)
        if code_sign
          build_file.settings = { 'ATTRIBUTES' => ['CodeSignOnCopy'] }
        end
      end
    end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
xcake-0.8.13 lib/xcake/dsl/build_phase/copy_files_build_phase.rb
xcake-0.8.12 lib/xcake/dsl/build_phase/copy_files_build_phase.rb
xcake-0.8.10 lib/xcake/dsl/build_phase/copy_files_build_phase.rb