# Do not set use_frameworks! globally otherwise the helper
# tool target binary will silently fail to load since it
# doesn't support dynamic frameworks (for security reasons).
# Also probably not a good idea to set any global options
# here at all.

target "Installer" do
  use_frameworks!
  platform :osx, "10.10"
  pod "ObjectiveSugar"
  pod "GBCli"
  pod "Slash"
  pod "MPMessagePack"
  pod "KBKit", :path => "KBKit"
end


target "Status" do
  use_frameworks!
  platform :osx, "10.10"
  pod "ObjectiveSugar"
  pod "GBCli"
  pod "Slash"
  pod "MPMessagePack"
  pod "KBKit", :path => "KBKit"
end

# This runs as a privileged helper so keep dependencies
# here to a minimum.
target "keybase.Helper" do
  platform :osx, "10.10"
  pod "MPMessagePack"
end

# GBCli needs SWIFT_VERSION set
# https://stackoverflow.com/questions/38446097/xcode-8-beta-3-use-legacy-swift-issue
post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name.to_s == "GBCli" then
      puts "Fixing SWIFT_VERSION for #{target}"
      target.build_configurations.each do |config|
        config.build_settings['SWIFT_VERSION'] = '3.0'
      end
    end
  end
end
