多个项目target 公用一套cocoapods 写法Podfile写法

platform :ios, ‘9.0’

targetsArray = ['pro1','pro2']

targetsArray.each do |t|
  target t do
    pod 'MJRefresh', '~> 3.1.12'
    pod 'MJExtension', '~> 3.0.13'
  end  
end

更骚的写法:源自网络,出处忘了。。不好意思

platform :ios, ‘9.0’

def testing_pods
  pod 'MJRefresh', '~> 3.1.12'
  pod 'MJExtension', '~> 3.0.13'
  pod 'FMDB', '~> 2.6.2'
  pod 'SDWebImage', '~> 3.8.1'
end


targetsArray = ['pro1','pro2']

targetsArray.each do |t|
  target t do
    testing_pods
  end
end

你可能感兴趣的:(多个项目target 公用一套cocoapods 写法Podfile写法)