Class: Pod::Frameworker

Inherits:
Object
  • Object
show all
Includes:
Config::Mixin, DirUtil, PodUtil
Defined in:
lib/cocoapods-framework/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 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, subspecs, configuration, force, use_modular_headers, enable_bitcode) ⇒ Frameworker

Returns a new instance of Frameworker.



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

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

Instance Method Details

#build_framework(spec, work_dir, target_dir) ⇒ Object



26
27
28
# File 'lib/cocoapods-framework/frameworker.rb', line 26

def build_framework spec, work_dir, target_dir
  build_in_sandbox(work_dir, spec, target_dir)
end

#build_in_sandbox(work_dir, spec, target_dir) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/cocoapods-framework/frameworker.rb', line 30

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

  sandbox_installer = installation_root(
    sandbox,
    spec,
    @subspecs,
    @spec_sources,
    true,
    @use_modular_headers,
    @enable_bitcode
  )

  perform_build(
    sandbox,
    sandbox_installer,
    spec,
    target_dir
  )
end

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

def perform_build platform, sandbox, installer, spec



54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/cocoapods-framework/frameworker.rb', line 54

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

#runObject



17
18
19
20
21
22
23
24
# File 'lib/cocoapods-framework/frameworker.rb', line 17

def run
  spec = spec_with_path @name
  @is_spec_from_path = true if spec
  spec ||= spec_with_name @name

  target_dir, work_dir = create_working_directory_by_spec spec, @force
  build_framework spec, work_dir, target_dir
end