Class: HMap::Target::FrameworkEntry

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

Overview

Each fremaework vfs informations

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.



10
11
12
13
14
15
16
17
# File 'lib/hmap/framework/framework_vfs.rb', line 10

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.



7
8
9
# File 'lib/hmap/framework/framework_vfs.rb', line 7

def app_build_dir
  @app_build_dir
end

#configurationObject (readonly)

Returns the value of attribute configuration.



7
8
9
# File 'lib/hmap/framework/framework_vfs.rb', line 7

def configuration
  @configuration
end

#headers_real_pathsObject

Returns the value of attribute headers_real_paths.



8
9
10
# File 'lib/hmap/framework/framework_vfs.rb', line 8

def headers_real_paths
  @headers_real_paths
end

#modules_real_pathsObject

Returns the value of attribute modules_real_paths.



8
9
10
# File 'lib/hmap/framework/framework_vfs.rb', line 8

def modules_real_paths
  @modules_real_paths
end

#platformObject (readonly)

Returns the value of attribute platform.



7
8
9
# File 'lib/hmap/framework/framework_vfs.rb', line 7

def platform
  @platform
end

#project_temp_dirObject (readonly)

Returns the value of attribute project_temp_dir.



7
8
9
# File 'lib/hmap/framework/framework_vfs.rb', line 7

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



31
32
33
34
35
36
37
38
39
40
# File 'lib/hmap/framework/framework_vfs.rb', line 31

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



23
24
25
26
27
28
29
# File 'lib/hmap/framework/framework_vfs.rb', line 23

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



42
43
44
45
46
47
48
49
50
51
# File 'lib/hmap/framework/framework_vfs.rb', line 42

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')
  return unless has_private_module

  @modules_real_paths << e_headers.call(entry.project_temp_dir, 'module.private.modulemap')
end

#framework_moduler_pathObject



19
20
21
# File 'lib/hmap/framework/framework_vfs.rb', line 19

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