Class: HMap::Target::FrameworkEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-hmap/framework/framework_vfs.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration, platform, app_build_dir, project_temp_dir) ⇒ FrameworkEntry

Returns a new instance of FrameworkEntry.



7
8
9
10
11
12
13
14
# File 'lib/cocoapods-hmap/framework/framework_vfs.rb', line 7

def initialize(configuration, platform, app_build_dir, project_temp_dir)
  @configuration = configuration
  @platform = platform
  @app_build_dir = app_build_dir
  @project_temp_dir = project_temp_dir
  @headers_real_paths = []
  @modules_real_paths = []
end

Instance Attribute Details

#app_build_dirObject (readonly)

Returns the value of attribute app_build_dir.



4
5
6
# File 'lib/cocoapods-hmap/framework/framework_vfs.rb', line 4

def app_build_dir
  @app_build_dir
end

#configurationObject (readonly)

Returns the value of attribute configuration.



4
5
6
# File 'lib/cocoapods-hmap/framework/framework_vfs.rb', line 4

def configuration
  @configuration
end

#headers_real_pathsObject

Returns the value of attribute headers_real_paths.



5
6
7
# File 'lib/cocoapods-hmap/framework/framework_vfs.rb', line 5

def headers_real_paths
  @headers_real_paths
end

#modules_real_pathsObject

Returns the value of attribute modules_real_paths.



5
6
7
# File 'lib/cocoapods-hmap/framework/framework_vfs.rb', line 5

def modules_real_paths
  @modules_real_paths
end

#platformObject (readonly)

Returns the value of attribute platform.



4
5
6
# File 'lib/cocoapods-hmap/framework/framework_vfs.rb', line 4

def platform
  @platform
end

#project_temp_dirObject (readonly)

Returns the value of attribute project_temp_dir.



4
5
6
# File 'lib/cocoapods-hmap/framework/framework_vfs.rb', line 4

def project_temp_dir
  @project_temp_dir
end

Class Method Details

.new_entrys_from_configurations_platforms(configurations, platforms, name, framework_name, module_path, headers) ⇒ Object



28
29
30
31
32
33
34
35
36
37
# File 'lib/cocoapods-hmap/framework/framework_vfs.rb', line 28

def self.new_entrys_from_configurations_platforms(configurations, platforms, name, framework_name, module_path, headers)
  effective_platforms = Utils.effective_platforms_names(platforms)
  configurations.flat_map do |configuration|
    effective_platforms.map do |platform|
      entry = new_from_configuration_platform(configuration, platform, name, framework_name)
      entry.add_headers_modules(module_path, framework_name, headers)
      entry
    end
  end
end

.new_from_configuration_platform(configuration, platform, name, framework_name) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/cocoapods-hmap/framework/framework_vfs.rb', line 20

def self.new_from_configuration_platform(configuration, platform, name, framework_name)
  dir = "#{configuration}-#{platform}"
  app_build_dir = File.join(PodsSpecification.instance.app_build_dir, dir, name,
                            "#{framework_name}.framework")
  project_temp_dir = File.join(PodsSpecification.instance.project_temp_dir, dir, "#{name}.build")
  new(configuration, platform, app_build_dir, project_temp_dir)
end

Instance Method Details

#add_headers_modules(module_path, framework_name, headers) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/cocoapods-hmap/framework/framework_vfs.rb', line 39

def add_headers_modules(module_path, framework_name, headers)
  has_private_module = module_path.glob('module*.modulemap').length > 1
  e_headers = ->(path, *names) { names.inject(Pathname(path)) { |e, n| e.join(n) } }
  @headers_real_paths += headers
  @headers_real_paths << e_headers.call(app_build_dir, 'Headers',
                                             "#{framework_name}-Swift.h")
  @modules_real_paths << e_headers.call(project_temp_dir, 'module.modulemap')
  if has_private_module
    @modules_real_paths << e_headers.call(entry.project_temp_dir,
                                               'module.private.modulemap')
  end
end

#framework_moduler_pathObject



16
17
18
# File 'lib/cocoapods-hmap/framework/framework_vfs.rb', line 16

def framework_moduler_path
  File.join(app_build_dir, 'Modules')
end