Class: Pod::Command::HMapGen

Inherits:
Pod::Command show all
Defined in:
lib/cocoapods-hmap/command/hmap_gen.rb

Overview

hmap file gen cmd

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ HMapGen

Returns a new instance of HMapGen.



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/cocoapods-hmap/command/hmap_gen.rb', line 17

def initialize(argv)
  super
  project_directory = argv.option('project-directory')
  @save_origin_header_search_paths = !argv.flag?('nosave-origin-header-search-paths', false)
  @clean_hmap = argv.flag?('clean-hmap', false)

  return if project_directory.nil?

  @project_directory = Pathname.new(project_directory).expand_path
  config.installation_root = @project_directory
end

Class Method Details

.optionsObject

help



35
36
37
38
39
40
41
42
# File 'lib/cocoapods-hmap/command/hmap_gen.rb', line 35

def self.options
  [
    ['--project-directory=/project/dir/', 'The path to the root of the project
      directory'],
    ['--nosave-origin-header-search-paths', 'This option will not save xcconfig origin [HEADER_SEARCH_PATHS] and put hmap file first'],
    ['--clean-hmap', 'This option will clean up all hmap-gen setup for hmap.']
  ].concat(super)
end

Instance Method Details

#runObject



44
45
46
47
48
49
# File 'lib/cocoapods-hmap/command/hmap_gen.rb', line 44

def run
  UI.section "\n[hmap-gen] start.............." do
    HMap::MapFileWriter.new(@save_origin_header_search_paths, @clean_hmap)
  end
  UI.puts('[hmap-gen] finish..............')
end

#validate!Object



29
30
31
32
# File 'lib/cocoapods-hmap/command/hmap_gen.rb', line 29

def validate!
  super
  verify_podfile_exists!
end