source 'https://gitlab.dev.ihuman.com/mobile-public/iHuman-Specs.git'
source 'https://github.com/CocoaPods/Specs.git'

platform :ios,'12.0'
inhibit_all_warnings!
use_frameworks!

project './app/app.xcodeproj'
target 'app' do
  pod 'KTVHTTPCache', '~> 2.0.0'
	pod 'Bugly'
	pod 'iHumanSDK', '5.9.146'
	pod 'iHumanSDK/WeChat'
  pod 'IHASR', :git => 'https://gitlab.dev.ihuman.com/mobile-public/IHASR-iOS', :tag => '1.0.0-rc.7'
  pod 'IHTTS', :git => 'https://gitlab.dev.ihuman.com/mobile-public/IHTTS-iOS', :tag => '1.0.1-rc.6'
  pod 'SpeechEvalSDK/Chinese', :git => 'https://gitlab.dev.ihuman.com/mobile-public/SpeechEvalSDK-iOS', :tag => '1.9.73_rc.8'
end

post_install do |installer|
    installer.generated_projects.each do |project|
          project.targets.each do |target|
              target.build_configurations.each do |config|
                  config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
               end
          end
   end
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|

        # 解决部分第三方库需要CODE_SIGNING的问题
        config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
        config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
        config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
        #        fix for googlemlkit
        #        xcconfig_path = config.base_configuration_reference.real_path
        #        xcconfig = File.read(xcconfig_path)
        #        xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
        #        File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
        if target.name == 'iHumanPermission'
          target.build_configurations.each do |config|
            # 为Debug和Release配置添加宏定义
            config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
            config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'USE_BLUETOOTH_PERMISSION=1'
          end
        end

      end
    end
end
