xref: /expo/ios/Podfile (revision 58fb4e57)
1require_relative './podfile_helpers.rb'
2require_relative '../react-native-lab/react-native/scripts/react_native_pods'
3require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
4
5install! 'cocoapods',
6         :generate_multiple_pod_projects => true,
7         :incremental_installation => true
8platform :ios, '13.0'
9inhibit_all_warnings!
10
11# Disable expo-updates auto create manifest in podspec script_phase
12$expo_updates_create_manifest = false
13
14abstract_target 'Expo Go' do
15  pod 'CocoaLumberjack', '~> 3.5.3'
16  pod 'GoogleMaps', '~> 7.3.0'
17  pod 'Google-Maps-iOS-Utils', :git => 'https://github.com/googlemaps/google-maps-ios-utils.git'
18  pod 'JKBigInteger', :podspec => 'vendored/common/JKBigInteger.podspec.json'
19  pod 'MBProgressHUD', '~> 1.2.0'
20
21  # Required by firebase core versions 9.x / 10.x (included with SDK 47)
22  # See https://github.com/invertase/react-native-firebase/issues/6332#issuecomment-1189734581
23  pod 'FirebaseCore', :modular_headers => true
24  pod 'GoogleUtilities', :modular_headers => true
25
26  # Expo modules
27  use_expo_modules!({
28    exclude: [
29      'expo-module-template',
30      'expo-module-template-local',
31      'expo-in-app-purchases',
32      'expo-dev-menu',
33      'expo-dev-menu-interface',
34      'expo-dev-launcher',
35      'expo-dev-client',
36      'expo-maps',
37      'expo-insights',
38      'expo-face-detector',
39    ],
40    includeTests: true,
41    flags: {
42      :inhibit_warnings => false
43    }
44  })
45
46  # Install vendored pods.
47  use_pods! 'vendored/unversioned/**/*.podspec.json'
48
49  # Unversioned React Native
50  use_react_native!(
51    :path => '../react-native-lab/react-native',
52    :hermes_enabled => true,
53    :fabric_enabled => false,
54  )
55  setup_jsc!(
56    :react_native_path => '../react-native-lab/react-native',
57    :fabric_enabled => false,
58  )
59
60  # Build React Native with RCT_DEV enabled and RCT_ENABLE_INSPECTOR and
61  # RCT_ENABLE_PACKAGER_CONNECTION disabled
62  post_install do |installer|
63    # Workaround build error for Folly
64    __apply_Xcode_12_5_M1_post_install_workaround(installer) if installer.pods_project
65
66    # Disabled as of CocoaPods 1.8.0.beta1 since pods_project seems to be nil
67    # installer.pods_project.main_group.tab_width = '2';
68    # installer.pods_project.main_group.indent_width = '2';
69
70    installer.target_installation_results.pod_target_installation_results
71      .each do |pod_name, target_installation_result|
72
73      # Run postinstalls actions for versioned dependencies.
74      # These actions are specified in `versioned-react-native/ABI*/postinstalls.rb` files.
75      run_versioned_postinstalls!(pod_name, target_installation_result)
76
77      # This is necessary for Xcode 14 that by default signs resource bundles when building for the device.
78      target_installation_result.resource_bundle_targets.each do |resource_bundle_target|
79        resource_bundle_target.build_configurations.each do |config|
80          config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
81        end
82      end
83
84      target_installation_result.native_target.build_configurations.each do |config|
85        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
86
87      end
88
89      if pod_name == 'Branch'
90        target_installation_result.native_target.build_configurations.each do |config|
91          config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
92          config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'BRANCH_EXCLUDE_IDFA_CODE=1'
93        end
94      end
95
96      # On iOS, the Stripe dependency StripePaymentsUI can't seem to find a header that should be there.
97      if pod_name == 'StripePaymentsUI'
98        target_installation_result.native_target.build_configurations.each do |config|
99          config.build_settings['HEADER_SEARCH_PATHS'] ||= ['$(inherited)']
100          config.build_settings['HEADER_SEARCH_PATHS'] << '"$(PODS_ROOT)/Headers/Public/StripePayments"'
101        end
102      end
103
104      if pod_name.end_with?('EXUpdates')
105        target_installation_result.native_target.build_configurations.each do |config|
106          config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
107          config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'SUPPRESS_EXPO_UPDATES_SERVICE=1'
108        end
109      end
110
111      # Build React Native with RCT_DEV enabled and RCT_ENABLE_INSPECTOR and
112      # RCT_ENABLE_PACKAGER_CONNECTION disabled
113      next unless pod_name.start_with?('React')
114      target_installation_result.native_target.build_configurations.each do |config|
115        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
116        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'RCT_DEV=1'
117        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'RCT_ENABLE_INSPECTOR=0'
118        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION=0'
119      end
120    end
121  end
122
123  # Target for development, contains only unversioned code
124  target 'Expo Go (unversioned)' do
125  end
126
127  # Release target additionally includes versioned SDKs
128  target 'Expo Go (versioned)' do
129    # Evaluate all files matching `versioned-react-native/ABI*/dependencies.rb` glob pattern
130    # and install ReactABIXX_0_0 pods with all versioned unimodules.
131    use_versioned_abis!
132  end
133
134  # Test targets
135  target 'ExponentIntegrationTests' do
136    inherit! :search_paths
137  end
138
139  target 'Tests' do
140    # `ExpoModulesTestCore` has implicit dependency to `React-Core` which has a resource bundle.
141    # To prevent CocoaPods generating new `React-Core` resource bundle and the strange `React-Core-60309c9c` target,
142    # this test target should inherit all properties from parents.
143    inherit! :complete
144
145    pod 'ExpoModulesTestCore', :path => "../packages/expo-modules-test-core/ios"
146    pod 'Nimble', :podspec => './Nimble.podspec'
147  end
148end
149