Class: Pod::Frameworker
- Inherits:
-
Object
- Object
- Pod::Frameworker
- Defined in:
- lib/cocoapods-xcframework/frameworker.rb
Instance Method Summary collapse
- #build_framework(spec, work_dir, target_dir) ⇒ Object
- #build_in_sandbox(work_dir, spec, target_dir) ⇒ Object
-
#initialize(name, source, spec_sources, subspecs, configuration, force, use_modular_headers = true, enable_bitcode = false, symbols = true, support_maccatalyst = true, support_dynamic = false) ⇒ Frameworker
constructor
A new instance of Frameworker.
-
#perform_build(sandbox, installer, spec, target_dir) ⇒ Object
def perform_build platform, sandbox, installer, spec.
- #run ⇒ Object
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_bundle_file, #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 = true, enable_bitcode = false, symbols = true, support_maccatalyst = true, support_dynamic = false) ⇒ Frameworker
Returns a new instance of Frameworker.
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/cocoapods-xcframework/frameworker.rb', line 6 def initialize(name, source, spec_sources, subspecs, configuration, force, use_modular_headers=true, enable_bitcode=false, symbols=true, support_maccatalyst=true, support_dynamic=false) @name = name @source = source @spec_sources = spec_sources @subspecs = subspecs @configuration = configuration @force = force @use_modular_headers = use_modular_headers @enable_bitcode = enable_bitcode @symbols = symbols @support_maccatalyst = support_maccatalyst @support_dynamic = support_dynamic end |
Instance Method Details
#build_framework(spec, work_dir, target_dir) ⇒ Object
30 31 32 |
# File 'lib/cocoapods-xcframework/frameworker.rb', line 30 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
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/cocoapods-xcframework/frameworker.rb', line 34 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, @support_dynamic ) perform_build( sandbox, sandbox_installer, spec, target_dir ) end |
#perform_build(sandbox, installer, spec, target_dir) ⇒ Object
def perform_build platform, sandbox, installer, spec
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/cocoapods-xcframework/frameworker.rb', line 59 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, @symbols, @support_maccatalyst ) builder.build builder.outputs target_dir target_dir end |
#run ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/cocoapods-xcframework/frameworker.rb', line 20 def run spec = spec_with_path @name UI.puts "正在生成XCFramework #{spec.name}(#{spec.version})".yellow @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 |