Class: Xcodeproj::Project::Object::PBXBuildFile

Inherits:
AbstractObject show all
Defined in:
lib/xcodeproj/project/object/build_file.rb

Overview

Contains the information about the build settings of a file used by an AbstractBuildPhase.

Instance Attribute Summary

Attributes inherited from AbstractObject

#isa, #project, #uuid

Attributes collapse

AbstractObject Hooks collapse

Methods inherited from AbstractObject

#<=>, #==, #inspect, isa, #nested_object_for_hash, #remove_from_project, #sort, #sort_recursively, #to_ascii_plist, #to_hash

Instance Method Details

#ascii_plist_annotationObject


70
71
72
# File 'lib/xcodeproj/project/object/build_file.rb', line 70

def ascii_plist_annotation
  " #{display_name} in #{GroupableHelper.parent(self).display_name} "
end

#display_nameString

Returns A name suitable for displaying the object to the user.

Returns:

  • (String)

    A name suitable for displaying the object to the user.


51
52
53
54
55
56
57
# File 'lib/xcodeproj/project/object/build_file.rb', line 51

def display_name
  if file_ref
    file_ref.display_name
  else
    super
  end
end

#file_refPBXFileReference

TODO:

I think that is possible to add any kind of group (for example folders linked to a path).

Returns the file to build.

Returns:


26
27
28
29
30
31
32
# File 'lib/xcodeproj/project/object/build_file.rb', line 26

has_one :file_ref, [
  PBXFileReference,
  PBXGroup,
  PBXVariantGroup,
  XCVersionGroup,
  PBXReferenceProxy,
]

#platform_filterString

Returns the platform filter for this build file.

Returns:

  • (String)

    the platform filter for this build file.


40
# File 'lib/xcodeproj/project/object/build_file.rb', line 40

attribute :platform_filter, String

#pretty_printHash{String => Hash}, String

Returns A hash suitable to display the object to the user.

Returns:

  • (Hash{String => Hash}, String)

    A hash suitable to display the object to the user.


62
63
64
65
66
67
68
# File 'lib/xcodeproj/project/object/build_file.rb', line 62

def pretty_print
  if settings.nil? || settings.empty?
    display_name
  else
    { display_name => settings }
  end
end

#product_refXCSwiftPackageProductDependency

Returns the Swift Package file to build.

Returns:


36
# File 'lib/xcodeproj/project/object/build_file.rb', line 36

has_one :product_ref, XCSwiftPackageProductDependency

#settingsHash

Note:

The contents of this array depend on the phase of the build file.

For PBXHeadersBuildPhase is `{ “ATTRIBUTES” => [:value] }` where `:value` can be `Public`, `Private`, or nil (Protected).

Returns the list of build settings for this file.

Returns:

  • (Hash)

    the list of build settings for this file.


19
# File 'lib/xcodeproj/project/object/build_file.rb', line 19

attribute :settings, Hash