class StructCore::Processor::TargetLocalFrameworkReferenceComponent

Public Instance Methods

process(ref, target_dsl = nil, group_dsl = nil, embed_dsl = nil) click to toggle source
# File lib/spec/processor/target_local_framework_reference.rb, line 8
def process(ref, target_dsl = nil, group_dsl = nil, embed_dsl = nil)
        output = nil

        output = process_xc_ref ref if structure == :spec
        output = process_spec_ref ref, target_dsl, group_dsl, embed_dsl if structure == :xcodeproj && !target_dsl.nil? && !group_dsl.nil? && !embed_dsl.nil?

        output
end
process_spec_ref(ref, target_dsl, group_dsl, embed_dsl) click to toggle source

@param ref [StructCore::Specfile::Target::LocalFrameworkReference] @param target_dsl [Xcodeproj::Project::Object::PBXNativeTarget] @param group_dsl [Xcodeproj::Project::Object::PBXGroup] @param embed_dsl [Xcodeproj::Project::Object::AbstractBuildPhase]

# File lib/spec/processor/target_local_framework_reference.rb, line 26
def process_spec_ref(ref, target_dsl, group_dsl, embed_dsl)
        framework = group_dsl.new_file ref.framework_path

        # Link
        target_dsl.frameworks_build_phase.add_file_reference framework

        # Embed
        settings = ref.settings || {}
        return unless settings.key?('copy') && settings['copy'] == true

        attributes = ['RemoveHeadersOnCopy']
        attributes.push 'CodeSignOnCopy' if settings.key?('codeSignOnCopy') && settings['codeSignOnCopy'] == true

        (embed_dsl.add_file_reference framework).settings = { 'ATTRIBUTES' => attributes }
end
process_xc_ref(ref) click to toggle source

@param ref [Xcodeproj::Project::Object::PBXFileReference]

# File lib/spec/processor/target_local_framework_reference.rb, line 18
def process_xc_ref(ref)
        StructCore::Specfile::Target::LocalFrameworkReference.new(ref.path, nil)
end