Module: Pod::Podfile::DSL

Defined in:
lib/cocoapods-tdfire-binary/podfile_dsl.rb

Instance Method Summary collapse

Instance Method Details

#tdfire_external_pods(pods, *rest) ⇒ Object

外源组件依赖



37
38
39
40
41
42
43
44
45
46
47
48
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
# File 'lib/cocoapods-tdfire-binary/podfile_dsl.rb', line 37

def tdfire_external_pods(pods, *rest)
	argvs = rest.last || {}
  if !argvs.kind_of?(Hash)
    info =  <<-EOF
      输入参数错误.

      Example:
        tdfire_external_pods ['TDFCore'], source:'git', group:'ios', branch:'develop'
        tdfire_external_pods 'TDFCore', source:'git', group:'ios', branch:'develop'
        tdfire_external_pods ['TDFCore'], group:'cocoapods' 
        ...

      默认值:
        source:path
        group:ios
        branch:develop

      所有值:
        source -> git path
        group -> 任意
        branch -> 任意

      格式可以和pod语法一致
    EOF
    raise Pod::Informative, info
  end

  UI.puts argvs
  source = argvs[:source] || 'git'
  group = argvs[:group] || 'ios'
  branch = argvs[:branch] || 'develop'

  case source
    when 'path'
    Array(pods).each do |name|
        if File.exist?("../../#{name}/#{name}.podspec")
          pod name, :path => "../../#{name}"
        else
          pod name, :path => "../#{name}"
        end
    end
    when 'git'
    Array(pods).each do |name|
        pod name, :git => "[email protected]:#{group}/#{name}.git", :branch => "#{branch}"
    end
    else
  end
end

#tdfire_use_binary!Object

使用二进制依赖



14
15
16
# File 'lib/cocoapods-tdfire-binary/podfile_dsl.rb', line 14

def tdfire_use_binary!
  Pod::Tdfire::BinaryStateStore.set_use_binary
end

#tdfire_use_source_pods(pods) ⇒ Object

使用源码依赖的pod



8
9
10
11
# File 'lib/cocoapods-tdfire-binary/podfile_dsl.rb', line 8

def tdfire_use_source_pods(pods)
  Pod::UI.puts "Tdfire: set use source pods: #{Array(pods).join(', ')}"
  Pod::Tdfire::BinaryStateStore.use_source_pods = Array(pods)
end