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



76
77
78
# File 'lib/xcodeproj/project/object/build_file.rb', line 76

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.



55
56
57
58
59
60
61
62
63
# File 'lib/xcodeproj/project/object/build_file.rb', line 55

def display_name
  if product_ref
    product_ref.display_name
  elsif 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

#platform_filtersArray<String>

Returns the platform filters for this build file.

Returns:

  • (Array<String>)

    the platform filters for this build file.



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

attribute :platform_filters, Array

#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.



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

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