Class: ProjectGen::XcframeworkGen

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-project-gen/gen/xcframework_gen.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_gen) ⇒ XcframeworkGen

Initialize a new instance

Parameters:

  • project_gen (ProjectGenerator)

    Creates the target for the Pods libraries in the Pods project and the relative support files.



17
18
19
# File 'lib/cocoapods-project-gen/gen/xcframework_gen.rb', line 17

def initialize(project_gen)
  @project_gen = project_gen
end

Class Method Details

.new_from_project_gen(project_gen) ⇒ Object



7
8
9
# File 'lib/cocoapods-project-gen/gen/xcframework_gen.rb', line 7

def self.new_from_project_gen(project_gen)
  new(project_gen)
end

Instance Method Details

#generate_xcframework(work_dir, configuration = nil, build: true, build_library_for_distribution: false) ⇒ Object

Initialize a new instance

Parameters:

  • work_dir (<Pathname, String>)

    the temporary directory used by the Generator.

  • The (Symbol)

    name of the build configuration.

  • Build (Bool)

    xcframework.



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/cocoapods-project-gen/gen/xcframework_gen.rb', line 30

def generate_xcframework(work_dir, configuration = nil, build: true, build_library_for_distribution: false)
  app_root = Pathname.new(work_dir).expand_path
  o_value = nil
  @project_gen.generate!(app_root) do |platforms, pod_targets, no_clean, fail_fast|
    if build
      bm = BuildManager.new(app_root, no_clean: no_clean, fail_fast: fail_fast)
      o_value = bm.create_xcframework_products!(platforms, pod_targets, configuration, build_library_for_distribution: build_library_for_distribution)
    else
      o_value = pod_targets
    end
  end
  o_value
end