Method: Pod::Command::Bin::Archive#build_dependencies

Defined in:
lib/cocoapods-lhj-bin/command/bin/archive.rb

#build_dependenciesObject


97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/cocoapods-lhj-bin/command/bin/archive.rb', line 97

def build_dependencies
  @build_finshed = true
  #如果没要求,就清空依赖库数据
  sources_sepc = []
  @@missing_binary_specs.uniq.each do |spec|
    next if spec.name.include?('/')
    next if spec.name == @spec.name
    #过滤白名单
    next if CBin::Config::Builder.instance.white_pod_list.include?(spec.name)
    #过滤 git
    if spec.source[:git] && spec.source[:git]
      spec_git = spec.source[:git]
      spec_git_res = false
      CBin::Config::Builder.instance.ignore_git_list.each do |ignore_git|
        spec_git_res = spec_git.include?(ignore_git)
        break if spec_git_res
      end
      next if spec_git_res
    end
    UI.warn "#{spec.name}.podspec 带有 vendored_frameworks 字段,请检查是否有效!!!" if spec.attributes_hash['vendored_frameworks']
    next if spec.attributes_hash['vendored_frameworks'] && @spec.name != spec.name #过滤带有vendored_frameworks的
    next if spec.attributes_hash['ios.vendored_frameworks'] && @spec.name != spec.name #过滤带有vendored_frameworks的
    #获取没有制作二进制版本的spec集合
    sources_sepc << spec
  end

  fail_build_specs = []
  sources_sepc.uniq.each do |spec|
    begin
      builder = CBin::Build::Helper.new(spec,
                                        @platform,
                                        @framework_output,
                                        @zip,
                                        @spec,
                                        false,
                                        @config)
      builder.build
    rescue Object => exception
      UI.puts exception
      fail_build_specs << spec
    end
  end

  if fail_build_specs.any?
    fail_build_specs.uniq.each do |spec|
      UI.warn "#{spec.name} | #{spec.version}】组件二进制版本编译失败 ."
    end
  end
  sources_sepc - fail_build_specs
end