xref: /expo/ios/Podfile (revision f2fbea2e)
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, '12.4'
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  # Expo modules
24  use_expo_modules!({
25    exclude: [
26      'expo-module-template',
27      'expo-in-app-purchases',
28      'expo-dev-menu',
29      'expo-dev-menu-interface',
30      'expo-dev-launcher',
31      'expo-dev-client',
32    ],
33    # Modules for which to include Tests subspec
34    tests: [
35      'expo-eas-client',
36      'expo-modules-core',
37      'expo-updates',
38      'expo-manifests',
39      'expo-json-utils',
40      'expo-structured-headers',
41      'expo-clipboard',
42    ],
43    flags: {
44      :inhibit_warnings => false
45    }
46  })
47
48  # Install vendored pods.
49  use_pods! 'vendored/unversioned/**/*.podspec.json'
50
51  # Unversioned React Native
52  use_react_native! path: '../react-native-lab/react-native'
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      target_installation_result.native_target.build_configurations.each do |config|
72        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
73
74        # Fix building failures on M1
75        config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
76      end
77
78      if pod_name == 'Branch'
79        target_installation_result.native_target.build_configurations.each do |config|
80          config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
81          config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'BRANCH_EXCLUDE_IDFA_CODE=1'
82        end
83      end
84
85      if pod_name.end_with?('EXUpdates')
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'] << 'SUPPRESS_EXPO_UPDATES_SERVICE=1'
89        end
90      end
91
92      # Build React Native with RCT_DEV enabled and RCT_ENABLE_INSPECTOR and
93      # RCT_ENABLE_PACKAGER_CONNECTION disabled
94      next unless pod_name.start_with?('React')
95      target_installation_result.native_target.build_configurations.each do |config|
96        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
97        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'RCT_DEV=1'
98        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'RCT_ENABLE_INSPECTOR=0'
99        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION=0'
100      end
101    end
102  end
103
104  # Target for development, contains only unversioned code
105  target 'Expo Go (unversioned)' do
106  end
107
108  # Release target additionally includes versioned SDKs
109  target 'Expo Go (versioned)' do
110    # Evaluate all files matching `versioned-react-native/ABI*/dependencies.rb` glob pattern
111    # and install ReactABIXX_0_0 pods with all versioned unimodules.
112    use_versioned_abis!
113  end
114
115  # Test targets
116  target 'ExponentIntegrationTests' do
117    inherit! :search_paths
118  end
119
120  target 'Tests' do
121    # `ExpoModulesTestCore` has implicit dependency to `React-Core` which has a resource bundle.
122    # To prevent CocoaPods generating new `React-Core` resource bundle and the strange `React-Core-60309c9c` target,
123    # this test target should inherit all properties from parents.
124    inherit! :complete
125
126    pod 'ExpoModulesTestCore', :path => "../packages/expo-modules-test-core/ios"
127    pod 'Nimble', :podspec => './Nimble.podspec'
128  end
129end
130