Class: ZergXcode::Objects::PBXBuildFile
- Inherits:
-
XcodeObject
- Object
- XcodeObject
- ZergXcode::Objects::PBXBuildFile
- Defined in:
- lib/zerg_xcode/objects/pbx_build_file.rb
Overview
A build input. Points to a PBXFileRef.
Instance Attribute Summary
Attributes inherited from XcodeObject
Class Method Summary collapse
-
.for(file_ref) ⇒ Object
Creates a build file for the given file reference.
Instance Method Summary collapse
-
#file_type ⇒ Object
The type of the referenced file.
-
#filename ⇒ Object
The name of the referenced file.
-
#guessed_build_phase_type ⇒ Object
Guesses the type of the build phase that this file should belong to.
-
#xref_name ⇒ Object
:nodoc: override xref_name to borrow the referenced object’s name.
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
Class Method Details
.for(file_ref) ⇒ Object
Creates a build file for the given file reference.
39 40 41 |
# File 'lib/zerg_xcode/objects/pbx_build_file.rb', line 39 def self.for(file_ref) self.new 'fileRef' => file_ref end |
Instance Method Details
#file_type ⇒ Object
The type of the referenced file.
19 20 21 |
# File 'lib/zerg_xcode/objects/pbx_build_file.rb', line 19 def file_type self['fileRef']['explicitFileType'] || self['fileRef']['lastKnownFileType'] end |
#filename ⇒ Object
The name of the referenced file.
14 15 16 |
# File 'lib/zerg_xcode/objects/pbx_build_file.rb', line 14 def filename self['fileRef']['path'] end |
#guessed_build_phase_type ⇒ Object
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.
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/zerg_xcode/objects/pbx_build_file.rb', line 25 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_name ⇒ Object
:nodoc: override xref_name to borrow the referenced object’s name
44 45 46 |
# File 'lib/zerg_xcode/objects/pbx_build_file.rb', line 44 def xref_name self['fileRef'].xref_name end |