Class: Xcodeproj::Project::Object::PBXBuildRule

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

Overview

This class represents a custom build rule of a Target.

Instance Attribute Summary

Attributes inherited from AbstractObject

#isa, #project, #uuid

Attributes collapse

Helpers collapse

Methods inherited from AbstractObject

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

Instance Method Details

#add_output_file(file, compiler_flags = '') ⇒ Void

Adds an output file with the specified compiler flags.

Parameters:

  • file (PBXFileReference)

    the file to add.

  • compiler_flags (String) (defaults to: '')

    the compiler flags for the file.

Returns:

  • (Void)

83
84
85
86
# File 'lib/xcodeproj/project/object/build_rule.rb', line 83

def add_output_file(file, compiler_flags = '')
  (self.output_files ||= []) << file
  (self.output_files_compiler_flags ||= []) << compiler_flags
end

#ascii_plist_annotationObject


96
97
98
# File 'lib/xcodeproj/project/object/build_rule.rb', line 96

def ascii_plist_annotation
  " #{isa} "
end

#compiler_specString

Returns a string representing what compiler to use.

Examples:

`com.apple.compilers.proxy.script`.

Returns:

  • (String)

    a string representing what compiler to use.


18
# File 'lib/xcodeproj/project/object/build_rule.rb', line 18

attribute :compiler_spec, String

#file_patternsString

Returns the pattern of the files that should be processed by this rule. This attribute is an alternative to to `file_type`.

Examples:

`*.css`.

Returns:

  • (String)

    the pattern of the files that should be processed by this rule. This attribute is an alternative to to `file_type`.


35
# File 'lib/xcodeproj/project/object/build_rule.rb', line 35

attribute :file_patterns, String

#file_typeString

Returns the type of the files that should be processed by this rule.

Examples:

`pattern.proxy`.

Returns:

  • (String)

    the type of the files that should be processed by this rule.


26
# File 'lib/xcodeproj/project/object/build_rule.rb', line 26

attribute :file_type, String

#input_filesObjectList<PBXFileReference>

Returns the file references for the input files files.

Returns:


47
# File 'lib/xcodeproj/project/object/build_rule.rb', line 47

attribute :input_files, Array

#is_editableString

Returns whether the rule is editable.

Examples:

`1`.

Returns:

  • (String)

    whether the rule is editable.


42
# File 'lib/xcodeproj/project/object/build_rule.rb', line 42

attribute :is_editable, String, '1'

#nameString

Returns the name of the rule.

Returns:

  • (String)

    the name of the rule.


11
# File 'lib/xcodeproj/project/object/build_rule.rb', line 11

attribute :name, String

#output_filesObjectList<PBXFileReference>

Returns the file references for the output files.

Returns:


52
# File 'lib/xcodeproj/project/object/build_rule.rb', line 52

attribute :output_files, Array

#output_files_and_flagsArray<[PBXFileReference, String]>

Returns An array containing tuples of output files and their compiler flags.

Returns:

  • (Array<[PBXFileReference, String]>)

    An array containing tuples of output files and their compiler flags.


92
93
94
# File 'lib/xcodeproj/project/object/build_rule.rb', line 92

def output_files_and_flags
  (output_files || []).zip(output_files_compiler_flags || [])
end

#output_files_compiler_flagsObjectList<String>

Returns the compiler flags used when creating the respective output files.

Returns:

  • (ObjectList<String>)

    the compiler flags used when creating the respective output files.


57
# File 'lib/xcodeproj/project/object/build_rule.rb', line 57

attribute :output_files_compiler_flags, Array

#run_once_per_architectureString

Returns whether the rule should be run once per architecture.

Examples:

`0`.

Returns:

  • (String)

    whether the rule should be run once per architecture.


64
# File 'lib/xcodeproj/project/object/build_rule.rb', line 64

attribute :run_once_per_architecture, String

#scriptString

Note:

This attribute is present if the ##compiler_spec is `com.apple.compilers.proxy.script`

Returns the content of the script to use for the build rule.

Returns:

  • (String)

    the content of the script to use for the build rule.


71
# File 'lib/xcodeproj/project/object/build_rule.rb', line 71

attribute :script, String