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
-
#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
17 18 19 |
# File 'lib/cocoapods/generator/module_map.rb', line 17 def initialize(target) @target = target end |
Instance Attribute Details
#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.
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/cocoapods/generator/module_map.rb', line 39 def generate <<-MODULE_MAP.strip_heredoc framework module #{target.product_module_name} { umbrella header "#{target.umbrella_header_path.basename}" export * module * { export * } } MODULE_MAP end |
#save_as(path) ⇒ void
This method returns an undefined value.
Generates and saves the Info.plist to the given path.
28 29 30 31 32 33 |
# File 'lib/cocoapods/generator/module_map.rb', line 28 def save_as(path) contents = generate path.open('w') do |f| f.write(contents) end end |