Class: Pod::Command::Binary::Assemble

Inherits:
Pod::Command::Binary show all
Defined in:
lib/cocoapods-tdfire-binary/command/assemble.rb

Instance Method Summary collapse

Methods inherited from Pod::Command::Binary

#binary_config, #first_podspec, #private_sources

Instance Method Details

#runObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/cocoapods-tdfire-binary/command/assemble.rb', line 22

def run
  # 每条命令要重开一个上下文

  run_commands [
                   'pod binary package --clean',
                   'pod binary lint',
                   'pod binary push',
                   'pod binary publish'
               ]
  #
  # system 'pod binary package --clean'
  # system 'pod binary lint'
  # system 'pod binary push'
  # system 'pod binary publish'

  # the sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
  # lint 和 publish 的时候,都会出现这个问题
  #
  # run_command Package, ['--clean']
  # run_command Lint
  # run_command Push
  # run_command Publish
end

#run_command(command_class, argv = []) ⇒ Object



53
54
55
56
57
58
# File 'lib/cocoapods-tdfire-binary/command/assemble.rb', line 53

def run_command(command_class, argv = [])
  lint = command_class::new(CLAide::ARGV.new(argv))
  lint.validate!
  lint.run
  Pod::Tdfire::BinaryStateStore.printed_pods.clear
end

#run_commands(commands) ⇒ Object



46
47
48
49
50
51
# File 'lib/cocoapods-tdfire-binary/command/assemble.rb', line 46

def run_commands(commands)
  commands.each do |c|
    system c
    break if $?.exitstatus != 0
  end
end

#validate!Object



17
18
19
20
# File 'lib/cocoapods-tdfire-binary/command/assemble.rb', line 17

def validate!
  super
  help! "当前目录下找不到有效的 podspec 文件" if first_podspec.nil?
end