Class: Pod::Command::HMapWriter

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ HMapWriter

Returns a new instance of HMapWriter.



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/cocoapods-hmap-prebuilt/command/hmap_writer.rb', line 13

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



30
31
32
33
34
35
36
# File 'lib/cocoapods-hmap-prebuilt/command/hmap_writer.rb', line 30

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-prebuilt setup for hmap.']
  ].concat(super)
end

Instance Method Details

#runObject



38
39
40
41
42
43
# File 'lib/cocoapods-hmap-prebuilt/command/hmap_writer.rb', line 38

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

#validate!Object



25
26
27
28
# File 'lib/cocoapods-hmap-prebuilt/command/hmap_writer.rb', line 25

def validate!
  super
  verify_podfile_exists!
end