Class: Pod::MutiFrameworker

Inherits:
Object
  • Object
show all
Includes:
Config::Mixin, DirUtil, GitUtil, PodUtil
Defined in:
lib/cocoapods-framework/muti_frameworker.rb

Instance Method Summary collapse

Methods included from DirUtil

#create_target_directory_path_by_name, #create_target_directory_path_by_spec, #create_working_directory_by_name, #create_working_directory_by_spec

Methods included from GitUtil

#prepare_git_with_configs

Methods included from PodUtil

#build_static_sandbox, #fix_header_file, #generic_new_podspec_hash, #installation_root, #installation_root_muti, #muti_config_with_file, #podfile_from_muti_configs, #podfile_from_spec, #spec_with_name, #spec_with_path, #to_native_platform

Constructor Details

#initialize(name, source, spec_sources, configuration, force, use_modular_headers) ⇒ MutiFrameworker

Returns a new instance of MutiFrameworker.



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

def initialize(name, source, spec_sources, configuration, force, use_modular_headers)
  @name = name
  @source = source
  @spec_sources = spec_sources
  @configuration = configuration
  @force = force
  @use_modular_headers = use_modular_headers
end

Instance Method Details

#build_frameworks(configs, work_dir, target_dir) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/cocoapods-framework/muti_frameworker.rb', line 23

def build_frameworks configs, work_dir, target_dir
    config.installation_root = Pathname.new work_dir
    config.sandbox_root = "#{work_dir}/Pods"
    sandbox = build_static_sandbox

    sandbox_installer = installation_root_muti(
      sandbox,
      configs,
      @spec_sources,
      @use_modular_headers
    )
    perform_build(
      sandbox,
      sandbox_installer,
      configs,
      target_dir
    )
end

#perform_build(sandbox, installer, configs, target_dir) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/cocoapods-framework/muti_frameworker.rb', line 42

def perform_build sandbox, installer, configs, target_dir
  sandbox_root = config.sandbox_root.to_s
  builder = Pod::XBuilder.new(
    installer,
    Dir.pwd,
    sandbox_root,
    configs,
    @configuration
  )
  builder.build
  builder.outputs_muti target_dir
end

#runObject



16
17
18
19
20
21
# File 'lib/cocoapods-framework/muti_frameworker.rb', line 16

def run
  configs = muti_config_with_file @name
  target_dir, work_dir = create_working_directory_by_spec "xcframeworks", @force
  prepare_git_with_configs configs, work_dir
  build_frameworks configs, work_dir, target_dir
end