Class: Pod::JxedtPrebuildInstaller

Inherits:
Installer
  • Object
show all
Defined in:
lib/cocoapods-jxedt/binary/helper/prebuild_installer.rb

Overview

rubocop:disable Metrics/ClassLength

Instance Method Summary collapse

Methods inherited from Installer

#create_pod_installer, #old_create_pod_installer, #prebuild_pod_names, #prebuilt_pod_targets

Instance Method Details

#generate_pods_index_project!Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/cocoapods-jxedt/binary/helper/prebuild_installer.rb', line 11

def generate_pods_index_project!
    return unless Jxedt.config.create_index_project?
    
    Pod::UI.puts "-----------------------------------------"
    Pod::UI.puts "🚖  正在生成Pods-Index.xcodeproj,可以直接把工程拖入workspace来查看源码或进行二进制调试"
    Pod::UI.puts "-----------------------------------------"

    # 生成index project开始标识
    sandbox.index_project_create_stage = true
      
    # 获取缓存
    cache_analysis_result = analyze_project_cache
    # 获取缓存中需要生成的pod_targets,并拷贝一份新的,不修改原来的值
    pod_targets_to_generate = cache_analysis_result.pod_targets_to_generate.map do |target|
      target_to_copy = target.clone
      target_to_copy.binary_index_enabled = true # 修改标识,用于修改Target的productName
      target_to_copy
    end

    # 调用生成project的方法,aggregate_targets传空数组
    create_and_save_projects(pod_targets_to_generate, [],
                             cache_analysis_result.build_configurations, cache_analysis_result.project_object_version)
    
    # 恢复sandbox标识
    sandbox.index_project_create_stage = false
end

#installation_optionsObject



4
5
6
7
8
9
# File 'lib/cocoapods-jxedt/binary/helper/prebuild_installer.rb', line 4

def installation_options
    # Skip integrating user targets for prebuild Pods project.
    @installation_options ||= Pod::Installer::InstallationOptions.new(
        super.to_h.merge(:integrate_targets => false)
    )
end