Module: Xcode::BuildPhase
- Defined in:
- lib/xcode/build_phase.rb
Class Method Summary collapse
-
.copy_headers ⇒ BuildPhase
Properties for a copy headers build phase.
-
.framework ⇒ BuildPhase
Properties for a link frameworks build phase.
-
.resources ⇒ BuildPhase
Properties for a resources build phase.
-
.run_script ⇒ BuildPhase
Properties for a run shell script build phase.
-
.sources ⇒ BuildPhase
Properties for a compile sources build phase.
Instance Method Summary collapse
-
#add_build_file(file, settings = {}) ⇒ Object
Add the specified file to the Build Phase.
-
#add_build_file_with_private_privacy(file) ⇒ Object
Add the specific file to the Build Phase with the privacy settings used for header files that are added to the build headers phase.
-
#add_build_file_with_public_privacy(file) ⇒ Object
Add the specific file to the Build Phase with the privacy settings used for header files that are added to the build headers phase.
-
#add_build_file_without_arc(file) ⇒ Object
Add the specified file to the Build Phase that will have specific compiler flags to disable ARC.
-
#build_file(name) ⇒ FileReference
Find the first file that has the name or path that matches the specified parameter.
-
#build_files ⇒ Array<FileReference>
Return the files that are referenced by the build files.
-
#file(name) ⇒ BuildFile
Return the BuildFile given the file name.
Class Method Details
.copy_headers ⇒ BuildPhase
Returns properties for a copy headers build phase.
65 66 67 68 69 70 |
# File 'lib/xcode/build_phase.rb', line 65 def self.copy_headers { 'isa' => 'PBXHeadersBuildPhase', 'buildActionMask' => '2147483647', 'files' => [], 'runOnlyForDeploymentPostprocessing' => '0' } end |
.framework ⇒ BuildPhase
Returns properties for a link frameworks build phase.
21 22 23 24 25 26 |
# File 'lib/xcode/build_phase.rb', line 21 def self.framework { 'isa' => 'PBXFrameworksBuildPhase', 'buildActionMask' => '2147483647', 'files' => [], 'runOnlyForDeploymentPostprocessing' => '0' } end |
.resources ⇒ BuildPhase
Returns properties for a resources build phase.
41 42 43 44 45 46 |
# File 'lib/xcode/build_phase.rb', line 41 def self.resources { 'isa' => 'PBXResourcesBuildPhase', 'buildActionMask' => '2147483647', 'files' => [], 'runOnlyForDeploymentPostprocessing' => '0' } end |
.run_script ⇒ BuildPhase
Returns properties for a run shell script build phase.
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/xcode/build_phase.rb', line 51 def self.run_script { 'isa' => 'PBXShellScriptBuildPhase', 'buildActionMask' => '2147483647', 'files' => [], 'inputPaths' => [], 'outputPaths' => [], 'shellPath' => '/bin/sh', 'shellScript' => '', 'runOnlyForDeploymentPostprocessing' => '0' } end |
.sources ⇒ BuildPhase
Returns properties for a compile sources build phase.
31 32 33 34 35 36 |
# File 'lib/xcode/build_phase.rb', line 31 def self.sources { 'isa' => 'PBXSourcesBuildPhase', 'buildActionMask' => '2147483647', 'files' => [], 'runOnlyForDeploymentPostprocessing' => '0' } end |
Instance Method Details
#add_build_file(file, settings = {}) ⇒ Object
Add the specified file to the Build Phase.
First a BuildFile entry is created for the file and then the build file entry is added to the particular build phase. A BuildFile identifier must exist for each target.
phase.
134 135 136 137 138 139 140 |
# File 'lib/xcode/build_phase.rb', line 134 def add_build_file(file,settings = {}) find_file_by = file.path || file.name unless build_file(find_file_by) new_build_file = @registry.add_object BuildFile.buildfile(file.identifier,settings) @properties['files'] << new_build_file.identifier end end |
#add_build_file_with_private_privacy(file) ⇒ Object
Add the specific file to the Build Phase with the privacy settings used for header files that are added to the build headers phase.
181 182 183 |
# File 'lib/xcode/build_phase.rb', line 181 def add_build_file_with_private_privacy(file) add_build_file file, { "ATTRIBUTES" => [ 'Private' ] } end |
#add_build_file_with_public_privacy(file) ⇒ Object
Add the specific file to the Build Phase with the privacy settings used for header files that are added to the build headers phase.
165 166 167 |
# File 'lib/xcode/build_phase.rb', line 165 def add_build_file_with_public_privacy(file) add_build_file file, { "ATTRIBUTES" => [ 'Public' ] } end |
#add_build_file_without_arc(file) ⇒ Object
Add the specified file to the Build Phase that will have specific compiler flags to disable ARC.
149 150 151 |
# File 'lib/xcode/build_phase.rb', line 149 def add_build_file_without_arc(file) add_build_file file, { 'COMPILER_FLAGS' => "-fno-objc-arc" } end |
#build_file(name) ⇒ FileReference
this is the FileReference, the file being built and not the instance of the BuildFile.
Find the first file that has the name or path that matches the specified parameter.
108 109 110 |
# File 'lib/xcode/build_phase.rb', line 108 def build_file(name) build_files.find {|file| file.name == name or file.path == name } end |
#build_files ⇒ Array<FileReference>
Return the files that are referenced by the build files. This traverses the level of indirection to make it easier to get to the FileReference.
Another method, file, exists which will return the BuildFile references.
91 92 93 |
# File 'lib/xcode/build_phase.rb', line 91 def build_files files.map {|file| file.file_ref } end |
#file(name) ⇒ BuildFile
Return the BuildFile given the file name.
79 80 81 |
# File 'lib/xcode/build_phase.rb', line 79 def file(name) files.find {|file| file.file_ref.name == name or file.file_ref.path == name } end |