xref: /expo/ios/Podfile (revision 9eae8a6a)
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  # Expo Client dependencies
16  pod 'Amplitude'
17  pod 'CocoaLumberjack', '~> 3.5.3'
18  pod 'GoogleMaps', '~> 3.6'
19  pod 'Google-Maps-iOS-Utils', '~> 2.1.0'
20  pod 'JKBigInteger', :podspec => 'vendored/common/JKBigInteger.podspec.json'
21  pod 'MBProgressHUD', '~> 1.2.0'
22
23  # Required by latest firebase versions
24  # See https://github.com/invertase/react-native-firebase/issues/6332#issuecomment-1189734581
25  pod 'FirebaseCore', :modular_headers => true
26  pod 'GoogleUtilities', :modular_headers => true
27
28  # Expo modules
29  use_expo_modules!({
30    exclude: [
31      'expo-module-template',
32      'expo-in-app-purchases',
33      'expo-dev-menu',
34      'expo-dev-menu-interface',
35      'expo-dev-launcher',
36      'expo-dev-client',
37    ],
38    includeTests: true,
39    flags: {
40      :inhibit_warnings => false
41    }
42  })
43
44  # Install vendored pods.
45  use_pods! 'vendored/unversioned/**/*.podspec.json'
46
47  # Unversioned React Native
48  use_react_native!(
49    :path => '../react-native-lab/react-native',
50    :hermes_enabled => true,
51    :fabric_enabled => false,
52  )
53
54  # Build React Native with RCT_DEV enabled and RCT_ENABLE_INSPECTOR and
55  # RCT_ENABLE_PACKAGER_CONNECTION disabled
56  post_install do |installer|
57    # Workaround build error for Folly
58    __apply_Xcode_12_5_M1_post_install_workaround(installer) if installer.pods_project
59
60    # Disabled as of CocoaPods 1.8.0.beta1 since pods_project seems to be nil
61    # installer.pods_project.main_group.tab_width = '2';
62    # installer.pods_project.main_group.indent_width = '2';
63
64    installer.target_installation_results.pod_target_installation_results
65      .each do |pod_name, target_installation_result|
66
67      # Run postinstalls actions for versioned dependencies.
68      # These actions are specified in `versioned-react-native/ABI*/postinstalls.rb` files.
69      run_versioned_postinstalls!(pod_name, target_installation_result)
70
71      # This is necessary for Xcode 14 that by default signs resource bundles when building for the device.
72      target_installation_result.resource_bundle_targets.each do |resource_bundle_target|
73        resource_bundle_target.build_configurations.each do |config|
74          config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
75        end
76      end
77
78      target_installation_result.native_target.build_configurations.each do |config|
79        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
80
81        # Fix building failures on M1
82        config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
83      end
84
85      if pod_name == 'Branch'
86        target_installation_result.native_target.build_configurations.each do |config|
87          config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
88          config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'BRANCH_EXCLUDE_IDFA_CODE=1'
89        end
90      end
91
92      if pod_name.end_with?('EXUpdates')
93        target_installation_result.native_target.build_configurations.each do |config|
94          config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
95          config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'SUPPRESS_EXPO_UPDATES_SERVICE=1'
96        end
97      end
98
99      # Build React Native with RCT_DEV enabled and RCT_ENABLE_INSPECTOR and
100      # RCT_ENABLE_PACKAGER_CONNECTION disabled
101      next unless pod_name.start_with?('React')
102      target_installation_result.native_target.build_configurations.each do |config|
103        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
104        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'RCT_DEV=1'
105        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'RCT_ENABLE_INSPECTOR=0'
106        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION=0'
107      end
108    end
109  end
110
111  # Target for development, contains only unversioned code
112  target 'Expo Go (unversioned)' do
113  end
114
115  # Release target additionally includes versioned SDKs
116  target 'Expo Go (versioned)' do
117    # Evaluate all files matching `versioned-react-native/ABI*/dependencies.rb` glob pattern
118    # and install ReactABIXX_0_0 pods with all versioned unimodules.
119    use_versioned_abis!
120  end
121
122  # Test targets
123  target 'ExponentIntegrationTests' do
124    inherit! :search_paths
125  end
126
127  target 'Tests' do
128    # `ExpoModulesTestCore` has implicit dependency to `React-Core` which has a resource bundle.
129    # To prevent CocoaPods generating new `React-Core` resource bundle and the strange `React-Core-60309c9c` target,
130    # this test target should inherit all properties from parents.
131    inherit! :complete
132
133    pod 'ExpoModulesTestCore', :path => "../packages/expo-modules-test-core/ios"
134    pod 'Nimble', :podspec => './Nimble.podspec'
135  end
136end
137