xref: /expo/apps/native-tests/ios/Podfile (revision ba115a22)
1require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
2require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
3require File.join(File.dirname(`node --print "require.resolve('@react-native-community/cli-platform-ios/package.json')"`), "native_modules")
4
5require 'json'
6podfile_properties = JSON.parse(File.read('./Podfile.properties.json')) rescue {}
7
8prepare_react_native_project!
9
10# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
11# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
12#
13# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
14# ```js
15# module.exports = {
16#   dependencies: {
17#     ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
18# ```
19flipper_config = ENV['NO_FLIPPER'] == "1" || ENV['CI'] ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
20
21platform :ios, podfile_properties['ios.deploymentTarget'] || '13.0'
22install! 'cocoapods',
23  :deterministic_uuids => false
24
25target 'NativeTests' do
26  # add this manually, because it has UITests too
27  pod 'expo-dev-menu', path: '../../../packages/expo-dev-menu', :testspecs => ['Tests', 'UITests']
28
29  use_expo_modules_tests!
30
31  pod 'ExpoModulesTestCore', :path => "../../../packages/expo-modules-test-core/ios"
32  pod 'Nimble', :podspec => './../../../ios/Nimble.podspec'
33
34  config = use_native_modules!
35
36  use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
37
38  # Flags change depending on the env values.
39  flags = get_default_flags()
40
41  use_react_native!(
42    :path => config[:reactNativePath],
43    :hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
44    :fabric_enabled => flags[:fabric_enabled],
45    # An absolute path to your application root.
46    :app_path => "#{Pod::Config.instance.installation_root}/..",
47    #
48    # Uncomment to opt-in to using Flipper
49    # Note that if you have use_frameworks! enabled, Flipper will not work
50    # :flipper_configuration => flipper_config,
51  )
52
53  post_install do |installer|
54    react_native_post_install(
55      installer,
56      config[:reactNativePath],
57      # Set `mac_catalyst_enabled` to `true` in order to apply patches
58      # necessary for Mac Catalyst builds
59      :mac_catalyst_enabled => false
60    )
61    __apply_Xcode_12_5_M1_post_install_workaround(installer)
62  end
63
64  post_integrate do |installer|
65    begin
66      expo_patch_react_imports!(installer)
67    rescue => e
68      Pod::UI.warn e
69    end
70  end
71
72end
73