source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
#inhibit_all_warnings!

def network_pods
  pod 'RxSwift'
  pod 'RxCocoa'
  pod 'RxDataSources'
  
  pod 'GRDB.swift'
  pod 'HandyJSON'
  pod 'Alamofire'
  pod 'SSZipArchive'
  pod 'iOSDFULibrary'
  
  pod 'MJRefresh'
  pod 'Charts'
  pod 'IQKeyboardManagerSwift'
  #pod 'TDAppMonitorKit'
end

def local_pods
  pod 'NEUtils',        :path => 'LocalLib/NEUtils'
  pod 'BandKit',        :path => 'LocalLib/BandKit'
  pod 'YFitKit',        :path => 'LocalLib/YFitKit'
  pod 'Repeater',       :path => 'LocalLib/Repeater'
  pod 'RxBluetoothKit', :path => 'LocalLib/RxBluetoothKit'

  pod 'Toast',        :path => 'LocalLib/Toast'
  pod 'SnapKit',      :path => 'LocalLib/SnapKit'
  pod 'TableViewManager',     :path => 'LocalLib/TableViewManager'
  pod 'NavigationExtension',  :path => 'LocalLib/NavigationExtension'
  pod 'FSCalendar',           :path => 'LocalLib/FSCalendar'
  pod 'FileBrowser',          :path => 'LocalLib/FileBrowser'
  pod 'PerformanceMonitor',          :path => 'LocalLib/PerformanceMonitor'

end


# 所有target
targets = ['CTFit']
targets.each do |t|
    target t do
        project 'CTFit/CTFit.xcodeproj'
        network_pods
        local_pods
    end
end


# build setting 配置
post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '5.0'
      config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
      if target.name == 'BandKit' or target.name == 'YFitKit'
        config.build_settings['OTHER_SWIFT_FLAGS'] = ['$(inherited)','-D','COCOAPODS','-D','HEALTHEANBLE']
      end
    end
  end
end
