class Xcodeproj::Project::Object::PBXFileReference
and ‘last_known_file_type`.
@todo Add a list of all possible file types for `explicit_file_type`
def self.new_static_library(project, product_name)
def self.new_static_library(project, product_name) new(project, nil, "includeInIndex" => "0", "sourceTree" => "BUILT_PRODUCTS_DIR", "path" => "lib#{product_name}.a" ) end
def initialize(*)
def initialize(*) super self.path = path if path # sets default name self.source_tree ||= 'SOURCE_ROOT' self.include_in_index ||= "1" set_default_file_type! end
def path=(path)
def path=(path) self._path = path self.name ||= pathname.basename.to_s path end
def pathname
def pathname Pathname.new(path) end
def set_default_file_type!
def set_default_file_type! return if explicit_file_type || last_known_file_type case path when /\.a$/ self.explicit_file_type = 'archive.ar' when /\.framework$/ self.last_known_file_type = 'wrapper.framework' when /\.xcconfig$/ self.last_known_file_type = 'text.xcconfig' end end