class XcodeArchiveCache::BuildGraph::Node
Constants
- ACCEPTABLE_PRODUCT_TYPES
Attributes
@return [XcodeArchiveCache::BuildSettings::Container]
@return [Array<XcodeArchiveCache::BuildGraph::Node>] dependency nodes
@return [Array<XcodeArchiveCache::BuildGraph::Node>] dependent nodes
@return [Boolean]
@return [String] native target display name
@return [Xcodeproj::Project::Object::PBXNativeTarget] corresponding native target
@return [String] sha256 of (input files + build settings + dependency shas)
@return [Symbol] should target be rebuilt
@return [Array<Xcodeproj::Project::Object::PBXNativeTarget>]
Public Class Methods
@param [String] name @param [Xcodeproj::Project::Object::PBXNativeTarget] native_target
@param [Boolean] is_root
# File lib/build_graph/node.rb, line 45 def initialize(name, native_target, is_root = false) @name = name @native_target = native_target @is_root = is_root @dependent = [] @dependencies = [] @targets_injected_to = [] @state = :unknown end
Public Instance Methods
# File lib/build_graph/node.rb, line 161 def ==(other_node) other_node && native_target.uuid == other_node.native_target.uuid && native_target.project == other_node.native_target.project end
@return [Array<Node>]
Direct + transitive dependents
# File lib/build_graph/node.rb, line 145 def all_dependent_nodes (dependent + dependent.map(&:all_dependent_nodes)).flatten.uniq end
@return [String]
# File lib/build_graph/node.rb, line 93 def dsym_file_name build_settings ? build_settings[XcodeArchiveCache::BuildSettings::DWARF_DSYM_FILE_NAME_KEY] : nil end
# File lib/build_graph/node.rb, line 67 def has_acceptable_product? ACCEPTABLE_PRODUCT_TYPES.include?(native_target.product_type) end
# File lib/build_graph/node.rb, line 63 def has_bundle_product? native_target.product_type == Xcodeproj::Constants::PRODUCT_TYPE_UTI[:bundle] end
# File lib/build_graph/node.rb, line 55 def has_framework_product? native_target.product_type == Xcodeproj::Constants::PRODUCT_TYPE_UTI[:framework] end
# File lib/build_graph/node.rb, line 59 def has_static_library_product? native_target.product_type == Xcodeproj::Constants::PRODUCT_TYPE_UTI[:static_library] end
@return [String]
# File lib/build_graph/node.rb, line 132 def module_name build_settings[XcodeArchiveCache::BuildSettings::PRODUCT_MODULE_NAME_KEY] end
@return [String]
# File lib/build_graph/node.rb, line 138 def modulemap_file_name build_settings[XcodeArchiveCache::BuildSettings::MODULEMAP_FILE_KEY] end
@return [String]
# File lib/build_graph/node.rb, line 99 def original_modulemap_file_path modulemap_file = modulemap_file_name return unless modulemap_file Pathname.new(modulemap_file).absolute? ? modulemap_file : File.join(File.dirname(native_target.project.path), modulemap_file) end
@return [String]
# File lib/build_graph/node.rb, line 73 def product_file_name return nil unless build_settings product_name = build_settings[XcodeArchiveCache::BuildSettings::FULL_PRODUCT_NAME_KEY] return product_name if product_name product_name = native_target.product_reference.name if has_framework_product? && product_name product_file_name = product_name end unless product_file_name product_file_name = File.basename(native_target.product_reference.real_path) end product_file_name end
@return [String]
# File lib/build_graph/node.rb, line 108 def resulting_modulemap_file_name if module_name module_name + ".modulemap" else File.basename(modulemap_file_name) end end
@return [Array<Node>]
# File lib/build_graph/node.rb, line 151 def subgraph ([self] + dependencies + dependencies.map(&:subgraph)).flatten.uniq end
@return [String]
# File lib/build_graph/node.rb, line 118 def swift_objc_interface_header_file header_file = build_settings[XcodeArchiveCache::BuildSettings::SWIFT_OBJC_INTERFACE_HEADER_NAME_KEY] if header_file == nil our_module_name = module_name return if our_module_name == nil header_file = our_module_name + "-Swift.h" end header_file end
# File lib/build_graph/node.rb, line 165 def to_s sha_string = sha ? sha : "<none>" dependent_names = dependent.length > 0 ? dependent.map(&:name).join(", ") : "<none>" dependency_names = dependencies.length > 0 ? dependencies.map(&:name).join(", ") : "<none>" "#{name}\n\troot: #{is_root}\n\tproduct: #{product_file_name}\n\tsha: #{sha_string}\n\tstate: #{state}\n\tdependent: #{dependent_names}\n\tdependencies: #{dependency_names}" end
@return [Bool]
# File lib/build_graph/node.rb, line 157 def waiting_for_rebuild state == :waiting_for_rebuild end