source 'https://github.com/CocoaPods/Specs.git'
source 'http://172.16.6.11:8050/Component/VVComponentSpec.git'

platform :ios, '10.0'
use_modular_headers!

def rn_pod
  
  rn_path = '../node_modules/react-native'
    
  pod 'FBLazyVector', :path => "#{rn_path}/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "#{rn_path}/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "#{rn_path}/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "#{rn_path}/Libraries/TypeSafety"
  pod 'React', :path => "#{rn_path}/"
  pod 'React-Core', :path => "#{rn_path}/"
  pod 'React-CoreModules', :path => "#{rn_path}/React/CoreModules"
  pod 'React-Core/DevSupport', :path => "#{rn_path}/"
  pod 'React-RCTActionSheet', :path => "#{rn_path}/Libraries/ActionSheetIOS"
  pod 'React-RCTAnimation', :path => "#{rn_path}/Libraries/NativeAnimation"
  pod 'React-RCTBlob', :path => "#{rn_path}/Libraries/Blob"
  pod 'React-RCTImage', :path => "#{rn_path}/Libraries/Image"
  pod 'React-RCTLinking', :path => "#{rn_path}/Libraries/LinkingIOS"
  pod 'React-RCTNetwork', :path => "#{rn_path}/Libraries/Network"
  pod 'React-RCTSettings', :path => "#{rn_path}/Libraries/Settings"
  pod 'React-RCTText', :path => "#{rn_path}/Libraries/Text"
  pod 'React-RCTVibration', :path => "#{rn_path}/Libraries/Vibration"
  pod 'React-Core/RCTWebSocket', :path => "#{rn_path}/"
  pod 'React-cxxreact', :path => "#{rn_path}/ReactCommon/cxxreact"
  pod 'React-jsi', :path => "#{rn_path}/ReactCommon/jsi"
  pod 'React-jsiexecutor', :path => "#{rn_path}/ReactCommon/jsiexecutor"
  pod 'React-jsinspector', :path => "#{rn_path}/ReactCommon/jsinspector"
  pod 'ReactCommon/callinvoker', :path => "#{rn_path}/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "#{rn_path}/ReactCommon"
  pod 'Yoga', :path => "#{rn_path}/ReactCommon/yoga", :modular_headers => true

  pod 'DoubleConversion', :podspec => "#{rn_path}/third-party-podspecs/DoubleConversion.podspec"
  pod 'glog', :podspec => "#{rn_path}/third-party-podspecs/glog.podspec"
  pod 'Folly', :podspec => "#{rn_path}/third-party-podspecs/Folly.podspec"
  pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage'
    
  pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
  
  pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
  pod 'react-native-spinkit', :path => '../node_modules/react-native-spinkit'
  pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker'
  pod 'react-native-viewpager', :path => '../node_modules/@react-native-community/viewpager'
  pod 'RNCClipboard', :path => '../node_modules/@react-native-community/clipboard'
  pod 'RNImageCropPicker', :path => "../node_modules/react-native-image-crop-picker"
  pod 'react-native-view-shot', :path => "../node_modules/react-native-view-shot"
  pod 'RNScreens', :path => "../node_modules/react-native-screens"
  pod 'RNSound', :path => "../node_modules/react-native-sound"

  pod 'DoubleConversion', :podspec => "#{rn_path}/third-party-podspecs/DoubleConversion.podspec", :modular_headers => false
  pod 'glog', :podspec => "#{rn_path}/third-party-podspecs/glog.podspec", :modular_headers => false
  pod 'Folly', :podspec => "#{rn_path}/third-party-podspecs/Folly.podspec", :modular_headers => false
end

target 'VVRNBaseModule' do
  rn_pod

  pod 'VVRNBaseModule', :path => '../'

  target 'VVRNBaseModuleTests' do
    inherit! :complete
    # Pods for testing
  end

  post_install do |installer|
    installer.pods_project.targets.each do |target|
        compatibilityPhase = target.build_phases.find { |ph| ph.display_name == 'Copy generated compatibility header' }
        if compatibilityPhase
            build_phase = target.new_shell_script_build_phase('Copy Swift Generated Header')
            build_phase.shell_script = <<-SH.strip_heredoc
                COMPATIBILITY_HEADER_PATH="${BUILT_PRODUCTS_DIR}/Swift Compatibility Header/${PRODUCT_MODULE_NAME}-Swift.h"
                ditto "${COMPATIBILITY_HEADER_PATH}" "${PODS_ROOT}/Headers/Public/${PRODUCT_MODULE_NAME}/${PRODUCT_MODULE_NAME}-Swift.h"
            SH
        end
  end
  end
end
