module Phoenx

Constants

ATTRIBUTES_CODE_SIGN_ON_COPY
ATTRIBUTES_PRIVATE_HEADERS
ATTRIBUTES_PROJECT_HEADERS
ATTRIBUTES_PUBLIC_HEADERS
CONFIGURATION_ROOT
FRAMEWORKS_ROOT
PROJECT_EXTENSION
RESOURCES_ROOT
SOURCE_EXTENSIONS
SOURCE_ROOT
TESTS_ROOT
VERSION
WORKSPACE_EXTENSION
XCODE_PROJECT_EXTENSION
XCODE_WORKSPACE_EXTENSION
XCTEST_EXTENSION

Public Class Methods

add_groups_for_files(project,files) click to toggle source
# File lib/phoenx/utilities/xcodeproj_utils.rb, line 13
def Phoenx.add_groups_for_files(project,files)
        files.each do |path|
                abort "Missing file ".red + path.bold unless File.exists?(path)
                groups = File.dirname(path).split("/")
                concate = ""
                groups.each do |g|
                        if Phoenx.is_bundle?(g) || Phoenx.is_translation_folder?(g)
                                break
                        end
                        concate +=  g + "/"
                        group_ref = project.main_group.find_subpath(concate, true)
                        group_ref.set_path(g)
                end
        end
end
get_or_add_file(project,file) click to toggle source
# File lib/phoenx/utilities/xcodeproj_utils.rb, line 37
def Phoenx.get_or_add_file(project,file)
        abort "Missing file ".red + path.bold unless File.exists?(file)
        filename = File.basename(file)
        dir = File.dirname(file)
        group = project.main_group.find_subpath(dir, false)
        file_ref = group.find_file_by_path(filename)
        unless file_ref != nil
                file_ref = group.new_file(filename)
        end   
        return file_ref

end
get_or_add_files(project, files) click to toggle source
# File lib/phoenx/utilities/xcodeproj_utils.rb, line 29
def Phoenx.get_or_add_files(project, files)
        resources = Phoenx.merge_files_array(files)
        Phoenx.add_groups_for_files(project, resources)
        resources.each do |source|
                Phoenx.get_or_add_file(project,source)
        end
end
is_bundle?(file) click to toggle source
# File lib/phoenx/utilities/xcodeproj_utils.rb, line 5
def Phoenx.is_bundle?(file)
        return file.include?('xcassets') || file.include?('bundle') || file.include?('playground')
end
is_translation_folder?(file) click to toggle source
# File lib/phoenx/utilities/xcodeproj_utils.rb, line 9
def Phoenx.is_translation_folder?(file)
        return file.include?('lproj')
end
merge_files_array(files, excluded_files = nil) click to toggle source
# File lib/phoenx/utilities/files_utils.rb, line 3
def Phoenx.merge_files_array(files, excluded_files = nil)
        if files == nil
                return nil
        end
        resources = []
        files.each do |source|
                resources.concat Dir[source]
        end
        unless excluded_files == nil
                resources -= merge_files_array(excluded_files)
        end
        return resources
end
set_project_build_settings_defaults(project) click to toggle source
# File lib/phoenx/utilities/xcodeproj_utils.rb, line 56
def Phoenx.set_project_build_settings_defaults(project)
        project.build_configuration_list.build_configurations.each do |config|
                config.build_settings = {}
        end
end
set_target_build_settings_defaults(target) click to toggle source
# File lib/phoenx/utilities/xcodeproj_utils.rb, line 50
def Phoenx.set_target_build_settings_defaults(target)
        target.build_configuration_list.build_configurations.each do |config|
                config.build_settings = {}
        end
end
target_for_name(project,name) click to toggle source
# File lib/phoenx/utilities/xcodeproj_utils.rb, line 62
def Phoenx.target_for_name(project,name)
        project.targets.each do |t|
                if t.name == name
                        return t
                end
        end
        return nil
end