Class: ZergXcode::Objects::PBXBuildFile

Inherits:
XcodeObject show all
Defined in:
lib/zerg_xcode/objects/pbx_build_file.rb,
lib/zerg_xcode/plugins/import.rb

Overview

A file used for building. Points to a PBXFileRef.

Instance Attribute Summary

Attributes inherited from XcodeObject

#archive_id, #version

Instance Method Summary collapse

Methods inherited from XcodeObject

#[], #[]=, #_attr_hash, #attrs, #copy_metadata, from, #initialize, #isa, new, #shallow_copy, #visit, #visit_array, #visit_hash, #visit_once, #visit_value, #xref_key

Constructor Details

This class inherits a constructor from ZergXcode::XcodeObject

Instance Method Details

#file_typeObject

The type of the referenced file.



9
10
11
# File 'lib/zerg_xcode/objects/pbx_build_file.rb', line 9

def file_type
  self['fileRef']['explicitFileType'] || self['fileRef']['lastKnownFileType']
end

#filenameObject

The name of the referenced file.



4
5
6
# File 'lib/zerg_xcode/objects/pbx_build_file.rb', line 4

def filename
  self['fileRef']['path']
end

#guessed_build_phase_typeObject

Guesses the type of the build phase that this file should belong to. This can be useful when figuring out which build phase to add a file to.



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/zerg_xcode/objects/pbx_build_file.rb', line 15

def guessed_build_phase_type
  case file_type
  when /\.h$/
    return 'PBXHeadersBuildPhase'
  when /^sourcecode/
    return 'PBXSourcesBuildPhase'
  when /\.framework$/, /\.ar$/
    return 'PBXFrameworksBuildPhase'
  else
    return 'PBXResourcesBuildPhase'
  end
end

#xref_nameObject



297
298
299
# File 'lib/zerg_xcode/plugins/import.rb', line 297

def xref_name
  self['fileRef'].xref_name
end