class Pod::Generator::ModuleMap

Public Instance Methods

generate() click to toggle source
# File lib/cocoapods-xzumbrella/xzmodule.rb, line 4
            def generate
                # target.file_accessors.each {|file| puts"#{target.product_module_name} fileaccessor --> #{file.spec.name}"}
                # currenttarget = target.file_accessors.select {|acces| acces.spec.name == target.product_module_name}
                # puts "plugin target #{target} #{target.product_module_name} #{target.product_name}"
                # if !currenttarget.empty?
                #   puts "my custom modulemap dsl inspect #{currenttarget[0].spec_consumer.umbrellaheader}}"
                # end
                # if target.product_module_name == 'XZAddress'
                #   target.file_accessors.each {|file| puts "fileaccessor --> #{file.spec.name}  #{file.spec_consumer.umbrellaheader}"}
                #   headers[0].path = 'xindi.h'
                # end
               
                umbrella_target = target.file_accessors.select {|file| file.spec_consumer.umbrellaheader && !file.spec_consumer.umbrellaheader.empty?}
                if umbrella_target && !umbrella_target.empty?
                  headers.map do |header|
                    if header.umbrella && header.umbrella
                      header.path = umbrella_target[0].spec_consumer.umbrellaheader
                    end
                  end
                end
                puts "plugin gernerate headers --> #{headers[0].path} -->#{headers[0].umbrella}"
                <<-MODULE_MAP.strip_heredoc
        #{module_specifier_prefix}module #{target.product_module_name}#{module_declaration_attributes} {
          #{headers.join("\n  ")}
        
          export *
          module * { export * }
        }
                MODULE_MAP
              end