Method: Pod::Command::Bin::Auto#run

Defined in:
lib/cocoapods-tj/command/bin/auto.rb

#runObject



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/cocoapods-tj/command/bin/auto.rb', line 49

def run

  unless @podspec
    raise Informative, "未找到 podspec文件"
  end
  sources_sepc = run_archive

  fail_push_specs = []
  sources_sepc.uniq.each do |spec|
    begin
      fail_push_specs << spec unless CBin::Upload::Helper.new(spec,@code_dependencies,@sources).upload
    rescue  Object => exception
      UI.puts exception
      fail_push_specs << spec
    end
  end

  if fail_push_specs.any?
    fail_push_specs.uniq.each do |spec|
      UI.warn "【#{spec.name} | #{spec.version}】组件spec push失败 ."
    end
  end

  success_specs = sources_sepc - fail_push_specs
  if success_specs.any?
    auto_success = ""
    success_specs.uniq.each do |spec|
      auto_success += "#{spec.name} | #{spec.version}\n"
    end
    puts auto_success
    ENV['auto_success'] = auto_success
  end
  UI.section("\nUpdating Spec Repositories\n".yellow) do
    Pod::Command::Bin::Repo::Update.new(CLAide::ARGV.new([])).run
  end

end