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_spec, #create_working_directory_by_spec

Methods included from PodUtil

#build_static_sandbox, #generic_new_podspec_hash, #installation_root, #podfile_from_spec, #spec_with_name, #spec_with_path

Constructor Details

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

Returns a new instance of Frameworker.



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

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

Instance Method Details

#build_framework(spec, work_dir, target_dir) ⇒ Object



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

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



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

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,
    @use_modular_headers
  )

  perform_build(
    sandbox,
    sandbox_installer,
    spec,
    target_dir
  )
end

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

def perform_build platform, sandbox, installer, spec



51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/cocoapods-framework/frameworker.rb', line 51

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



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

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