require_relative '../node_modules/react-native-macos/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'latestRNmacOSHermesApp-macOS' do
  platform :macos, '10.14'
  use_native_modules!
  use_react_native!(
    :path => '../node_modules/react-native-macos',

    # To use Hermes, install the `hermes-engine-darwin` npm package, e.g.:
    #   $ yarn add 'hermes-engine-darwin@~0.5.3'
    #
    # Then enable this option:
    :hermes_enabled => true
  )

  # Pods specifically for macOS target
end

target 'latestRNmacOSHermesApp-iOS' do
  platform :ios, '10'
  use_native_modules!
  use_react_native!(:path => '../node_modules/react-native-macos')

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  use_flipper!({ 'Flipper' => '0.87' })
  post_install do |installer|
    flipper_post_install(installer)

    find_and_replace("Pods/Headers/Private/RCT-Folly/folly/synchronization/DistributedMutex-inl.h",
    "atomic_notify_one(state)", "folly::atomic_notify_one(state)")

    find_and_replace("Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h",
    "atomic_wait_until(&state, previous | data, deadline)", "folly::atomic_wait_until(&state, previous | data, deadline)")
  end

  # Pods specifically for iOS target
end
