Class: Pod::Generator::ModuleMap
- Inherits:
-
Object
- Object
- Pod::Generator::ModuleMap
- Defined in:
- lib/cocoapods/generator/module_map.rb
Overview
Generates LLVM module map files. A module map file is generated for each Pod and for each Pod target definition that is built as a framework. It specifies a different umbrella header than usual to avoid name conflicts with existing headers of the podspec.
Instance Attribute Summary collapse
-
#private_headers ⇒ Array<#to_s>
The private headers of the module.
-
#target ⇒ PodTarget
readonly
The target represented by this Info.plist.
Instance Method Summary collapse
-
#generate ⇒ String
Generates the contents of the module.modulemap file.
-
#initialize(target) ⇒ ModuleMap
constructor
Initialize a new instance.
-
#save_as(path) ⇒ void
Generates and saves the Info.plist to the given path.
Constructor Details
#initialize(target) ⇒ ModuleMap
Initialize a new instance
21 22 23 24 |
# File 'lib/cocoapods/generator/module_map.rb', line 21 def initialize(target) @target = target @private_headers = [] end |
Instance Attribute Details
#private_headers ⇒ Array<#to_s>
Returns the private headers of the module.
15 16 17 |
# File 'lib/cocoapods/generator/module_map.rb', line 15 def private_headers @private_headers end |
#target ⇒ PodTarget (readonly)
Returns the target represented by this Info.plist.
11 12 13 |
# File 'lib/cocoapods/generator/module_map.rb', line 11 def target @target end |
Instance Method Details
#generate ⇒ String
Generates the contents of the module.modulemap file.
44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/cocoapods/generator/module_map.rb', line 44 def generate result = <<-eos.strip_heredoc framework module #{target.product_module_name} { umbrella header "#{target.umbrella_header_path.basename}" export * module * { export * } eos result << "\n#{generate_private_header_exports}" unless private_headers.empty? result << "}\n" end |
#save_as(path) ⇒ void
This method returns an undefined value.
Generates and saves the Info.plist to the given path.
33 34 35 36 37 38 |
# File 'lib/cocoapods/generator/module_map.rb', line 33 def save_as(path) contents = generate path.open('w') do |f| f.write(contents) end end |