From a5df5fed5f6ceef387d31ba5df348250b20c050f Mon Sep 17 00:00:00 2001 From: Cedric van Putten Date: Wed, 22 Nov 2023 16:14:23 +0100 Subject: [PATCH] chore(install-expo-modules): move to `expo/expo` --- packages/install-expo-modules/LICENSE | 21 - packages/install-expo-modules/README.md | 39 +- packages/install-expo-modules/jest.config.js | 8 - packages/install-expo-modules/package.json | 61 -- packages/install-expo-modules/src/index.ts | 196 ----- ...inActivity-anonymous-delegate-updated.java | 29 - ...MainActivity-anonymous-delegate-updated.kt | 26 - .../MainActivity-anonymous-delegate.java | 28 - .../MainActivity-anonymous-delegate.kt | 25 - .../MainActivity-no-delegate-updated.java | 24 - .../MainActivity-no-delegate-updated.kt | 22 - .../fixtures/MainActivity-no-delegate.java | 15 - .../fixtures/MainActivity-no-delegate.kt | 14 - .../fixtures/MainActivity-rn064-updated.java | 22 - .../fixtures/MainActivity-rn064-updated.kt | 20 - .../fixtures/MainActivity-rn064.java | 21 - .../__tests__/fixtures/MainActivity-rn064.kt | 19 - .../fixtures/MainActivity-rn068-updated.java | 38 - .../fixtures/MainActivity-rn068-updated.kt | 31 - .../fixtures/MainActivity-rn068.java | 37 - .../__tests__/fixtures/MainActivity-rn068.kt | 30 - .../fixtures/MainActivity-rn071-updated.java | 36 - .../fixtures/MainActivity-rn071-updated.kt | 32 - .../fixtures/MainActivity-rn071.java | 35 - .../__tests__/fixtures/MainActivity-rn071.kt | 31 - .../MainApplication-rn064-updated.java | 55 -- .../fixtures/MainApplication-rn064-updated.kt | 44 -- .../fixtures/MainApplication-rn064.java | 45 -- .../fixtures/MainApplication-rn064.kt | 40 - .../MainApplication-rn068-updated.java | 69 -- .../fixtures/MainApplication-rn068.java | 59 -- .../MainApplication-rn071-updated.java | 72 -- .../fixtures/MainApplication-rn071.java | 62 -- .../withAndroidModulesMainActivity-test.ts | 147 ---- .../withAndroidModulesMainApplication-test.ts | 60 -- .../src/plugins/android/withAndroidGradles.ts | 59 -- .../src/plugins/android/withAndroidModules.ts | 36 - .../android/withAndroidModulesMainActivity.ts | 143 ---- .../withAndroidModulesMainApplication.ts | 225 ------ .../fixtures/AppDelegate-rn072-updated.mm | 26 - .../__tests__/fixtures/AppDelegate-rn072.mm | 26 - .../MainApplication-rn072-updated.java | 62 -- .../fixtures/MainApplication-rn072.java | 62 -- .../fixtures/appBuild-rn072-updated.gradle | 124 ---- .../__tests__/fixtures/appBuild-rn072.gradle | 119 --- .../fixtures/babel-config-rn072-updated.js | 3 - .../__tests__/fixtures/babel-config-rn072.js | 3 - .../__tests__/fixtures/metro-config-rn071.js | 17 - .../fixtures/metro-config-rn072-updated.js | 12 - .../__tests__/fixtures/metro-config-rn072.js | 11 - .../xcodeProject-rn072-updated.pbxproj | 702 ------------------ .../fixtures/xcodeProject-rn072.pbxproj | 702 ------------------ .../cli/__tests__/withCliIntegration-test.ts | 115 --- .../src/plugins/cli/withCliIntegration.ts | 222 ------ .../withIosModulesAppDelegate-test.ts.snap | 189 ----- .../withIosModulesPodfile-test.ts.snap | 86 --- .../fixtures/AppDelegate-rn068-updated.mm | 109 --- .../__tests__/fixtures/AppDelegate-rn068.mm | 108 --- .../fixtures/AppDelegate-rn071-updated.h | 7 - .../__tests__/fixtures/AppDelegate-rn071.h | 6 - .../__tests__/fixtures/AppDelegate-rn071.mm | 32 - .../__tests__/fixtures/AppDelegate-updated.h | 9 - .../__tests__/fixtures/AppDelegate-updated.m | 40 - .../fixtures/AppDelegate-updated.swift | 33 - .../ios/__tests__/fixtures/AppDelegate.h | 8 - .../ios/__tests__/fixtures/AppDelegate.m | 39 - .../ios/__tests__/fixtures/AppDelegate.swift | 32 - .../plugins/ios/__tests__/fixtures/Podfile | 33 - .../ios/__tests__/fixtures/Podfile-rn071 | 51 -- .../__tests__/fixtures/Podfile-rn071-updated | 60 -- .../ios/__tests__/fixtures/Podfile-updated | 42 -- .../fixtures/Podfile-with-post-integrate | 9 - .../Podfile-with-post-integrate-updated | 16 - .../__tests__/withIosDeploymentTarget-test.ts | 195 ----- .../withIosModulesAppDelegate-test.ts | 99 --- .../__tests__/withIosModulesPodfile-test.ts | 49 -- .../plugins/ios/withIosDeploymentTarget.ts | 162 ---- .../src/plugins/ios/withIosModules.ts | 17 - .../plugins/ios/withIosModulesAppDelegate.ts | 165 ---- .../src/plugins/ios/withIosModulesPodfile.ts | 72 -- .../plugins/ios/withXCParseXcodeProject.ts | 62 -- .../__tests__/expoVersionMappings-test.ts | 32 - .../src/utils/expoVersionMappings.ts | 76 -- .../install-expo-modules/src/utils/link.ts | 39 - .../src/utils/packageInstaller.ts | 51 -- .../src/utils/projectRoot.ts | 13 - packages/install-expo-modules/tsconfig.json | 12 - 87 files changed, 2 insertions(+), 6133 deletions(-) delete mode 100644 packages/install-expo-modules/LICENSE delete mode 100644 packages/install-expo-modules/jest.config.js delete mode 100644 packages/install-expo-modules/package.json delete mode 100644 packages/install-expo-modules/src/index.ts delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-anonymous-delegate-updated.java delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-anonymous-delegate-updated.kt delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-anonymous-delegate.java delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-anonymous-delegate.kt delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-no-delegate-updated.java delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-no-delegate-updated.kt delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-no-delegate.java delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-no-delegate.kt delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn064-updated.java delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn064-updated.kt delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn064.java delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn064.kt delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn068-updated.java delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn068-updated.kt delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn068.java delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn068.kt delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn071-updated.java delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn071-updated.kt delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn071.java delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn071.kt delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn064-updated.java delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn064-updated.kt delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn064.java delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn064.kt delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn068-updated.java delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn068.java delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn071-updated.java delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn071.java delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/withAndroidModulesMainActivity-test.ts delete mode 100644 packages/install-expo-modules/src/plugins/android/__tests__/withAndroidModulesMainApplication-test.ts delete mode 100644 packages/install-expo-modules/src/plugins/android/withAndroidGradles.ts delete mode 100644 packages/install-expo-modules/src/plugins/android/withAndroidModules.ts delete mode 100644 packages/install-expo-modules/src/plugins/android/withAndroidModulesMainActivity.ts delete mode 100644 packages/install-expo-modules/src/plugins/android/withAndroidModulesMainApplication.ts delete mode 100644 packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/AppDelegate-rn072-updated.mm delete mode 100644 packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/AppDelegate-rn072.mm delete mode 100644 packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/MainApplication-rn072-updated.java delete mode 100644 packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/MainApplication-rn072.java delete mode 100644 packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/appBuild-rn072-updated.gradle delete mode 100644 packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/appBuild-rn072.gradle delete mode 100644 packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/babel-config-rn072-updated.js delete mode 100644 packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/babel-config-rn072.js delete mode 100644 packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/metro-config-rn071.js delete mode 100644 packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/metro-config-rn072-updated.js delete mode 100644 packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/metro-config-rn072.js delete mode 100644 packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/xcodeProject-rn072-updated.pbxproj delete mode 100644 packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/xcodeProject-rn072.pbxproj delete mode 100644 packages/install-expo-modules/src/plugins/cli/__tests__/withCliIntegration-test.ts delete mode 100644 packages/install-expo-modules/src/plugins/cli/withCliIntegration.ts delete mode 100644 packages/install-expo-modules/src/plugins/ios/__tests__/__snapshots__/withIosModulesAppDelegate-test.ts.snap delete mode 100644 packages/install-expo-modules/src/plugins/ios/__tests__/__snapshots__/withIosModulesPodfile-test.ts.snap delete mode 100644 packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-rn068-updated.mm delete mode 100644 packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-rn068.mm delete mode 100644 packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-rn071-updated.h delete mode 100644 packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-rn071.h delete mode 100644 packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-rn071.mm delete mode 100644 packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-updated.h delete mode 100644 packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-updated.m delete mode 100644 packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-updated.swift delete mode 100644 packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate.h delete mode 100644 packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate.m delete mode 100644 packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate.swift delete mode 100644 packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile delete mode 100644 packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile-rn071 delete mode 100644 packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile-rn071-updated delete mode 100644 packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile-updated delete mode 100644 packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile-with-post-integrate delete mode 100644 packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile-with-post-integrate-updated delete mode 100644 packages/install-expo-modules/src/plugins/ios/__tests__/withIosDeploymentTarget-test.ts delete mode 100644 packages/install-expo-modules/src/plugins/ios/__tests__/withIosModulesAppDelegate-test.ts delete mode 100644 packages/install-expo-modules/src/plugins/ios/__tests__/withIosModulesPodfile-test.ts delete mode 100644 packages/install-expo-modules/src/plugins/ios/withIosDeploymentTarget.ts delete mode 100644 packages/install-expo-modules/src/plugins/ios/withIosModules.ts delete mode 100644 packages/install-expo-modules/src/plugins/ios/withIosModulesAppDelegate.ts delete mode 100644 packages/install-expo-modules/src/plugins/ios/withIosModulesPodfile.ts delete mode 100644 packages/install-expo-modules/src/plugins/ios/withXCParseXcodeProject.ts delete mode 100644 packages/install-expo-modules/src/utils/__tests__/expoVersionMappings-test.ts delete mode 100644 packages/install-expo-modules/src/utils/expoVersionMappings.ts delete mode 100644 packages/install-expo-modules/src/utils/link.ts delete mode 100644 packages/install-expo-modules/src/utils/packageInstaller.ts delete mode 100644 packages/install-expo-modules/src/utils/projectRoot.ts delete mode 100644 packages/install-expo-modules/tsconfig.json diff --git a/packages/install-expo-modules/LICENSE b/packages/install-expo-modules/LICENSE deleted file mode 100644 index 1562b6cb16..0000000000 --- a/packages/install-expo-modules/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2020-present 650 Industries, Inc. (aka Expo) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/install-expo-modules/README.md b/packages/install-expo-modules/README.md index 136689c1fa..8ffb902d1c 100644 --- a/packages/install-expo-modules/README.md +++ b/packages/install-expo-modules/README.md @@ -1,38 +1,3 @@ - -

-👋 Welcome to
install-expo-modules -

+# `install-expo-modules` -

A tool for existing React Native projects to adopt expo-modules and SDK easier.

- -

- - - - - -

- - - -# Usage - -Just to run `install-expo-modules` command in your project: - -```sh -npx install-expo-modules -``` - -After that, you can add other expo-modules you need, e.g. `expo-device`: - -```sh -expo install expo-device -# the expo command is from expo-cli. if you don't have this, run `npm -g install expo-cli` to install. -``` - -# What did `install-expo-modules` do for your project - -- Install [`expo`](https://www.npmjs.com/package/expo) package for necessary core and react-native autolinking. -- Modify your project files to adopt expo-modules. If your project is managed by `git`, you can use `git diff` to review whatever `install-expo-modules` do for you. -- Since expo-modules' minimal requirements for iOS is 12.0, if your ios deployment target is lower than that, this tool will upgrade your deployment target to 12.0. -- `pod install` at last to update linked modules for iOS. +This package has [moved to the `expo/expo` repo](https://github.com/expo/expo/tree/main/packages/install-expo-modules). diff --git a/packages/install-expo-modules/jest.config.js b/packages/install-expo-modules/jest.config.js deleted file mode 100644 index d2119a3674..0000000000 --- a/packages/install-expo-modules/jest.config.js +++ /dev/null @@ -1,8 +0,0 @@ -const path = require('path'); - -module.exports = { - preset: '../../jest/unit-test-config', - rootDir: path.resolve(__dirname), - displayName: require('./package').name, - roots: ['src'], -}; diff --git a/packages/install-expo-modules/package.json b/packages/install-expo-modules/package.json deleted file mode 100644 index 842996c895..0000000000 --- a/packages/install-expo-modules/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "install-expo-modules", - "version": "0.6.4", - "description": "Tools to install expo-modules for existing react-native projects", - "main": "build", - "scripts": { - "watch": "tsc --watch --preserveWatchOutput", - "watch:ncc": "yarn run build -w", - "build": "ncc build ./src/index.ts -o build/", - "build:prod": "ncc build ./src/index.ts -o build/ --minify --no-cache --no-source-map-register", - "prepare": "yarn run clean && yarn run build:prod", - "clean": "rimraf build ./tsconfig.tsbuildinfo", - "lint": "eslint .", - "test": "jest" - }, - "bin": { - "install-expo-modules": "./build/index.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/expo/expo-cli.git", - "directory": "packages/install-expo-modules" - }, - "keywords": [ - "expo", - "expo-modules", - "npx", - "react-native", - "react" - ], - "license": "MIT", - "bugs": { - "url": "https://github.com/expo/expo-cli/issues" - }, - "homepage": "https://github.com/expo/expo-cli/tree/main/packages/install-expo-modules#readme", - "files": [ - "build", - "!*/__tests__/*" - ], - "dependencies": { - "@expo/config": "~8.0.0", - "@expo/config-plugins": "~6.0.0", - "@expo/package-manager": "0.0.56", - "chalk": "^4.1.2", - "commander": "2.20.0", - "find-up": "^5.0.0", - "glob": "7.1.6", - "prompts": "^2.3.2", - "resolve-from": "^5.0.0", - "semver": "7.3.2", - "terminal-link": "^2.1.1", - "xcparse": "^0.0.3" - }, - "devDependencies": { - "@types/prompts": "^2.0.6", - "@types/semver": "^6.0.0" - }, - "publishConfig": { - "access": "public" - } -} diff --git a/packages/install-expo-modules/src/index.ts b/packages/install-expo-modules/src/index.ts deleted file mode 100644 index 6041ab42c2..0000000000 --- a/packages/install-expo-modules/src/index.ts +++ /dev/null @@ -1,196 +0,0 @@ -#!/usr/bin/env node - -import { getConfig } from '@expo/config'; -import { compileModsAsync, ModPlatform } from '@expo/config-plugins'; -import chalk from 'chalk'; -import { Command } from 'commander'; -import prompts from 'prompts'; - -import { - shouldUpdateAgpVersionAsync, - withAndroidGradlePluginVersion, -} from './plugins/android/withAndroidGradles'; -import { withAndroidModules } from './plugins/android/withAndroidModules'; -import { withCliIntegration } from './plugins/cli/withCliIntegration'; -import { - shouldUpdateDeployTargetPodfileAsync, - withIosDeploymentTarget, -} from './plugins/ios/withIosDeploymentTarget'; -import { withIosModules } from './plugins/ios/withIosModules'; -import { withXCParseXcodeProjectBaseMod } from './plugins/ios/withXCParseXcodeProject'; -import { getDefaultSdkVersion, getVersionInfo, VersionInfo } from './utils/expoVersionMappings'; -import { learnMore } from './utils/link'; -import { installExpoPackageAsync, installPodsAsync } from './utils/packageInstaller'; -import { normalizeProjectRoot } from './utils/projectRoot'; - -const packageJSON = require('../package.json'); - -let projectRoot: string = ''; - -const program = new Command(packageJSON.name) - .version(packageJSON.version) - .arguments('') - .usage(`${chalk.green('')} [options]`) - .description('Install expo-modules into your project') - .option('-s, --sdk-version ', 'Install specified expo-modules sdk version') - .option('--non-interactive', 'Disable interactive prompts') - .action((inputProjectRoot: string) => (projectRoot = inputProjectRoot)) - .parse(process.argv); - -function getSdkVersionInfo(): VersionInfo { - const { sdkVersion } = program; - if (sdkVersion) { - const versionInfo = getVersionInfo(sdkVersion); - if (!versionInfo) { - throw new Error(`Unsupported sdkVersion: ${sdkVersion}`); - } - return versionInfo; - } - return getDefaultSdkVersion(projectRoot); -} - -/** - * Show a prompt before upgrading the Android Gradle Plugin version for the target project. - * - * @returns true if user confirm to update. otherwise, returns false. - */ -async function promptUpgradeAgpVersionAsync(projectRoot: string, agpVersion: string) { - if (!(await shouldUpdateAgpVersionAsync(projectRoot, agpVersion))) { - return true; - } - - const deploymentTargetMessage = `The minimum Android Gradle Plugin version for Expo modules is ${agpVersion}. This tool will change your AGP version to ${agpVersion}.`; - if (program.nonInteractive) { - console.log(chalk.yellow(`⚠️ ${deploymentTargetMessage}`)); - return true; - } else { - const { value } = await prompts({ - type: 'confirm', - name: 'value', - message: `${deploymentTargetMessage} Do you want to continue?`, - initial: true, - }); - return !!value; - } -} - -/** - * Show a prompt before upgrading the iOS deployment target version for the target project. - * - * @returns true if user confirm to update. otherwise, returns false. - */ -async function promptUpgradeIosDeployTargetAsync(projectRoot: string, iosDeploymentTarget: string) { - if (!(await shouldUpdateDeployTargetPodfileAsync(projectRoot, iosDeploymentTarget))) { - return true; - } - - const deploymentTargetMessage = `Expo modules minimum iOS requirement is ${iosDeploymentTarget}. This tool will change your iOS deployment target to ${iosDeploymentTarget}.`; - if (program.nonInteractive) { - console.log(chalk.yellow(`⚠️ ${deploymentTargetMessage}`)); - return true; - } else { - const { value } = await prompts({ - type: 'confirm', - name: 'value', - message: `${deploymentTargetMessage} Do you want to continue?`, - initial: true, - }); - return !!value; - } -} - -/** - * Show a prompt to ask for adding Expo CLI integration. - * @returns true if user confirm to add Expo CLI integration. otherwise, returns false. - */ -async function promptCliIntegrationAsync() { - const message = `This tool can install Expo CLI integration for your project. -Using Expo CLI has some benefits over the the default CLI in bare React Native projects: - - Built-in JavaScript debugger and React Devtools. - - Support for Continuous Native Generation (CNG) with \`npx expo prebuild\` for easy upgrades. - - Automatic web support with Metro. -${learnMore('https://docs.expo.dev/bare/using-expo-cli/')} -Do you want to install the Expo CLI integration?`; - - if (program.nonInteractive) { - return true; - } - const { value } = await prompts({ - type: 'confirm', - name: 'value', - message, - initial: true, - }); - return !!value; -} - -async function runAsync(programName: string) { - projectRoot = normalizeProjectRoot(projectRoot); - - const { - expoSdkVersion: sdkVersion, - iosDeploymentTarget, - androidAgpVersion, - supportCliIntegration, - } = getSdkVersionInfo(); - if (androidAgpVersion && !(await promptUpgradeAgpVersionAsync(projectRoot, androidAgpVersion))) { - return; - } - if (!(await promptUpgradeIosDeployTargetAsync(projectRoot, iosDeploymentTarget))) { - return; - } - - const cliIntegration = supportCliIntegration && (await promptCliIntegrationAsync()); - - const platforms: ModPlatform[] = ['android', 'ios']; - let { exp: config } = getConfig(projectRoot, { - skipSDKVersionRequirement: true, - isModdedConfig: true, - }); - - // for react-native project, we do not verify sdkVersion with the `skipSDKVersionRequirement` flag. - // to get the target sdkVersion easier for config plugins, we fill the target sdkVersion into config. - config.sdkVersion = sdkVersion; - - if (androidAgpVersion) { - config = withAndroidGradlePluginVersion(config, { - androidAgpVersion, - }); - } - config = withAndroidModules(config); - config = withIosModules(config); - config = withIosDeploymentTarget(config, { - deploymentTarget: iosDeploymentTarget, - }); - - if (cliIntegration) { - config = withCliIntegration(config); - } - - // Keeps the base mods last - config = withXCParseXcodeProjectBaseMod(config); - - console.log('\u203A Updating your project...'); - await compileModsAsync(config, { - projectRoot, - platforms, - }); - - console.log('\u203A Installing expo packages...'); - await installExpoPackageAsync(projectRoot, sdkVersion); - - console.log('\u203A Installing ios pods...'); - await installPodsAsync(projectRoot); - - console.log(chalk.bold('\u203A Installation completed!')); -} - -(async () => { - program.parse(process.argv); - try { - await runAsync(packageJSON.name); - } catch (e) { - console.error('Uncaught Error', e); - process.exit(1); - } -})(); diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-anonymous-delegate-updated.java b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-anonymous-delegate-updated.java deleted file mode 100644 index 3bf8c57876..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-anonymous-delegate-updated.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.helloworld; -import expo.modules.ReactActivityDelegateWrapper; - -import com.facebook.react.ReactActivity; -import com.facebook.react.ReactActivityDelegate; -import com.facebook.react.ReactRootView -import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView; - -public class MainActivity extends ReactActivity { - - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - @Override - protected String getMainComponentName() { - return "HelloWorld"; - } - - @Override - protected ReactActivityDelegate createReactActivityDelegate() { - return new ReactActivityDelegateWrapper(this, new ReactActivityDelegate(this, getMainComponentName()) { - @Override - protected ReactRootView createRootView() { - return new RNGestureHandlerEnabledRootView(MainActivity.this); - } - }); - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-anonymous-delegate-updated.kt b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-anonymous-delegate-updated.kt deleted file mode 100644 index d4dfc2590c..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-anonymous-delegate-updated.kt +++ /dev/null @@ -1,26 +0,0 @@ -package com.helloworld -import expo.modules.ReactActivityDelegateWrapper - -import com.facebook.react.ReactActivity -import com.facebook.react.ReactActivityDelegate -import com.facebook.react.ReactRootView -import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView - -class MainActivity : ReactActivity() { - - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - override fun mainComponentName: String { - return "HelloWorld" - } - - override fun createReactActivityDelegate(): ReactActivityDelegate { - return ReactActivityDelegateWrapper(this, object : ReactActivityDelegate(this, mainComponentName) { - override fun createRootView(): ReactRootView { - return RNGestureHandlerEnabledRootView(this@MainActivity) - } - }) - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-anonymous-delegate.java b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-anonymous-delegate.java deleted file mode 100644 index d7a4d914c4..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-anonymous-delegate.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.helloworld; - -import com.facebook.react.ReactActivity; -import com.facebook.react.ReactActivityDelegate; -import com.facebook.react.ReactRootView -import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView; - -public class MainActivity extends ReactActivity { - - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - @Override - protected String getMainComponentName() { - return "HelloWorld"; - } - - @Override - protected ReactActivityDelegate createReactActivityDelegate() { - return new ReactActivityDelegate(this, getMainComponentName()) { - @Override - protected ReactRootView createRootView() { - return new RNGestureHandlerEnabledRootView(MainActivity.this); - } - }; - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-anonymous-delegate.kt b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-anonymous-delegate.kt deleted file mode 100644 index 21af401d38..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-anonymous-delegate.kt +++ /dev/null @@ -1,25 +0,0 @@ -package com.helloworld - -import com.facebook.react.ReactActivity -import com.facebook.react.ReactActivityDelegate -import com.facebook.react.ReactRootView -import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView - -class MainActivity : ReactActivity() { - - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - override fun mainComponentName: String { - return "HelloWorld" - } - - override fun createReactActivityDelegate(): ReactActivityDelegate { - return object : ReactActivityDelegate(this, mainComponentName) { - override fun createRootView(): ReactRootView { - return RNGestureHandlerEnabledRootView(this@MainActivity) - } - } - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-no-delegate-updated.java b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-no-delegate-updated.java deleted file mode 100644 index f7c92e7ed8..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-no-delegate-updated.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.helloworld; -import expo.modules.ReactActivityDelegateWrapper; -import com.facebook.react.ReactActivityDelegate; - -import com.facebook.react.ReactActivity; - -public class MainActivity extends ReactActivity { - - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - @Override - protected String getMainComponentName() { - return "HelloWorld"; - } - - @Override - protected ReactActivityDelegate createReactActivityDelegate() { - return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, - new ReactActivityDelegate(this, getMainComponentName()) - ); - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-no-delegate-updated.kt b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-no-delegate-updated.kt deleted file mode 100644 index 6f143711e3..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-no-delegate-updated.kt +++ /dev/null @@ -1,22 +0,0 @@ -package com.helloworld -import expo.modules.ReactActivityDelegateWrapper -import com.facebook.react.ReactActivityDelegate - -import com.facebook.react.ReactActivity - -class MainActivity : ReactActivity() { - - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - override fun mainComponentName: String { - return "HelloWorld" - } - - override fun createReactActivityDelegate(): ReactActivityDelegate { - return ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, - ReactActivityDelegate(this, getMainComponentName()) - ); - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-no-delegate.java b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-no-delegate.java deleted file mode 100644 index c7106d573c..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-no-delegate.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.helloworld; - -import com.facebook.react.ReactActivity; - -public class MainActivity extends ReactActivity { - - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - @Override - protected String getMainComponentName() { - return "HelloWorld"; - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-no-delegate.kt b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-no-delegate.kt deleted file mode 100644 index 44728b8d4d..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-no-delegate.kt +++ /dev/null @@ -1,14 +0,0 @@ -package com.helloworld - -import com.facebook.react.ReactActivity - -class MainActivity : ReactActivity() { - - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - override fun mainComponentName: String { - return "HelloWorld" - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn064-updated.java b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn064-updated.java deleted file mode 100644 index adfbcda87b..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn064-updated.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.helloworld; -import expo.modules.ReactActivityDelegateWrapper; - -import com.facebook.react.ReactActivity; -import com.facebook.react.ReactActivityDelegate; - -public class MainActivity extends ReactActivity { - - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - @Override - protected String getMainComponentName() { - return "HelloWorld"; - } - - @Override - protected ReactActivityDelegate createReactActivityDelegate() { - return new ReactActivityDelegateWrapper(this, new ReactActivityDelegate(this, getMainComponentName())); - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn064-updated.kt b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn064-updated.kt deleted file mode 100644 index 843f8d6a6b..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn064-updated.kt +++ /dev/null @@ -1,20 +0,0 @@ -package com.helloworld -import expo.modules.ReactActivityDelegateWrapper - -import com.facebook.react.ReactActivity -import com.facebook.react.ReactActivityDelegate - -class MainActivity : ReactActivity() { - - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - override fun mainComponentName: String { - return "HelloWorld" - } - - override fun createReactActivityDelegate(): ReactActivityDelegate { - return ReactActivityDelegateWrapper(this, ReactActivityDelegate(this, mainComponentName)) - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn064.java b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn064.java deleted file mode 100644 index cdfc7fc82a..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn064.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.helloworld; - -import com.facebook.react.ReactActivity; -import com.facebook.react.ReactActivityDelegate; - -public class MainActivity extends ReactActivity { - - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - @Override - protected String getMainComponentName() { - return "HelloWorld"; - } - - @Override - protected ReactActivityDelegate createReactActivityDelegate() { - return new ReactActivityDelegate(this, getMainComponentName()); - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn064.kt b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn064.kt deleted file mode 100644 index 9050986c3a..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn064.kt +++ /dev/null @@ -1,19 +0,0 @@ -package com.helloworld - -import com.facebook.react.ReactActivity -import com.facebook.react.ReactActivityDelegate - -class MainActivity : ReactActivity() { - - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - override fun mainComponentName: String { - return "HelloWorld" - } - - override fun createReactActivityDelegate(): ReactActivityDelegate { - return ReactActivityDelegate(this, mainComponentName) - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn068-updated.java b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn068-updated.java deleted file mode 100644 index d74126a3bd..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn068-updated.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.helloworld; -import expo.modules.ReactActivityDelegateWrapper; - -import com.facebook.react.ReactActivity; -import com.facebook.react.ReactActivityDelegate; -import com.facebook.react.ReactRootView; - -public class MainActivity extends ReactActivity { - - /** - * Returns the name of the main component registered from JavaScript. This is - * used to schedule - * rendering of the component. - */ - @Override - protected String getMainComponentName() { - return "HelloWorld"; - } - - @Override - protected ReactActivityDelegate createReactActivityDelegate() { - return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new MainActivityDelegate(this, getMainComponentName())); - } - - public static class MainActivityDelegate extends ReactActivityDelegate { - public MainActivityDelegate(ReactActivity activity, String mainComponentName) { - super(activity, mainComponentName); - } - - @Override - protected ReactRootView createRootView() { - ReactRootView reactRootView = new ReactRootView(getContext()); - // If you opted-in for the New Architecture, we enable the Fabric Renderer. - reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED); - return reactRootView; - } - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn068-updated.kt b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn068-updated.kt deleted file mode 100644 index cd0f08a8d1..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn068-updated.kt +++ /dev/null @@ -1,31 +0,0 @@ -package com.helloworld -import expo.modules.ReactActivityDelegateWrapper - -import com.facebook.react.ReactActivity -import com.facebook.react.ReactActivityDelegate -import com.facebook.react.ReactRootView - -class MainActivity : ReactActivity() { - - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - override fun mainComponentName: String { - return "HelloWorld" - } - - override fun createReactActivityDelegate(): ReactActivityDelegate { - return ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, MainActivityDelegate(this, mainComponentName)) - } - - class MainActivityDelegate(activity: ReactActivity?, mainComponentName: String?) - : ReactActivityDelegate(activity, mainComponentName) { - override fun createRootView(): ReactRootView { - val reactRootView = ReactRootView(context) - // If you opted-in for the New Architecture, we enable the Fabric Renderer. - reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) - return reactRootView - } - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn068.java b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn068.java deleted file mode 100644 index 06abb5b026..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn068.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.helloworld; - -import com.facebook.react.ReactActivity; -import com.facebook.react.ReactActivityDelegate; -import com.facebook.react.ReactRootView; - -public class MainActivity extends ReactActivity { - - /** - * Returns the name of the main component registered from JavaScript. This is - * used to schedule - * rendering of the component. - */ - @Override - protected String getMainComponentName() { - return "HelloWorld"; - } - - @Override - protected ReactActivityDelegate createReactActivityDelegate() { - return new MainActivityDelegate(this, getMainComponentName()); - } - - public static class MainActivityDelegate extends ReactActivityDelegate { - public MainActivityDelegate(ReactActivity activity, String mainComponentName) { - super(activity, mainComponentName); - } - - @Override - protected ReactRootView createRootView() { - ReactRootView reactRootView = new ReactRootView(getContext()); - // If you opted-in for the New Architecture, we enable the Fabric Renderer. - reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED); - return reactRootView; - } - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn068.kt b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn068.kt deleted file mode 100644 index efbef6008b..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn068.kt +++ /dev/null @@ -1,30 +0,0 @@ -package com.helloworld - -import com.facebook.react.ReactActivity -import com.facebook.react.ReactActivityDelegate -import com.facebook.react.ReactRootView - -class MainActivity : ReactActivity() { - - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - override fun mainComponentName: String { - return "HelloWorld" - } - - override fun createReactActivityDelegate(): ReactActivityDelegate { - return MainActivityDelegate(this, mainComponentName) - } - - class MainActivityDelegate(activity: ReactActivity?, mainComponentName: String?) - : ReactActivityDelegate(activity, mainComponentName) { - override fun createRootView(): ReactRootView { - val reactRootView = ReactRootView(context) - // If you opted-in for the New Architecture, we enable the Fabric Renderer. - reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) - return reactRootView - } - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn071-updated.java b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn071-updated.java deleted file mode 100644 index 20d9aa452c..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn071-updated.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.helloworld; -import expo.modules.ReactActivityDelegateWrapper; - -import com.facebook.react.ReactActivity; -import com.facebook.react.ReactActivityDelegate; -import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint; -import com.facebook.react.defaults.DefaultReactActivityDelegate; - -public class MainActivity extends ReactActivity { - - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - @Override - protected String getMainComponentName() { - return "HelloWorld"; - } - - /** - * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link - * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React - * (aka React 18) with two boolean flags. - */ - @Override - protected ReactActivityDelegate createReactActivityDelegate() { - return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new DefaultReactActivityDelegate( - this, - getMainComponentName(), - // If you opted-in for the New Architecture, we enable the Fabric Renderer. - DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled - // If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18). - DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled - )); - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn071-updated.kt b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn071-updated.kt deleted file mode 100644 index 0078118d36..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn071-updated.kt +++ /dev/null @@ -1,32 +0,0 @@ -package com.helloworld -import expo.modules.ReactActivityDelegateWrapper - -import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled -import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.concurrentReactEnabled -import com.facebook.react.ReactActivity -import com.facebook.react.ReactActivityDelegate -import com.facebook.react.defaults.DefaultReactActivityDelegate - -class MainActivity : ReactActivity() { - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - override fun getMainComponentName(): String? { - return "HelloWorld" - } - - /** - * Returns the instance of the [ReactActivityDelegate]. Here we use a util class [ ] which allows you to easily enable Fabric and Concurrent React - * (aka React 18) with two boolean flags. - */ - override fun createReactActivityDelegate(): ReactActivityDelegate { - return ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, DefaultReactActivityDelegate( - this, - mainComponentName!!, // If you opted-in for the New Architecture, we enable the Fabric Renderer. - fabricEnabled, // fabricEnabled - // If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18). - concurrentReactEnabled // concurrentRootEnabled - )) - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn071.java b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn071.java deleted file mode 100644 index 96fcdf2d7c..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn071.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.helloworld; - -import com.facebook.react.ReactActivity; -import com.facebook.react.ReactActivityDelegate; -import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint; -import com.facebook.react.defaults.DefaultReactActivityDelegate; - -public class MainActivity extends ReactActivity { - - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - @Override - protected String getMainComponentName() { - return "HelloWorld"; - } - - /** - * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link - * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React - * (aka React 18) with two boolean flags. - */ - @Override - protected ReactActivityDelegate createReactActivityDelegate() { - return new DefaultReactActivityDelegate( - this, - getMainComponentName(), - // If you opted-in for the New Architecture, we enable the Fabric Renderer. - DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled - // If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18). - DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled - ); - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn071.kt b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn071.kt deleted file mode 100644 index 5697323bac..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainActivity-rn071.kt +++ /dev/null @@ -1,31 +0,0 @@ -package com.helloworld - -import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled -import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.concurrentReactEnabled -import com.facebook.react.ReactActivity -import com.facebook.react.ReactActivityDelegate -import com.facebook.react.defaults.DefaultReactActivityDelegate - -class MainActivity : ReactActivity() { - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - override fun getMainComponentName(): String? { - return "HelloWorld" - } - - /** - * Returns the instance of the [ReactActivityDelegate]. Here we use a util class [ ] which allows you to easily enable Fabric and Concurrent React - * (aka React 18) with two boolean flags. - */ - override fun createReactActivityDelegate(): ReactActivityDelegate { - return DefaultReactActivityDelegate( - this, - mainComponentName!!, // If you opted-in for the New Architecture, we enable the Fabric Renderer. - fabricEnabled, // fabricEnabled - // If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18). - concurrentReactEnabled // concurrentRootEnabled - ) - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn064-updated.java b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn064-updated.java deleted file mode 100644 index 727ee70c1c..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn064-updated.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.helloworld; -import android.content.res.Configuration; -import expo.modules.ApplicationLifecycleDispatcher; -import expo.modules.ReactNativeHostWrapper; - -import android.app.Application; -import com.facebook.react.PackageList; -import com.facebook.react.ReactApplication; -import com.facebook.react.ReactNativeHost; -import com.facebook.react.ReactPackage; -import com.facebook.soloader.SoLoader; -import java.util.List; - -public class MainApplication extends Application implements ReactApplication { - - private final ReactNativeHost mReactNativeHost = - new ReactNativeHostWrapper(this, new ReactNativeHost(this) { - @Override - public boolean getUseDeveloperSupport() { - return BuildConfig.DEBUG; - } - - @Override - protected List getPackages() { - @SuppressWarnings("UnnecessaryLocalVariable") - List packages = new PackageList(this).getPackages(); - return packages; - } - - @Override - protected String getJSMainModuleName() { - return "index"; - } - }); - - @Override - public ReactNativeHost getReactNativeHost() { - return mReactNativeHost; - } - - @Override - public void onCreate() { - super.onCreate(); - SoLoader.init(this, /* native exopackage */ false); - // comment out initializeFlipper to keep test simpler - // initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); - ApplicationLifecycleDispatcher.onApplicationCreate(this); - } - - @Override - public void onConfigurationChanged(Configuration newConfig) { - super.onConfigurationChanged(newConfig); - ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig); - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn064-updated.kt b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn064-updated.kt deleted file mode 100644 index 9c5247f29d..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn064-updated.kt +++ /dev/null @@ -1,44 +0,0 @@ -package com.helloworld -import expo.modules.ApplicationLifecycleDispatcher -import expo.modules.ReactNativeHostWrapper - -import android.app.Application -import android.content.res.Configuration; -import com.facebook.react.PackageList -import com.facebook.react.ReactApplication -import com.facebook.react.ReactNativeHost -import com.facebook.react.ReactPackage -import com.facebook.soloader.SoLoader - -class MainApplication : Application(), ReactApplication { - private val mReactNativeHost: ReactNativeHost = ReactNativeHostWrapper(this, object : ReactNativeHost(this) { - override fun getUseDeveloperSupport(): Boolean { - return BuildConfig.DEBUG - } - - override fun getPackages(): List { - return PackageList(this).packages - } - - override fun getJSMainModuleName(): String { - return "index" - } - }) - - override fun getReactNativeHost(): ReactNativeHost { - return mReactNativeHost - } - - override fun onCreate() { - super.onCreate() - SoLoader.init(this, /* native exopackage */ false) - // comment out initializeFlipper to keep test simpler - // initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); - ApplicationLifecycleDispatcher.onApplicationCreate(this) - } - - override fun onConfigurationChanged(newConfig: Configuration) { - super.onConfigurationChanged(newConfig) - ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig) - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn064.java b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn064.java deleted file mode 100644 index 03f2818dfe..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn064.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.helloworld; - -import android.app.Application; -import com.facebook.react.PackageList; -import com.facebook.react.ReactApplication; -import com.facebook.react.ReactNativeHost; -import com.facebook.react.ReactPackage; -import com.facebook.soloader.SoLoader; -import java.util.List; - -public class MainApplication extends Application implements ReactApplication { - - private final ReactNativeHost mReactNativeHost = - new ReactNativeHost(this) { - @Override - public boolean getUseDeveloperSupport() { - return BuildConfig.DEBUG; - } - - @Override - protected List getPackages() { - @SuppressWarnings("UnnecessaryLocalVariable") - List packages = new PackageList(this).getPackages(); - return packages; - } - - @Override - protected String getJSMainModuleName() { - return "index"; - } - }; - - @Override - public ReactNativeHost getReactNativeHost() { - return mReactNativeHost; - } - - @Override - public void onCreate() { - super.onCreate(); - SoLoader.init(this, /* native exopackage */ false); - // comment out initializeFlipper to keep test simpler - // initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn064.kt b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn064.kt deleted file mode 100644 index 8023d71525..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn064.kt +++ /dev/null @@ -1,40 +0,0 @@ -package com.helloworld - -import android.app.Application -import android.content.res.Configuration; -import com.facebook.react.PackageList -import com.facebook.react.ReactApplication -import com.facebook.react.ReactNativeHost -import com.facebook.react.ReactPackage -import com.facebook.soloader.SoLoader - -class MainApplication : Application(), ReactApplication { - private val mReactNativeHost: ReactNativeHost = object : ReactNativeHost(this) { - override fun getUseDeveloperSupport(): Boolean { - return BuildConfig.DEBUG - } - - override fun getPackages(): List { - return PackageList(this).packages - } - - override fun getJSMainModuleName(): String { - return "index" - } - } - - override fun getReactNativeHost(): ReactNativeHost { - return mReactNativeHost - } - - override fun onCreate() { - super.onCreate() - SoLoader.init(this, /* native exopackage */ false) - // comment out initializeFlipper to keep test simpler - // initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); - } - - override fun onConfigurationChanged(newConfig: Configuration) { - super.onConfigurationChanged(newConfig) - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn068-updated.java b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn068-updated.java deleted file mode 100644 index 1831004c72..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn068-updated.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.helloworld; -import android.content.res.Configuration; -import expo.modules.ApplicationLifecycleDispatcher; -import expo.modules.ReactNativeHostWrapper; - -import android.app.Application; -import android.content.Context; -import com.facebook.react.PackageList; -import com.facebook.react.ReactApplication; -import com.facebook.react.ReactInstanceManager; -import com.facebook.react.ReactNativeHost; -import com.facebook.react.ReactPackage; -import com.facebook.react.config.ReactFeatureFlags; -import com.facebook.soloader.SoLoader; -import com.helloworld.newarchitecture.MainApplicationReactNativeHost; -import java.lang.reflect.InvocationTargetException; -import java.util.List; - -public class MainApplication extends Application implements ReactApplication { - - private final ReactNativeHost mReactNativeHost = - new ReactNativeHostWrapper(this, new ReactNativeHost(this) { - @Override - public boolean getUseDeveloperSupport() { - return BuildConfig.DEBUG; - } - - @Override - protected List getPackages() { - @SuppressWarnings("UnnecessaryLocalVariable") - List packages = new PackageList(this).getPackages(); - return packages; - } - - @Override - protected String getJSMainModuleName() { - return "index"; - } - }); - - private final ReactNativeHost mNewArchitectureNativeHost = - new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this)); - - @Override - public ReactNativeHost getReactNativeHost() { - if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { - return mNewArchitectureNativeHost; - } else { - return mReactNativeHost; - } - } - - @Override - public void onCreate() { - super.onCreate(); - // If you opted-in for the New Architecture, we enable the TurboModule system - ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; - SoLoader.init(this, /* native exopackage */ false); - // comment out initializeFlipper to keep test simpler - // initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); - ApplicationLifecycleDispatcher.onApplicationCreate(this); - } - - @Override - public void onConfigurationChanged(Configuration newConfig) { - super.onConfigurationChanged(newConfig); - ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig); - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn068.java b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn068.java deleted file mode 100644 index 8ff53279da..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn068.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.helloworld; - -import android.app.Application; -import android.content.Context; -import com.facebook.react.PackageList; -import com.facebook.react.ReactApplication; -import com.facebook.react.ReactInstanceManager; -import com.facebook.react.ReactNativeHost; -import com.facebook.react.ReactPackage; -import com.facebook.react.config.ReactFeatureFlags; -import com.facebook.soloader.SoLoader; -import com.helloworld.newarchitecture.MainApplicationReactNativeHost; -import java.lang.reflect.InvocationTargetException; -import java.util.List; - -public class MainApplication extends Application implements ReactApplication { - - private final ReactNativeHost mReactNativeHost = - new ReactNativeHost(this) { - @Override - public boolean getUseDeveloperSupport() { - return BuildConfig.DEBUG; - } - - @Override - protected List getPackages() { - @SuppressWarnings("UnnecessaryLocalVariable") - List packages = new PackageList(this).getPackages(); - return packages; - } - - @Override - protected String getJSMainModuleName() { - return "index"; - } - }; - - private final ReactNativeHost mNewArchitectureNativeHost = - new MainApplicationReactNativeHost(this); - - @Override - public ReactNativeHost getReactNativeHost() { - if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { - return mNewArchitectureNativeHost; - } else { - return mReactNativeHost; - } - } - - @Override - public void onCreate() { - super.onCreate(); - // If you opted-in for the New Architecture, we enable the TurboModule system - ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; - SoLoader.init(this, /* native exopackage */ false); - // comment out initializeFlipper to keep test simpler - // initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn071-updated.java b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn071-updated.java deleted file mode 100644 index 0ba1f77fff..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn071-updated.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.helloworld; -import android.content.res.Configuration; -import expo.modules.ApplicationLifecycleDispatcher; -import expo.modules.ReactNativeHostWrapper; - -import android.app.Application; -import com.facebook.react.PackageList; -import com.facebook.react.ReactApplication; -import com.facebook.react.ReactNativeHost; -import com.facebook.react.ReactPackage; -import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint; -import com.facebook.react.defaults.DefaultReactNativeHost; -import com.facebook.soloader.SoLoader; -import java.util.List; - -public class MainApplication extends Application implements ReactApplication { - - private final ReactNativeHost mReactNativeHost = - new ReactNativeHostWrapper(this, new DefaultReactNativeHost(this) { - @Override - public boolean getUseDeveloperSupport() { - return BuildConfig.DEBUG; - } - - @Override - protected List getPackages() { - @SuppressWarnings("UnnecessaryLocalVariable") - List packages = new PackageList(this).getPackages(); - // Packages that cannot be autolinked yet can be added manually here, for example: - // packages.add(new MyReactNativePackage()); - return packages; - } - - @Override - protected String getJSMainModuleName() { - return "index"; - } - - @Override - protected boolean isNewArchEnabled() { - return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; - } - - @Override - protected Boolean isHermesEnabled() { - return BuildConfig.IS_HERMES_ENABLED; - } - }); - - @Override - public ReactNativeHost getReactNativeHost() { - return mReactNativeHost; - } - - @Override - public void onCreate() { - super.onCreate(); - SoLoader.init(this, /* native exopackage */ false); - if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { - // If you opted-in for the New Architecture, we load the native entry point for this app. - DefaultNewArchitectureEntryPoint.load(); - } - ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); - ApplicationLifecycleDispatcher.onApplicationCreate(this); - } - - @Override - public void onConfigurationChanged(Configuration newConfig) { - super.onConfigurationChanged(newConfig); - ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig); - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn071.java b/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn071.java deleted file mode 100644 index 3227c9e969..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/fixtures/MainApplication-rn071.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.helloworld; - -import android.app.Application; -import com.facebook.react.PackageList; -import com.facebook.react.ReactApplication; -import com.facebook.react.ReactNativeHost; -import com.facebook.react.ReactPackage; -import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint; -import com.facebook.react.defaults.DefaultReactNativeHost; -import com.facebook.soloader.SoLoader; -import java.util.List; - -public class MainApplication extends Application implements ReactApplication { - - private final ReactNativeHost mReactNativeHost = - new DefaultReactNativeHost(this) { - @Override - public boolean getUseDeveloperSupport() { - return BuildConfig.DEBUG; - } - - @Override - protected List getPackages() { - @SuppressWarnings("UnnecessaryLocalVariable") - List packages = new PackageList(this).getPackages(); - // Packages that cannot be autolinked yet can be added manually here, for example: - // packages.add(new MyReactNativePackage()); - return packages; - } - - @Override - protected String getJSMainModuleName() { - return "index"; - } - - @Override - protected boolean isNewArchEnabled() { - return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; - } - - @Override - protected Boolean isHermesEnabled() { - return BuildConfig.IS_HERMES_ENABLED; - } - }; - - @Override - public ReactNativeHost getReactNativeHost() { - return mReactNativeHost; - } - - @Override - public void onCreate() { - super.onCreate(); - SoLoader.init(this, /* native exopackage */ false); - if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { - // If you opted-in for the New Architecture, we load the native entry point for this app. - DefaultNewArchitectureEntryPoint.load(); - } - ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); - } -} diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/withAndroidModulesMainActivity-test.ts b/packages/install-expo-modules/src/plugins/android/__tests__/withAndroidModulesMainActivity-test.ts deleted file mode 100644 index 397b1be1a6..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/withAndroidModulesMainActivity-test.ts +++ /dev/null @@ -1,147 +0,0 @@ -import fs from 'fs'; -import path from 'path'; - -import { setModulesMainActivity } from '../withAndroidModulesMainActivity'; - -const fixturesPath = path.resolve(__dirname, 'fixtures'); - -describe(setModulesMainActivity, () => { - it(`should add createReactActivityDelegate code block if not overridden yet - java`, async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'MainActivity-no-delegate.java'), 'utf8'), - fs.promises.readFile( - path.join(fixturesPath, 'MainActivity-no-delegate-updated.java'), - 'utf8' - ), - ]); - - const contents = setModulesMainActivity(rawContents, 'java'); - expect(contents).toEqual(expectContents); - // Try it twice... - const nextContents = setModulesMainActivity(contents, 'java'); - expect(nextContents).toEqual(expectContents); - }); - - it(`should add createReactActivityDelegate code block if not overridden yet - kotlin`, async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'MainActivity-no-delegate.kt'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'MainActivity-no-delegate-updated.kt'), 'utf8'), - ]); - - const contents = setModulesMainActivity(rawContents, 'kt'); - expect(contents).toEqual(expectContents); - // Try it twice... - const nextContents = setModulesMainActivity(contents, 'kt'); - expect(nextContents).toEqual(expectContents); - }); - - it(`should add ReactActivityDelegateWrapper for react-native@>=0.71.0 - java`, async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'MainActivity-rn071.java'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'MainActivity-rn071-updated.java'), 'utf8'), - ]); - - const contents = setModulesMainActivity(rawContents, 'java'); - expect(contents).toEqual(expectContents); - // Try it twice... - const nextContents = setModulesMainActivity(contents, 'java'); - expect(nextContents).toEqual(expectContents); - }); - - it(`should add ReactActivityDelegateWrapper for react-native@>=0.71.0 - kotlin`, async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'MainActivity-rn071.kt'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'MainActivity-rn071-updated.kt'), 'utf8'), - ]); - - const contents = setModulesMainActivity(rawContents, 'kt'); - expect(contents).toEqual(expectContents); - // Try it twice... - const nextContents = setModulesMainActivity(contents, 'kt'); - expect(nextContents).toEqual(expectContents); - }); - - it(`should add ReactActivityDelegateWrapper for react-native@>=0.68.0 - java`, async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'MainActivity-rn068.java'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'MainActivity-rn068-updated.java'), 'utf8'), - ]); - - const contents = setModulesMainActivity(rawContents, 'java'); - expect(contents).toEqual(expectContents); - // Try it twice... - const nextContents = setModulesMainActivity(contents, 'java'); - expect(nextContents).toEqual(expectContents); - }); - - it(`should add ReactActivityDelegateWrapper for react-native@>=0.68.0 - kotlin`, async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'MainActivity-rn068.kt'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'MainActivity-rn068-updated.kt'), 'utf8'), - ]); - - const contents = setModulesMainActivity(rawContents, 'kt'); - expect(contents).toEqual(expectContents); - // Try it twice... - const nextContents = setModulesMainActivity(contents, 'kt'); - expect(nextContents).toEqual(expectContents); - }); - - it(`should add ReactActivityDelegateWrapper for react-native@<0.68.0 - java`, async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'MainActivity-rn064.java'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'MainActivity-rn064-updated.java'), 'utf8'), - ]); - - const contents = setModulesMainActivity(rawContents, 'java'); - expect(contents).toEqual(expectContents); - // Try it twice... - const nextContents = setModulesMainActivity(contents, 'java'); - expect(nextContents).toEqual(expectContents); - }); - - it(`should add ReactActivityDelegateWrapper for react-native@<0.68.0 - kotlin`, async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'MainActivity-rn064.kt'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'MainActivity-rn064-updated.kt'), 'utf8'), - ]); - - const contents = setModulesMainActivity(rawContents, 'kt'); - expect(contents).toEqual(expectContents); - // Try it twice... - const nextContents = setModulesMainActivity(contents, 'kt'); - expect(nextContents).toEqual(expectContents); - }); - - it(`should add ReactActivityDelegateWrapper for anonymous class - java`, async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'MainActivity-anonymous-delegate.java'), 'utf8'), - fs.promises.readFile( - path.join(fixturesPath, 'MainActivity-anonymous-delegate-updated.java'), - 'utf8' - ), - ]); - - const contents = setModulesMainActivity(rawContents, 'java'); - expect(contents).toEqual(expectContents); - // Try it twice... - const nextContents = setModulesMainActivity(contents, 'java'); - expect(nextContents).toEqual(expectContents); - }); - - it(`should add ReactActivityDelegateWrapper for anonymous class - kotlin`, async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'MainActivity-anonymous-delegate.kt'), 'utf8'), - fs.promises.readFile( - path.join(fixturesPath, 'MainActivity-anonymous-delegate-updated.kt'), - 'utf8' - ), - ]); - - const contents = setModulesMainActivity(rawContents, 'kt'); - expect(contents).toEqual(expectContents); - // Try it twice... - const nextContents = setModulesMainActivity(contents, 'kt'); - expect(nextContents).toEqual(expectContents); - }); -}); diff --git a/packages/install-expo-modules/src/plugins/android/__tests__/withAndroidModulesMainApplication-test.ts b/packages/install-expo-modules/src/plugins/android/__tests__/withAndroidModulesMainApplication-test.ts deleted file mode 100644 index fafc8159ab..0000000000 --- a/packages/install-expo-modules/src/plugins/android/__tests__/withAndroidModulesMainApplication-test.ts +++ /dev/null @@ -1,60 +0,0 @@ -import fs from 'fs'; -import path from 'path'; - -import { setModulesMainApplication } from '../withAndroidModulesMainApplication'; - -const fixturesPath = path.resolve(__dirname, 'fixtures'); - -describe(setModulesMainApplication, () => { - it('should able to update from react-native@>=0.71.0 template', async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'MainApplication-rn071.java'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'MainApplication-rn071-updated.java'), 'utf8'), - ]); - - const contents = setModulesMainApplication(rawContents, 'java'); - expect(contents).toEqual(expectContents); - // Try it twice... - const nextContents = setModulesMainApplication(contents, 'java'); - expect(nextContents).toEqual(expectContents); - }); - - it('should able to update from react-native@>=0.68.0 template', async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'MainApplication-rn068.java'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'MainApplication-rn068-updated.java'), 'utf8'), - ]); - - const contents = setModulesMainApplication(rawContents, 'java'); - expect(contents).toEqual(expectContents); - // Try it twice... - const nextContents = setModulesMainApplication(contents, 'java'); - expect(nextContents).toEqual(expectContents); - }); - - it('should able to update from react-native@<0.68.0 template', async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'MainApplication-rn064.java'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'MainApplication-rn064-updated.java'), 'utf8'), - ]); - - const contents = setModulesMainApplication(rawContents, 'java'); - expect(contents).toEqual(expectContents); - // Try it twice... - const nextContents = setModulesMainApplication(contents, 'java'); - expect(nextContents).toEqual(expectContents); - }); - - it('should support another manually modified kotlin version MainApplication', async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'MainApplication-rn064.kt'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'MainApplication-rn064-updated.kt'), 'utf8'), - ]); - - const contents = setModulesMainApplication(rawContents, 'kt'); - expect(contents).toEqual(expectContents); - // Try it twice... - const nextContents = setModulesMainApplication(contents, 'kt'); - expect(nextContents).toEqual(expectContents); - }); -}); diff --git a/packages/install-expo-modules/src/plugins/android/withAndroidGradles.ts b/packages/install-expo-modules/src/plugins/android/withAndroidGradles.ts deleted file mode 100644 index ef561f6d4e..0000000000 --- a/packages/install-expo-modules/src/plugins/android/withAndroidGradles.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { ConfigPlugin, withProjectBuildGradle } from '@expo/config-plugins'; -import fs from 'fs'; -import path from 'path'; -import semver from 'semver'; - -// Because regexp //g is stateful, to use it multiple times, we should create a new one. -function createAgpRegExp() { - return /^(\s*classpath[(\s]["']com\.android\.tools\.build:gradle:)(\d+\.\d+\.\d+)(["'][)\s]\s*)$/gm; -} - -export async function shouldUpdateAgpVersionAsync(projectRoot: string, targetVersion: string) { - const gradlePath = path.join(projectRoot, 'android', 'build.gradle'); - const content = await fs.promises.readFile(gradlePath, 'utf-8'); - const matchResult = createAgpRegExp().exec(content); - if (!matchResult) { - console.warn( - 'Unrecognized `android/build.gradle` content, will skip the process to update AGP version.' - ); - return false; - } - - const version = matchResult[2]; - if (!version) { - console.warn( - 'Unrecognized `android/build.gradle` content, will skip the process to update AGP version.' - ); - return false; - } - - return semver.lt(toSemVer(version), toSemVer(targetVersion)); -} - -export const withAndroidGradlePluginVersion: ConfigPlugin<{ androidAgpVersion: string }> = ( - config, - prop -) => { - return withProjectBuildGradle(config, config => { - if (config.modResults.language !== 'groovy') { - throw new Error('Cannot setup kotlin because the build.gradle is not groovy'); - } - const matchResult = createAgpRegExp().exec(config.modResults.contents); - if (matchResult) { - const version = matchResult[2]; - if (version && semver.lt(toSemVer(version), toSemVer(prop.androidAgpVersion))) { - config.modResults.contents = config.modResults.contents.replace( - createAgpRegExp(), - (match, prefix, versionPart, suffix) => { - return `${prefix}${prop.androidAgpVersion}${suffix}`; - } - ); - } - } - return config; - }); -}; - -function toSemVer(version: string): semver.SemVer { - return semver.coerce(version) ?? new semver.SemVer('0.0.0'); -} diff --git a/packages/install-expo-modules/src/plugins/android/withAndroidModules.ts b/packages/install-expo-modules/src/plugins/android/withAndroidModules.ts deleted file mode 100644 index f7d1b72f81..0000000000 --- a/packages/install-expo-modules/src/plugins/android/withAndroidModules.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { ConfigPlugin, withPlugins, withSettingsGradle } from '@expo/config-plugins'; - -import { withAndroidModulesMainActivity } from './withAndroidModulesMainActivity'; -import { withAndroidModulesMainApplication } from './withAndroidModulesMainApplication'; - -export const withAndroidModules: ConfigPlugin = config => { - return withPlugins(config, [ - withAndroidModulesMainApplication, - withAndroidModulesMainActivity, - withAndroidModulesSettingGradle, - ]); -}; - -const withAndroidModulesSettingGradle: ConfigPlugin = config => { - return withSettingsGradle(config, config => { - if (config.modResults.contents.match('useExpoModules()')) { - return config; - } - - const isGroovy = config.modResults.language === 'groovy'; - const addCodeBlock = isGroovy - ? [ - 'apply from: new File(["node", "--print", "require.resolve(\'expo/package.json\')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle")', - 'useExpoModules()', - ] - : [ - 'val pathExpoPackageJson = org.codehaus.groovy.runtime.ProcessGroovyMethods.getText(org.codehaus.groovy.runtime.ProcessGroovyMethods.execute("node --print require.resolve(\'expo/package.json\')", null, rootDir))', - 'apply(from = File(pathExpoPackageJson.trim(), "../scripts/autolinking.gradle"))', - 'val useExpoModules = extra["useExpoModules"] as groovy.lang.Closure', - 'useExpoModules()', - ]; - - config.modResults.contents = config.modResults.contents + `\n${addCodeBlock.join('\n')}`; - return config; - }); -}; diff --git a/packages/install-expo-modules/src/plugins/android/withAndroidModulesMainActivity.ts b/packages/install-expo-modules/src/plugins/android/withAndroidModulesMainActivity.ts deleted file mode 100644 index 43e425b123..0000000000 --- a/packages/install-expo-modules/src/plugins/android/withAndroidModulesMainActivity.ts +++ /dev/null @@ -1,143 +0,0 @@ -import { ConfigPlugin, withMainActivity } from '@expo/config-plugins'; -import { - addImports, - appendContentsInsideDeclarationBlock, - findNewInstanceCodeBlock, -} from '@expo/config-plugins/build/android/codeMod'; -import { replaceContentsWithOffset } from '@expo/config-plugins/build/utils/commonCodeMod'; - -export const withAndroidModulesMainActivity: ConfigPlugin = config => { - return withMainActivity(config, config => { - config.modResults.contents = setModulesMainActivity( - config.modResults.contents, - config.modResults.language - ); - return config; - }); -}; - -export function setModulesMainActivity(mainActivity: string, language: 'java' | 'kt'): string { - const isJava = language === 'java'; - - if (mainActivity.match(/\s+ReactActivityDelegateWrapper\(/m) != null) { - // Early return if `ReactActivityDelegateWrapper` is already added. - return mainActivity; - } - - if (mainActivity.match(/\s+createReactActivityDelegate\(\)/m) == null) { - // If not override `createReactActivityDelegate()`, tries to override with wrapper - mainActivity = addImports( - mainActivity, - ['com.facebook.react.ReactActivityDelegate', 'expo.modules.ReactActivityDelegateWrapper'], - isJava - ); - - const addReactActivityDelegateBlock = isJava - ? [ - '\n @Override', - ' protected ReactActivityDelegate createReactActivityDelegate() {', - ' return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,', - ' new ReactActivityDelegate(this, getMainComponentName())', - ' );', - ' }\n', - ] - : [ - '\n override fun createReactActivityDelegate(): ReactActivityDelegate {', - ' return ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,', - ' ReactActivityDelegate(this, getMainComponentName())', - ' );', - ' }\n', - ]; - - mainActivity = appendContentsInsideDeclarationBlock( - mainActivity, - 'class MainActivity', - addReactActivityDelegateBlock.join('\n') - ); - } else if (mainActivity.match(/\bDefaultReactActivityDelegate\b/g)) { - // react-native@>=0.71 - - // If override `createReactActivityDelegate()` already, wrap it with `ReactActivityDelegateWrapper` - mainActivity = addImports(mainActivity, ['expo.modules.ReactActivityDelegateWrapper'], isJava); - - const newInstanceCodeBlock = findNewInstanceCodeBlock( - mainActivity, - 'DefaultReactActivityDelegate', - language - ); - if (newInstanceCodeBlock == null) { - throw new Error('Unable to find DefaultReactActivityDelegate new instance code block.'); - } - - const replacement = isJava - ? `new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, ${newInstanceCodeBlock.code})` - : `ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, ${newInstanceCodeBlock.code})`; - mainActivity = replaceContentsWithOffset( - mainActivity, - replacement, - newInstanceCodeBlock.start, - newInstanceCodeBlock.end - ); - - return mainActivity; - } else if ( - // java: public static class MainActivityDelegate extends ReactActivityDelegate { - mainActivity.match(/\s+MainActivityDelegate\s+extends\s+ReactActivityDelegate\s+\{/) != null || - // kotlin: class MainActivityDelegate(activity: ReactActivity?, mainComponentName: String?) : ReactActivityDelegate - mainActivity.match(/\s+MainActivityDelegate\(.+\)\s+:\s+ReactActivityDelegate.+\{/) != null - ) { - // react-native@>=0.68,<=0.70 - - // If override `createReactActivityDelegate()` already, wrap it with `ReactActivityDelegateWrapper` for react-native 0.68+ - mainActivity = addImports(mainActivity, ['expo.modules.ReactActivityDelegateWrapper'], isJava); - - const newInstanceCodeBlock = findNewInstanceCodeBlock( - mainActivity, - 'MainActivityDelegate', - language - ); - if (newInstanceCodeBlock == null) { - throw new Error('Unable to find MainActivityDelegate new instance code block.'); - } - - const replacement = isJava - ? `new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, ${newInstanceCodeBlock.code})` - : `ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, ${newInstanceCodeBlock.code})`; - mainActivity = replaceContentsWithOffset( - mainActivity, - replacement, - newInstanceCodeBlock.start, - newInstanceCodeBlock.end - ); - - return mainActivity; - } else { - // react-native@<0.68 - - // If override `createReactActivityDelegate()` already, wrap it with `ReactActivityDelegateWrapper` - mainActivity = addImports(mainActivity, ['expo.modules.ReactActivityDelegateWrapper'], isJava); - - const newInstanceCodeBlock = findNewInstanceCodeBlock( - mainActivity, - 'ReactActivityDelegate', - language - ); - if (newInstanceCodeBlock == null) { - throw new Error('Unable to find ReactActivityDelegate new instance code block.'); - } - - const replacement = isJava - ? `new ReactActivityDelegateWrapper(this, ${newInstanceCodeBlock.code})` - : `ReactActivityDelegateWrapper(this, ${newInstanceCodeBlock.code})`; - mainActivity = replaceContentsWithOffset( - mainActivity, - replacement, - newInstanceCodeBlock.start, - newInstanceCodeBlock.end - ); - - return mainActivity; - } - - return mainActivity; -} diff --git a/packages/install-expo-modules/src/plugins/android/withAndroidModulesMainApplication.ts b/packages/install-expo-modules/src/plugins/android/withAndroidModulesMainApplication.ts deleted file mode 100644 index 558da6680c..0000000000 --- a/packages/install-expo-modules/src/plugins/android/withAndroidModulesMainApplication.ts +++ /dev/null @@ -1,225 +0,0 @@ -import { ConfigPlugin, withMainApplication } from '@expo/config-plugins'; -import { - addImports, - appendContentsInsideDeclarationBlock, - findNewInstanceCodeBlock, -} from '@expo/config-plugins/build/android/codeMod'; -import { replaceContentsWithOffset } from '@expo/config-plugins/build/utils/commonCodeMod'; - -export const withAndroidModulesMainApplication: ConfigPlugin = config => { - return withMainApplication(config, config => { - config.modResults.contents = setModulesMainApplication( - config.modResults.contents, - config.modResults.language - ); - return config; - }); -}; - -export function setModulesMainApplication( - mainApplication: string, - language: 'java' | 'kt' -): string { - const isJava = language === 'java'; - - mainApplication = addDefaultReactNativeHostWrapperIfNeeded(mainApplication, language, isJava); - mainApplication = addReactNativeHostWrapperIfNeeded(mainApplication, language, isJava); - mainApplication = addReactNativeNewArchHostWrapperIfNeeded(mainApplication, language, isJava); - mainApplication = addApplicationLifecycleDispatchImportIfNeeded( - mainApplication, - language, - isJava - ); - mainApplication = addApplicationCreateIfNeeded(mainApplication, language, isJava); - mainApplication = addConfigurationChangeIfNeeded(mainApplication, language, isJava); - - return mainApplication; -} - -/** - * Add `ReactNativeHostWrapper` for `DefaultReactNativeHost`. - * For react-native@>=0.71 - */ -function addDefaultReactNativeHostWrapperIfNeeded( - mainApplication: string, - language: 'java' | 'kt', - isJava: boolean -): string { - // Early return when there's no `DefaultReactNativeHost`. - if (!mainApplication.match(/^import .*\.defaults\.DefaultReactNativeHost;?$/m)) { - return mainApplication; - } - - if (mainApplication.match(/\s+ReactNativeHostWrapper\(this,.*DefaultReactNativeHost\(/m)) { - return mainApplication; - } - - if (mainApplication.match(/\s+ReactNativeHostWrapper\(/m)) { - return mainApplication; - } - - mainApplication = addImports(mainApplication, ['expo.modules.ReactNativeHostWrapper'], isJava); - - const newInstanceCodeBlock = findNewInstanceCodeBlock( - mainApplication, - 'DefaultReactNativeHost', - language - ); - if (newInstanceCodeBlock == null) { - throw new Error('Unable to find DefaultReactNativeHost new instance code block.'); - } - - const replacement = isJava - ? `new ReactNativeHostWrapper(this, ${newInstanceCodeBlock.code})` - : `ReactNativeHostWrapper(this, ${newInstanceCodeBlock.code})`; - mainApplication = replaceContentsWithOffset( - mainApplication, - replacement, - newInstanceCodeBlock.start, - newInstanceCodeBlock.end - ); - return mainApplication; -} - -function addReactNativeHostWrapperIfNeeded( - mainApplication: string, - language: 'java' | 'kt', - isJava: boolean -): string { - if (mainApplication.match(/\s+ReactNativeHostWrapper\(/m)) { - return mainApplication; - } - - mainApplication = addImports(mainApplication, ['expo.modules.ReactNativeHostWrapper'], isJava); - - const newInstanceCodeBlock = findNewInstanceCodeBlock( - mainApplication, - 'ReactNativeHost', - language - ); - if (newInstanceCodeBlock == null) { - throw new Error('Unable to find ReactNativeHost new instance code block.'); - } - - const replacement = isJava - ? `new ReactNativeHostWrapper(this, ${newInstanceCodeBlock.code})` - : `ReactNativeHostWrapper(this, ${newInstanceCodeBlock.code})`; - mainApplication = replaceContentsWithOffset( - mainApplication, - replacement, - newInstanceCodeBlock.start, - newInstanceCodeBlock.end - ); - return mainApplication; -} - -function addReactNativeNewArchHostWrapperIfNeeded( - mainApplication: string, - language: 'java' | 'kt', - isJava: boolean -): string { - // Early return when there's no new arch `MainApplicationReactNativeHost`. - if (!mainApplication.match(/^import .*\.newarchitecture\.MainApplicationReactNativeHost;?$/m)) { - return mainApplication; - } - - if ( - mainApplication.match(/\s+ReactNativeHostWrapper\(this,.*MainApplicationReactNativeHost\(/m) - ) { - return mainApplication; - } - - mainApplication = addImports(mainApplication, ['expo.modules.ReactNativeHostWrapper'], isJava); - - const newInstanceCodeBlock = findNewInstanceCodeBlock( - mainApplication, - 'MainApplicationReactNativeHost', - language - ); - if (newInstanceCodeBlock == null) { - throw new Error('Unable to find ReactNativeHost new instance code block.'); - } - - const replacement = isJava - ? `new ReactNativeHostWrapper(this, ${newInstanceCodeBlock.code})` - : `ReactNativeHostWrapper(this, ${newInstanceCodeBlock.code})`; - mainApplication = replaceContentsWithOffset( - mainApplication, - replacement, - newInstanceCodeBlock.start, - newInstanceCodeBlock.end - ); - return mainApplication; -} - -function addApplicationLifecycleDispatchImportIfNeeded( - mainApplication: string, - language: 'java' | 'kt', - isJava: boolean -) { - if (mainApplication.match(/^import\s+expo\.modules\.ApplicationLifecycleDispatcher;?$/)) { - return mainApplication; - } - - return addImports(mainApplication, ['expo.modules.ApplicationLifecycleDispatcher'], isJava); -} - -function addApplicationCreateIfNeeded( - mainApplication: string, - language: 'java' | 'kt', - isJava: boolean -): string { - if (mainApplication.match(/\s+ApplicationLifecycleDispatcher\.onApplicationCreate\(/m)) { - return mainApplication; - } - - return appendContentsInsideDeclarationBlock( - mainApplication, - 'onCreate', - ` ApplicationLifecycleDispatcher.onApplicationCreate(this)${isJava ? ';' : ''}\n ` - ); -} - -function addConfigurationChangeIfNeeded( - mainApplication: string, - language: 'java' | 'kt', - isJava: boolean -): string { - if (mainApplication.match(/\s+onConfigurationChanged\(/m) == null) { - // If not override onConfigurationChanged() at all - mainApplication = addImports(mainApplication, ['android.content.res.Configuration'], isJava); - - const addConfigurationChangeBlock = isJava - ? [ - '\n @Override', - ' public void onConfigurationChanged(Configuration newConfig) {', - ' super.onConfigurationChanged(newConfig);', - ' ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);', - ' }\n', - ].join('\n') - : [ - '\n override fun onConfigurationChanged(newConfig: Configuration) {', - ' super.onConfigurationChanged(newConfig)', - ' ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)', - ' }\n', - ].join('\n'); - mainApplication = appendContentsInsideDeclarationBlock( - mainApplication, - 'class MainApplication', - addConfigurationChangeBlock - ); - } else if ( - mainApplication.match(/\s+ApplicationLifecycleDispatcher\.onConfigurationChanged\(/m) == null - ) { - // If override onConfigurationChanged() but no ApplicationLifecycleDispatcher yet - mainApplication = appendContentsInsideDeclarationBlock( - mainApplication, - 'onConfigurationChanged', - ` ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)${ - isJava ? ';' : '' - }\n ` - ); - } - - return mainApplication; -} diff --git a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/AppDelegate-rn072-updated.mm b/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/AppDelegate-rn072-updated.mm deleted file mode 100644 index 3f6ce9780b..0000000000 --- a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/AppDelegate-rn072-updated.mm +++ /dev/null @@ -1,26 +0,0 @@ -#import "AppDelegate.h" - -#import - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - self.moduleName = @"HelloWorld"; - // You can add your custom initial props in the dictionary below. - // They will be passed down to the ViewController used by React Native. - self.initialProps = @{}; - - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge -{ -#if DEBUG - return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@".expo/.virtual-metro-entry"]; -#else - return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; -#endif -} - -@end diff --git a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/AppDelegate-rn072.mm b/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/AppDelegate-rn072.mm deleted file mode 100644 index 3a11a56aae..0000000000 --- a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/AppDelegate-rn072.mm +++ /dev/null @@ -1,26 +0,0 @@ -#import "AppDelegate.h" - -#import - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - self.moduleName = @"HelloWorld"; - // You can add your custom initial props in the dictionary below. - // They will be passed down to the ViewController used by React Native. - self.initialProps = @{}; - - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge -{ -#if DEBUG - return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; -#else - return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; -#endif -} - -@end diff --git a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/MainApplication-rn072-updated.java b/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/MainApplication-rn072-updated.java deleted file mode 100644 index f856eae9a9..0000000000 --- a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/MainApplication-rn072-updated.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.helloworld; - -import android.app.Application; -import com.facebook.react.PackageList; -import com.facebook.react.ReactApplication; -import com.facebook.react.ReactNativeHost; -import com.facebook.react.ReactPackage; -import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint; -import com.facebook.react.defaults.DefaultReactNativeHost; -import com.facebook.soloader.SoLoader; -import java.util.List; - -public class MainApplication extends Application implements ReactApplication { - - private final ReactNativeHost mReactNativeHost = - new DefaultReactNativeHost(this) { - @Override - public boolean getUseDeveloperSupport() { - return BuildConfig.DEBUG; - } - - @Override - protected List getPackages() { - @SuppressWarnings("UnnecessaryLocalVariable") - List packages = new PackageList(this).getPackages(); - // Packages that cannot be autolinked yet can be added manually here, for example: - // packages.add(new MyReactNativePackage()); - return packages; - } - - @Override - protected String getJSMainModuleName() { - return ".expo/.virtual-metro-entry"; - } - - @Override - protected boolean isNewArchEnabled() { - return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; - } - - @Override - protected Boolean isHermesEnabled() { - return BuildConfig.IS_HERMES_ENABLED; - } - }; - - @Override - public ReactNativeHost getReactNativeHost() { - return mReactNativeHost; - } - - @Override - public void onCreate() { - super.onCreate(); - SoLoader.init(this, /* native exopackage */ false); - if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { - // If you opted-in for the New Architecture, we load the native entry point for this app. - DefaultNewArchitectureEntryPoint.load(); - } - ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); - } -} diff --git a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/MainApplication-rn072.java b/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/MainApplication-rn072.java deleted file mode 100644 index 3227c9e969..0000000000 --- a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/MainApplication-rn072.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.helloworld; - -import android.app.Application; -import com.facebook.react.PackageList; -import com.facebook.react.ReactApplication; -import com.facebook.react.ReactNativeHost; -import com.facebook.react.ReactPackage; -import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint; -import com.facebook.react.defaults.DefaultReactNativeHost; -import com.facebook.soloader.SoLoader; -import java.util.List; - -public class MainApplication extends Application implements ReactApplication { - - private final ReactNativeHost mReactNativeHost = - new DefaultReactNativeHost(this) { - @Override - public boolean getUseDeveloperSupport() { - return BuildConfig.DEBUG; - } - - @Override - protected List getPackages() { - @SuppressWarnings("UnnecessaryLocalVariable") - List packages = new PackageList(this).getPackages(); - // Packages that cannot be autolinked yet can be added manually here, for example: - // packages.add(new MyReactNativePackage()); - return packages; - } - - @Override - protected String getJSMainModuleName() { - return "index"; - } - - @Override - protected boolean isNewArchEnabled() { - return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; - } - - @Override - protected Boolean isHermesEnabled() { - return BuildConfig.IS_HERMES_ENABLED; - } - }; - - @Override - public ReactNativeHost getReactNativeHost() { - return mReactNativeHost; - } - - @Override - public void onCreate() { - super.onCreate(); - SoLoader.init(this, /* native exopackage */ false); - if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { - // If you opted-in for the New Architecture, we load the native entry point for this app. - DefaultNewArchitectureEntryPoint.load(); - } - ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); - } -} diff --git a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/appBuild-rn072-updated.gradle b/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/appBuild-rn072-updated.gradle deleted file mode 100644 index 45704d437d..0000000000 --- a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/appBuild-rn072-updated.gradle +++ /dev/null @@ -1,124 +0,0 @@ -apply plugin: "com.android.application" -apply plugin: "org.jetbrains.kotlin.android" -apply plugin: "com.facebook.react" - -/** - * This is the configuration block to customize your React Native Android app. - * By default you don't need to apply any configuration, just uncomment the lines you need. - */ -react { - /* Folders */ - // The root of your project, i.e. where "package.json" lives. Default is '..' - // root = file("../") - // The folder where the react-native NPM package is. Default is ../node_modules/react-native - // reactNativeDir = file("../node_modules/react-native") - // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen - // codegenDir = file("../node_modules/@react-native/codegen") - // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js - // cliFile = file("../node_modules/react-native/cli.js") - - /* Variants */ - // The list of variants to that are debuggable. For those we're going to - // skip the bundling of the JS bundle and the assets. By default is just 'debug'. - // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants. - // debuggableVariants = ["liteDebug", "prodDebug"] - - /* Bundling */ - // A list containing the node command and its flags. Default is just 'node'. - // nodeExecutableAndArgs = ["node"] - // - // The command to run when bundling. By default is 'bundle' - // bundleCommand = "ram-bundle" - // - // The path to the CLI configuration file. Default is empty. - // bundleConfig = file(../rn-cli.config.js) - // - // The name of the generated asset file containing your JS bundle - // bundleAssetName = "MyApplication.android.bundle" - // - // The entry file for bundle generation. Default is 'index.android.js' or 'index.js' - // entryFile = file("../js/MyApplication.android.js") - // - // A list of extra flags to pass to the 'bundle' commands. - // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle - // extraPackagerArgs = [] - - /* Hermes Commands */ - // The hermes compiler command to run. By default it is 'hermesc' - // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc" - // - // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" - // hermesFlags = ["-O", "-output-source-map"] - // - // Added by install-expo-modules - entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", rootDir.getAbsoluteFile().getParentFile().getAbsolutePath(), "android", "absolute"].execute(null, rootDir).text.trim()) - cliFile = new File(["node", "--print", "require.resolve('@expo/cli')"].execute(null, rootDir).text.trim()) - bundleCommand = "export:embed" -} - -/** - * Set this to true to Run Proguard on Release builds to minify the Java bytecode. - */ -def enableProguardInReleaseBuilds = false - -/** - * The preferred build flavor of JavaScriptCore (JSC) - * - * For example, to use the international variant, you can use: - * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` - * - * The international variant includes ICU i18n library and necessary data - * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that - * give correct results when using with locales other than en-US. Note that - * this variant is about 6MiB larger per architecture than default. - */ -def jscFlavor = 'org.webkit:android-jsc:+' - -android { - ndkVersion rootProject.ext.ndkVersion - - compileSdkVersion rootProject.ext.compileSdkVersion - - namespace "com.helloworld" - defaultConfig { - applicationId "com.helloworld" - minSdkVersion rootProject.ext.minSdkVersion - targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 1 - versionName "1.0" - } - signingConfigs { - debug { - storeFile file('debug.keystore') - storePassword 'android' - keyAlias 'androiddebugkey' - keyPassword 'android' - } - } - buildTypes { - debug { - signingConfig signingConfigs.debug - } - release { - // Caution! In production, you need to generate your own keystore file. - // see https://reactnative.dev/docs/signed-apk-android. - signingConfig signingConfigs.debug - minifyEnabled enableProguardInReleaseBuilds - proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" - } - } -} - -dependencies { - // The version of react-native is set by the React Native Gradle Plugin - implementation("com.facebook.react:react-android") - implementation("com.facebook.react:flipper-integration") - - if (hermesEnabled.toBoolean()) { - implementation("com.facebook.react:hermes-android") - } else { - implementation jscFlavor - } -} - -apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) diff --git a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/appBuild-rn072.gradle b/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/appBuild-rn072.gradle deleted file mode 100644 index 00e28c6f06..0000000000 --- a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/appBuild-rn072.gradle +++ /dev/null @@ -1,119 +0,0 @@ -apply plugin: "com.android.application" -apply plugin: "org.jetbrains.kotlin.android" -apply plugin: "com.facebook.react" - -/** - * This is the configuration block to customize your React Native Android app. - * By default you don't need to apply any configuration, just uncomment the lines you need. - */ -react { - /* Folders */ - // The root of your project, i.e. where "package.json" lives. Default is '..' - // root = file("../") - // The folder where the react-native NPM package is. Default is ../node_modules/react-native - // reactNativeDir = file("../node_modules/react-native") - // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen - // codegenDir = file("../node_modules/@react-native/codegen") - // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js - // cliFile = file("../node_modules/react-native/cli.js") - - /* Variants */ - // The list of variants to that are debuggable. For those we're going to - // skip the bundling of the JS bundle and the assets. By default is just 'debug'. - // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants. - // debuggableVariants = ["liteDebug", "prodDebug"] - - /* Bundling */ - // A list containing the node command and its flags. Default is just 'node'. - // nodeExecutableAndArgs = ["node"] - // - // The command to run when bundling. By default is 'bundle' - // bundleCommand = "ram-bundle" - // - // The path to the CLI configuration file. Default is empty. - // bundleConfig = file(../rn-cli.config.js) - // - // The name of the generated asset file containing your JS bundle - // bundleAssetName = "MyApplication.android.bundle" - // - // The entry file for bundle generation. Default is 'index.android.js' or 'index.js' - // entryFile = file("../js/MyApplication.android.js") - // - // A list of extra flags to pass to the 'bundle' commands. - // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle - // extraPackagerArgs = [] - - /* Hermes Commands */ - // The hermes compiler command to run. By default it is 'hermesc' - // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc" - // - // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" - // hermesFlags = ["-O", "-output-source-map"] -} - -/** - * Set this to true to Run Proguard on Release builds to minify the Java bytecode. - */ -def enableProguardInReleaseBuilds = false - -/** - * The preferred build flavor of JavaScriptCore (JSC) - * - * For example, to use the international variant, you can use: - * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` - * - * The international variant includes ICU i18n library and necessary data - * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that - * give correct results when using with locales other than en-US. Note that - * this variant is about 6MiB larger per architecture than default. - */ -def jscFlavor = 'org.webkit:android-jsc:+' - -android { - ndkVersion rootProject.ext.ndkVersion - - compileSdkVersion rootProject.ext.compileSdkVersion - - namespace "com.helloworld" - defaultConfig { - applicationId "com.helloworld" - minSdkVersion rootProject.ext.minSdkVersion - targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 1 - versionName "1.0" - } - signingConfigs { - debug { - storeFile file('debug.keystore') - storePassword 'android' - keyAlias 'androiddebugkey' - keyPassword 'android' - } - } - buildTypes { - debug { - signingConfig signingConfigs.debug - } - release { - // Caution! In production, you need to generate your own keystore file. - // see https://reactnative.dev/docs/signed-apk-android. - signingConfig signingConfigs.debug - minifyEnabled enableProguardInReleaseBuilds - proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" - } - } -} - -dependencies { - // The version of react-native is set by the React Native Gradle Plugin - implementation("com.facebook.react:react-android") - implementation("com.facebook.react:flipper-integration") - - if (hermesEnabled.toBoolean()) { - implementation("com.facebook.react:hermes-android") - } else { - implementation jscFlavor - } -} - -apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) diff --git a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/babel-config-rn072-updated.js b/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/babel-config-rn072-updated.js deleted file mode 100644 index fcb34864d8..0000000000 --- a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/babel-config-rn072-updated.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - presets: ['babel-preset-expo'], -}; diff --git a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/babel-config-rn072.js b/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/babel-config-rn072.js deleted file mode 100644 index f842b77fcf..0000000000 --- a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/babel-config-rn072.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - presets: ['module:metro-react-native-babel-preset'], -}; diff --git a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/metro-config-rn071.js b/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/metro-config-rn071.js deleted file mode 100644 index e91aba937c..0000000000 --- a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/metro-config-rn071.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Metro configuration for React Native - * https://github.com/facebook/react-native - * - * @format - */ - -module.exports = { - transformer: { - getTransformOptions: async () => ({ - transform: { - experimentalImportSupport: false, - inlineRequires: true, - }, - }), - }, -}; diff --git a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/metro-config-rn072-updated.js b/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/metro-config-rn072-updated.js deleted file mode 100644 index 0dfff204ec..0000000000 --- a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/metro-config-rn072-updated.js +++ /dev/null @@ -1,12 +0,0 @@ -const { getDefaultConfig } = require('expo/metro-config'); -const { mergeConfig } = require('@react-native/metro-config'); - -/** - * Metro configuration - * https://facebook.github.io/metro/docs/configuration - * - * @type {import('metro-config').MetroConfig} - */ -const config = {}; - -module.exports = mergeConfig(getDefaultConfig(__dirname), config); diff --git a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/metro-config-rn072.js b/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/metro-config-rn072.js deleted file mode 100644 index ab634150ba..0000000000 --- a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/metro-config-rn072.js +++ /dev/null @@ -1,11 +0,0 @@ -const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config'); - -/** - * Metro configuration - * https://facebook.github.io/metro/docs/configuration - * - * @type {import('metro-config').MetroConfig} - */ -const config = {}; - -module.exports = mergeConfig(getDefaultConfig(__dirname), config); diff --git a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/xcodeProject-rn072-updated.pbxproj b/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/xcodeProject-rn072-updated.pbxproj deleted file mode 100644 index 2b43c3d28b..0000000000 --- a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/xcodeProject-rn072-updated.pbxproj +++ /dev/null @@ -1,702 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 54; - objects = { - -/* Begin PBXBuildFile section */ - 00E356F31AD99517003FC87E /* HelloWorldTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* HelloWorldTests.m */; }; - 0C80B921A6F3F58F76C31292 /* libPods-HelloWorld.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-HelloWorld.a */; }; - 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; - 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; - 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 7699B88040F8A987B510C191 /* libPods-HelloWorld-HelloWorldTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-HelloWorld-HelloWorldTests.a */; }; - 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 83CBB9F71A601CBA00E9B192; - proxyType = 1; - remoteGlobalIDString = 13B07F861A680F5B00A75B9A; - remoteInfo = HelloWorld; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 00E356EE1AD99517003FC87E /* HelloWorldTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HelloWorldTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 00E356F21AD99517003FC87E /* HelloWorldTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HelloWorldTests.m; sourceTree = ""; }; - 13B07F961A680F5B00A75B9A /* HelloWorld.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloWorld.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = HelloWorld/AppDelegate.h; sourceTree = ""; }; - 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = HelloWorld/AppDelegate.mm; sourceTree = ""; }; - 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = HelloWorld/Images.xcassets; sourceTree = ""; }; - 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = HelloWorld/Info.plist; sourceTree = ""; }; - 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = HelloWorld/main.m; sourceTree = ""; }; - 19F6CBCC0A4E27FBF8BF4A61 /* libPods-HelloWorld-HelloWorldTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HelloWorld-HelloWorldTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 3B4392A12AC88292D35C810B /* Pods-HelloWorld.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld.debug.xcconfig"; path = "Target Support Files/Pods-HelloWorld/Pods-HelloWorld.debug.xcconfig"; sourceTree = ""; }; - 5709B34CF0A7D63546082F79 /* Pods-HelloWorld.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld.release.xcconfig"; path = "Target Support Files/Pods-HelloWorld/Pods-HelloWorld.release.xcconfig"; sourceTree = ""; }; - 5B7EB9410499542E8C5724F5 /* Pods-HelloWorld-HelloWorldTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld-HelloWorldTests.debug.xcconfig"; path = "Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests.debug.xcconfig"; sourceTree = ""; }; - 5DCACB8F33CDC322A6C60F78 /* libPods-HelloWorld.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HelloWorld.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = HelloWorld/LaunchScreen.storyboard; sourceTree = ""; }; - 89C6BE57DB24E9ADA2F236DE /* Pods-HelloWorld-HelloWorldTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld-HelloWorldTests.release.xcconfig"; path = "Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests.release.xcconfig"; sourceTree = ""; }; - ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 00E356EB1AD99517003FC87E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 7699B88040F8A987B510C191 /* libPods-HelloWorld-HelloWorldTests.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 0C80B921A6F3F58F76C31292 /* libPods-HelloWorld.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 00E356EF1AD99517003FC87E /* HelloWorldTests */ = { - isa = PBXGroup; - children = ( - 00E356F21AD99517003FC87E /* HelloWorldTests.m */, - 00E356F01AD99517003FC87E /* Supporting Files */, - ); - path = HelloWorldTests; - sourceTree = ""; - }; - 00E356F01AD99517003FC87E /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 00E356F11AD99517003FC87E /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 13B07FAE1A68108700A75B9A /* HelloWorld */ = { - isa = PBXGroup; - children = ( - 13B07FAF1A68108700A75B9A /* AppDelegate.h */, - 13B07FB01A68108700A75B9A /* AppDelegate.mm */, - 13B07FB51A68108700A75B9A /* Images.xcassets */, - 13B07FB61A68108700A75B9A /* Info.plist */, - 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, - 13B07FB71A68108700A75B9A /* main.m */, - ); - name = HelloWorld; - sourceTree = ""; - }; - 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { - isa = PBXGroup; - children = ( - ED297162215061F000B7C4FE /* JavaScriptCore.framework */, - 5DCACB8F33CDC322A6C60F78 /* libPods-HelloWorld.a */, - 19F6CBCC0A4E27FBF8BF4A61 /* libPods-HelloWorld-HelloWorldTests.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 832341AE1AAA6A7D00B99B32 /* Libraries */ = { - isa = PBXGroup; - children = ( - ); - name = Libraries; - sourceTree = ""; - }; - 83CBB9F61A601CBA00E9B192 /* PBXGroup */ = { - isa = PBXGroup; - children = ( - 13B07FAE1A68108700A75B9A /* HelloWorld */, - 832341AE1AAA6A7D00B99B32 /* Libraries */, - 00E356EF1AD99517003FC87E /* HelloWorldTests */, - 83CBBA001A601CBA00E9B192 /* Products */, - 2D16E6871FA4F8E400B85C8A /* Frameworks */, - BBD78D7AC51CEA395F1C20DB /* Pods */, - ); - indentWidth = 2; - sourceTree = ""; - tabWidth = 2; - usesTabs = 0; - }; - 83CBBA001A601CBA00E9B192 /* Products */ = { - isa = PBXGroup; - children = ( - 13B07F961A680F5B00A75B9A /* HelloWorld.app */, - 00E356EE1AD99517003FC87E /* HelloWorldTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - BBD78D7AC51CEA395F1C20DB /* Pods */ = { - isa = PBXGroup; - children = ( - 3B4392A12AC88292D35C810B /* Pods-HelloWorld.debug.xcconfig */, - 5709B34CF0A7D63546082F79 /* Pods-HelloWorld.release.xcconfig */, - 5B7EB9410499542E8C5724F5 /* Pods-HelloWorld-HelloWorldTests.debug.xcconfig */, - 89C6BE57DB24E9ADA2F236DE /* Pods-HelloWorld-HelloWorldTests.release.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 00E356ED1AD99517003FC87E /* HelloWorldTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "HelloWorldTests" */; - buildPhases = ( - A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */, - 00E356EA1AD99517003FC87E /* Sources */, - 00E356EB1AD99517003FC87E /* Frameworks */, - 00E356EC1AD99517003FC87E /* Resources */, - C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */, - F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - 00E356F51AD99517003FC87E /* PBXTargetDependency */, - ); - name = HelloWorldTests; - productName = HelloWorldTests; - productReference = 00E356EE1AD99517003FC87E /* HelloWorldTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 13B07F861A680F5B00A75B9A /* HelloWorld */ = { - isa = PBXNativeTarget; - buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "HelloWorld" */; - buildPhases = ( - C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */, - FD10A7F022414F080027D42C /* Start Packager */, - 13B07F871A680F5B00A75B9A /* Sources */, - 13B07F8C1A680F5B00A75B9A /* Frameworks */, - 13B07F8E1A680F5B00A75B9A /* Resources */, - 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, - 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */, - E235C05ADACE081382539298 /* [CP] Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = HelloWorld; - productName = HelloWorld; - productReference = 13B07F961A680F5B00A75B9A /* HelloWorld.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 83CBB9F71A601CBA00E9B192 = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1210; - TargetAttributes = { - 00E356ED1AD99517003FC87E = { - CreatedOnToolsVersion = 6.2; - TestTargetID = 13B07F861A680F5B00A75B9A /* HelloWorld */; - }; - 13B07F861A680F5B00A75B9A = { - LastSwiftMigration = 1120; - }; - }; - }; - buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "HelloWorld" */; - compatibilityVersion = "Xcode 12.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 83CBB9F61A601CBA00E9B192 /* PBXGroup */; - productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 13B07F861A680F5B00A75B9A /* HelloWorld */, - 00E356ED1AD99517003FC87E /* HelloWorldTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 00E356EC1AD99517003FC87E /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 13B07F8E1A680F5B00A75B9A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, - 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "$(SRCROOT)/.xcode.env.local", - "$(SRCROOT)/.xcode.env", - ); - name = "Bundle React Native code and images"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "if [[ -f \"$PODS_ROOT/../.xcode.env\" ]]; then\n source \"$PODS_ROOT/../.xcode.env\"\nfi\nif [[ -f \"$PODS_ROOT/../.xcode.env.local\" ]]; then\n source \"$PODS_ROOT/../.xcode.env.local\"\nfi\n\n# The project root by default is one level up from the ios directory\nexport PROJECT_ROOT=\"$PROJECT_DIR\"/..\n\nif [[ \"$CONFIGURATION\" = *Debug* ]]; then\n export SKIP_BUNDLING=1\nfi\nif [[ -z \"$ENTRY_FILE\" ]]; then\n # Set the entry JS file using the bundler's entry resolution.\n export ENTRY_FILE=\"$(\"$NODE_BINARY\" -e \"require('expo/scripts/resolveAppEntry')\" \"$PROJECT_ROOT\" ios relative | tail -n 1)\"\nfi\n\nif [[ -z \"$CLI_PATH\" ]]; then\n # Use Expo CLI\n export CLI_PATH=\"$(\"$NODE_BINARY\" --print \"require.resolve('@expo/cli')\")\"\nfi\nif [[ -z \"$BUNDLE_COMMAND\" ]]; then\n # Default Expo CLI command for bundling\n export BUNDLE_COMMAND=\"export:embed\"\nfi\n\n`\"$NODE_BINARY\" --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\"`\n"; - }; - 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-HelloWorld-HelloWorldTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-HelloWorld-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - FD10A7F022414F080027D42C /* Start Packager */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = "Start Packager"; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "if [[ -f \"$PODS_ROOT/../.xcode.env\" ]]; then\n source \"$PODS_ROOT/../.xcode.env\"\nfi\nif [[ -f \"$PODS_ROOT/../.xcode.env.local\" ]]; then\n source \"$PODS_ROOT/../.xcode.env.local\"\nfi\n\nexport RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > `$NODE_BINARY --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/.packager.env'\"`\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open `$NODE_BINARY --print \"require('path').dirname(require.resolve('expo/package.json')) + '/scripts/launchPackager.command'\"` || echo \"Can't start packager automatically\"\n fi\nfi\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 00E356EA1AD99517003FC87E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 00E356F31AD99517003FC87E /* HelloWorldTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 13B07F871A680F5B00A75B9A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */, - 13B07FC11A68108700A75B9A /* main.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 13B07F861A680F5B00A75B9A /* HelloWorld */; - targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 00E356F61AD99517003FC87E /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-HelloWorld-HelloWorldTests.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = HelloWorldTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.4; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - OTHER_LDFLAGS = ( - "-ObjC", - "-lc++", - "$(inherited)", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HelloWorld.app/HelloWorld"; - }; - name = Debug; - }; - 00E356F71AD99517003FC87E /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-HelloWorld-HelloWorldTests.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - COPY_PHASE_STRIP = NO; - INFOPLIST_FILE = HelloWorldTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.4; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - OTHER_LDFLAGS = ( - "-ObjC", - "-lc++", - "$(inherited)", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HelloWorld.app/HelloWorld"; - }; - name = Release; - }; - 13B07F941A680F5B00A75B9A /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-HelloWorld.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 1; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = HelloWorld/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - OTHER_LDFLAGS = ( - "$(inherited)", - "-ObjC", - "-lc++", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = HelloWorld; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 13B07F951A680F5B00A75B9A /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-HelloWorld.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 1; - INFOPLIST_FILE = HelloWorld/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - OTHER_LDFLAGS = ( - "$(inherited)", - "-ObjC", - "-lc++", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = HelloWorld; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; - 83CBBA201A601CBA00E9B192 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_CXX_LANGUAGE_STANDARD = "c++17"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.4; - LD_RUNPATH_SEARCH_PATHS = ( - /usr/lib/swift, - "$(inherited)", - ); - LIBRARY_SEARCH_PATHS = ( - "\"$(SDKROOT)/usr/lib/swift\"", - "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", - "\"$(inherited)\"", - ); - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - OTHER_CPLUSPLUSFLAGS = ( - "$(OTHER_CFLAGS)", - "-DFOLLY_NO_CONFIG", - "-DFOLLY_MOBILE=1", - "-DFOLLY_USE_LIBCPP=1", - ); - SDKROOT = iphoneos; - }; - name = Debug; - }; - 83CBBA211A601CBA00E9B192 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_CXX_LANGUAGE_STANDARD = "c++17"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.4; - LD_RUNPATH_SEARCH_PATHS = ( - /usr/lib/swift, - "$(inherited)", - ); - LIBRARY_SEARCH_PATHS = ( - "\"$(SDKROOT)/usr/lib/swift\"", - "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", - "\"$(inherited)\"", - ); - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_CPLUSPLUSFLAGS = ( - "$(OTHER_CFLAGS)", - "-DFOLLY_NO_CONFIG", - "-DFOLLY_MOBILE=1", - "-DFOLLY_USE_LIBCPP=1", - ); - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "HelloWorldTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 00E356F61AD99517003FC87E /* Debug */, - 00E356F71AD99517003FC87E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "HelloWorld" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 13B07F941A680F5B00A75B9A /* Debug */, - 13B07F951A680F5B00A75B9A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "HelloWorld" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 83CBBA201A601CBA00E9B192 /* Debug */, - 83CBBA211A601CBA00E9B192 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 83CBB9F71A601CBA00E9B192; -} diff --git a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/xcodeProject-rn072.pbxproj b/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/xcodeProject-rn072.pbxproj deleted file mode 100644 index 2ad5879633..0000000000 --- a/packages/install-expo-modules/src/plugins/cli/__tests__/fixtures/xcodeProject-rn072.pbxproj +++ /dev/null @@ -1,702 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 54; - objects = { - -/* Begin PBXBuildFile section */ - 00E356F31AD99517003FC87E /* HelloWorldTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* HelloWorldTests.m */; }; - 0C80B921A6F3F58F76C31292 /* libPods-HelloWorld.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-HelloWorld.a */; }; - 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; - 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; - 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 7699B88040F8A987B510C191 /* libPods-HelloWorld-HelloWorldTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-HelloWorld-HelloWorldTests.a */; }; - 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 13B07F861A680F5B00A75B9A; - remoteInfo = HelloWorld; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 00E356EE1AD99517003FC87E /* HelloWorldTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HelloWorldTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 00E356F21AD99517003FC87E /* HelloWorldTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HelloWorldTests.m; sourceTree = ""; }; - 13B07F961A680F5B00A75B9A /* HelloWorld.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloWorld.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = HelloWorld/AppDelegate.h; sourceTree = ""; }; - 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = HelloWorld/AppDelegate.mm; sourceTree = ""; }; - 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = HelloWorld/Images.xcassets; sourceTree = ""; }; - 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = HelloWorld/Info.plist; sourceTree = ""; }; - 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = HelloWorld/main.m; sourceTree = ""; }; - 19F6CBCC0A4E27FBF8BF4A61 /* libPods-HelloWorld-HelloWorldTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HelloWorld-HelloWorldTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 3B4392A12AC88292D35C810B /* Pods-HelloWorld.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld.debug.xcconfig"; path = "Target Support Files/Pods-HelloWorld/Pods-HelloWorld.debug.xcconfig"; sourceTree = ""; }; - 5709B34CF0A7D63546082F79 /* Pods-HelloWorld.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld.release.xcconfig"; path = "Target Support Files/Pods-HelloWorld/Pods-HelloWorld.release.xcconfig"; sourceTree = ""; }; - 5B7EB9410499542E8C5724F5 /* Pods-HelloWorld-HelloWorldTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld-HelloWorldTests.debug.xcconfig"; path = "Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests.debug.xcconfig"; sourceTree = ""; }; - 5DCACB8F33CDC322A6C60F78 /* libPods-HelloWorld.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HelloWorld.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = HelloWorld/LaunchScreen.storyboard; sourceTree = ""; }; - 89C6BE57DB24E9ADA2F236DE /* Pods-HelloWorld-HelloWorldTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld-HelloWorldTests.release.xcconfig"; path = "Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests.release.xcconfig"; sourceTree = ""; }; - ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 00E356EB1AD99517003FC87E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 7699B88040F8A987B510C191 /* libPods-HelloWorld-HelloWorldTests.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 0C80B921A6F3F58F76C31292 /* libPods-HelloWorld.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 00E356EF1AD99517003FC87E /* HelloWorldTests */ = { - isa = PBXGroup; - children = ( - 00E356F21AD99517003FC87E /* HelloWorldTests.m */, - 00E356F01AD99517003FC87E /* Supporting Files */, - ); - path = HelloWorldTests; - sourceTree = ""; - }; - 00E356F01AD99517003FC87E /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 00E356F11AD99517003FC87E /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 13B07FAE1A68108700A75B9A /* HelloWorld */ = { - isa = PBXGroup; - children = ( - 13B07FAF1A68108700A75B9A /* AppDelegate.h */, - 13B07FB01A68108700A75B9A /* AppDelegate.mm */, - 13B07FB51A68108700A75B9A /* Images.xcassets */, - 13B07FB61A68108700A75B9A /* Info.plist */, - 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, - 13B07FB71A68108700A75B9A /* main.m */, - ); - name = HelloWorld; - sourceTree = ""; - }; - 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { - isa = PBXGroup; - children = ( - ED297162215061F000B7C4FE /* JavaScriptCore.framework */, - 5DCACB8F33CDC322A6C60F78 /* libPods-HelloWorld.a */, - 19F6CBCC0A4E27FBF8BF4A61 /* libPods-HelloWorld-HelloWorldTests.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 832341AE1AAA6A7D00B99B32 /* Libraries */ = { - isa = PBXGroup; - children = ( - ); - name = Libraries; - sourceTree = ""; - }; - 83CBB9F61A601CBA00E9B192 = { - isa = PBXGroup; - children = ( - 13B07FAE1A68108700A75B9A /* HelloWorld */, - 832341AE1AAA6A7D00B99B32 /* Libraries */, - 00E356EF1AD99517003FC87E /* HelloWorldTests */, - 83CBBA001A601CBA00E9B192 /* Products */, - 2D16E6871FA4F8E400B85C8A /* Frameworks */, - BBD78D7AC51CEA395F1C20DB /* Pods */, - ); - indentWidth = 2; - sourceTree = ""; - tabWidth = 2; - usesTabs = 0; - }; - 83CBBA001A601CBA00E9B192 /* Products */ = { - isa = PBXGroup; - children = ( - 13B07F961A680F5B00A75B9A /* HelloWorld.app */, - 00E356EE1AD99517003FC87E /* HelloWorldTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - BBD78D7AC51CEA395F1C20DB /* Pods */ = { - isa = PBXGroup; - children = ( - 3B4392A12AC88292D35C810B /* Pods-HelloWorld.debug.xcconfig */, - 5709B34CF0A7D63546082F79 /* Pods-HelloWorld.release.xcconfig */, - 5B7EB9410499542E8C5724F5 /* Pods-HelloWorld-HelloWorldTests.debug.xcconfig */, - 89C6BE57DB24E9ADA2F236DE /* Pods-HelloWorld-HelloWorldTests.release.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 00E356ED1AD99517003FC87E /* HelloWorldTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "HelloWorldTests" */; - buildPhases = ( - A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */, - 00E356EA1AD99517003FC87E /* Sources */, - 00E356EB1AD99517003FC87E /* Frameworks */, - 00E356EC1AD99517003FC87E /* Resources */, - C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */, - F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - 00E356F51AD99517003FC87E /* PBXTargetDependency */, - ); - name = HelloWorldTests; - productName = HelloWorldTests; - productReference = 00E356EE1AD99517003FC87E /* HelloWorldTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 13B07F861A680F5B00A75B9A /* HelloWorld */ = { - isa = PBXNativeTarget; - buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "HelloWorld" */; - buildPhases = ( - C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */, - FD10A7F022414F080027D42C /* Start Packager */, - 13B07F871A680F5B00A75B9A /* Sources */, - 13B07F8C1A680F5B00A75B9A /* Frameworks */, - 13B07F8E1A680F5B00A75B9A /* Resources */, - 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, - 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */, - E235C05ADACE081382539298 /* [CP] Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = HelloWorld; - productName = HelloWorld; - productReference = 13B07F961A680F5B00A75B9A /* HelloWorld.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 83CBB9F71A601CBA00E9B192 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1210; - TargetAttributes = { - 00E356ED1AD99517003FC87E = { - CreatedOnToolsVersion = 6.2; - TestTargetID = 13B07F861A680F5B00A75B9A; - }; - 13B07F861A680F5B00A75B9A = { - LastSwiftMigration = 1120; - }; - }; - }; - buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "HelloWorld" */; - compatibilityVersion = "Xcode 12.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 83CBB9F61A601CBA00E9B192; - productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 13B07F861A680F5B00A75B9A /* HelloWorld */, - 00E356ED1AD99517003FC87E /* HelloWorldTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 00E356EC1AD99517003FC87E /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 13B07F8E1A680F5B00A75B9A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, - 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "$(SRCROOT)/.xcode.env.local", - "$(SRCROOT)/.xcode.env", - ); - name = "Bundle React Native code and images"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n"; - }; - 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-HelloWorld-HelloWorldTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-HelloWorld-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - FD10A7F022414F080027D42C /* Start Packager */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = "Start Packager"; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 00E356EA1AD99517003FC87E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 00E356F31AD99517003FC87E /* HelloWorldTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 13B07F871A680F5B00A75B9A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */, - 13B07FC11A68108700A75B9A /* main.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 13B07F861A680F5B00A75B9A /* HelloWorld */; - targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 00E356F61AD99517003FC87E /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-HelloWorld-HelloWorldTests.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = HelloWorldTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.4; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - OTHER_LDFLAGS = ( - "-ObjC", - "-lc++", - "$(inherited)", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HelloWorld.app/HelloWorld"; - }; - name = Debug; - }; - 00E356F71AD99517003FC87E /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-HelloWorld-HelloWorldTests.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - COPY_PHASE_STRIP = NO; - INFOPLIST_FILE = HelloWorldTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.4; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - OTHER_LDFLAGS = ( - "-ObjC", - "-lc++", - "$(inherited)", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HelloWorld.app/HelloWorld"; - }; - name = Release; - }; - 13B07F941A680F5B00A75B9A /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-HelloWorld.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 1; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = HelloWorld/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - OTHER_LDFLAGS = ( - "$(inherited)", - "-ObjC", - "-lc++", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = HelloWorld; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 13B07F951A680F5B00A75B9A /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-HelloWorld.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 1; - INFOPLIST_FILE = HelloWorld/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - OTHER_LDFLAGS = ( - "$(inherited)", - "-ObjC", - "-lc++", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = HelloWorld; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; - 83CBBA201A601CBA00E9B192 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_CXX_LANGUAGE_STANDARD = "c++17"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.4; - LD_RUNPATH_SEARCH_PATHS = ( - /usr/lib/swift, - "$(inherited)", - ); - LIBRARY_SEARCH_PATHS = ( - "\"$(SDKROOT)/usr/lib/swift\"", - "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", - "\"$(inherited)\"", - ); - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - OTHER_CPLUSPLUSFLAGS = ( - "$(OTHER_CFLAGS)", - "-DFOLLY_NO_CONFIG", - "-DFOLLY_MOBILE=1", - "-DFOLLY_USE_LIBCPP=1", - ); - SDKROOT = iphoneos; - }; - name = Debug; - }; - 83CBBA211A601CBA00E9B192 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_CXX_LANGUAGE_STANDARD = "c++17"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.4; - LD_RUNPATH_SEARCH_PATHS = ( - /usr/lib/swift, - "$(inherited)", - ); - LIBRARY_SEARCH_PATHS = ( - "\"$(SDKROOT)/usr/lib/swift\"", - "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", - "\"$(inherited)\"", - ); - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_CPLUSPLUSFLAGS = ( - "$(OTHER_CFLAGS)", - "-DFOLLY_NO_CONFIG", - "-DFOLLY_MOBILE=1", - "-DFOLLY_USE_LIBCPP=1", - ); - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "HelloWorldTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 00E356F61AD99517003FC87E /* Debug */, - 00E356F71AD99517003FC87E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "HelloWorld" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 13B07F941A680F5B00A75B9A /* Debug */, - 13B07F951A680F5B00A75B9A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "HelloWorld" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 83CBBA201A601CBA00E9B192 /* Debug */, - 83CBBA211A601CBA00E9B192 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; -} diff --git a/packages/install-expo-modules/src/plugins/cli/__tests__/withCliIntegration-test.ts b/packages/install-expo-modules/src/plugins/cli/__tests__/withCliIntegration-test.ts deleted file mode 100644 index 0e35f2bfde..0000000000 --- a/packages/install-expo-modules/src/plugins/cli/__tests__/withCliIntegration-test.ts +++ /dev/null @@ -1,115 +0,0 @@ -import fs from 'fs'; -import path from 'path'; -import { ISA, PBXShellScriptBuildPhase, build as xcbuild, parse as xcparse } from 'xcparse'; - -import { - updateAndroidGradleFile, - updateBabelConfig, - updateGitIgnore, - updateIosXcodeProjectBuildPhase, - updateMetroConfig, - updateVirtualMetroEntryAndroid, - updateVirtualMetroEntryIos, -} from '../withCliIntegration'; - -const fixturesPath = path.resolve(__dirname, 'fixtures'); - -describe(updateAndroidGradleFile, () => { - it('should update the `android/app/build.gradle` file', async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'appBuild-rn072.gradle'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'appBuild-rn072-updated.gradle'), 'utf8'), - ]); - expect(updateAndroidGradleFile(rawContents)).toEqual(expectContents); - }); -}); - -describe(updateBabelConfig, () => { - it('should update the `babel.config.js` file', async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'babel-config-rn072.js'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'babel-config-rn072-updated.js'), 'utf8'), - ]); - expect(updateBabelConfig(rawContents)).toEqual(expectContents); - }); -}); - -describe(updateMetroConfig, () => { - it('should update the `metro.config.js` file', async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'metro-config-rn072.js'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'metro-config-rn072-updated.js'), 'utf8'), - ]); - expect(updateMetroConfig(rawContents)).toEqual(expectContents); - }); - - it('should show warning if the `metro.config.js` content is unrecognized', async () => { - const rawContents = await fs.promises.readFile( - path.join(fixturesPath, 'metro-config-rn071.js'), - 'utf8' - ); - const spy = jest.spyOn(console, 'warn'); - expect(updateMetroConfig(rawContents)).toEqual(rawContents); - expect(spy).toBeCalled(); - }); -}); - -describe(updateVirtualMetroEntryAndroid, () => { - it('should update the `MainApplication.java` for virtual-metro-point', async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'MainApplication-rn072.java'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'MainApplication-rn072-updated.java'), 'utf8'), - ]); - expect(updateVirtualMetroEntryAndroid(rawContents)).toEqual(expectContents); - }); -}); - -describe(updateVirtualMetroEntryIos, () => { - it('should update the `AppDelegate.mm` for virtual-metro-point', async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'AppDelegate-rn072.mm'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'AppDelegate-rn072-updated.mm'), 'utf8'), - ]); - expect(updateVirtualMetroEntryIos(rawContents)).toEqual(expectContents); - }); -}); - -describe(updateIosXcodeProjectBuildPhase, () => { - it('should update the `ios/{projectName}.xcodeproj/project.pbxproj` file', async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'xcodeProject-rn072.pbxproj'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'xcodeProject-rn072-updated.pbxproj'), 'utf8'), - ]); - const pbxproj = xcparse(rawContents); - for (const section of Object.values(pbxproj.objects ?? {})) { - if (section.isa === ISA.PBXShellScriptBuildPhase) { - updateIosXcodeProjectBuildPhase(section as PBXShellScriptBuildPhase); - } - } - expect(xcbuild(pbxproj)).toEqual(expectContents); - }); -}); - -describe(updateGitIgnore, () => { - it('should update the `.gitignore` file', async () => { - const rawContents = `\ -# node.js -# -node_modules/ -npm-debug.log -yarn-error.log -`; - expect(updateGitIgnore(rawContents)).toMatchInlineSnapshot(` - "# node.js - # - node_modules/ - npm-debug.log - yarn-error.log - - # Expo - .expo - dist/ - web-build/" - `); - }); -}); diff --git a/packages/install-expo-modules/src/plugins/cli/withCliIntegration.ts b/packages/install-expo-modules/src/plugins/cli/withCliIntegration.ts deleted file mode 100644 index 7e2ad32fc0..0000000000 --- a/packages/install-expo-modules/src/plugins/cli/withCliIntegration.ts +++ /dev/null @@ -1,222 +0,0 @@ -import { - ConfigPlugin, - withAppBuildGradle, - withAppDelegate, - withDangerousMod, - withMainApplication, - withPlugins, -} from '@expo/config-plugins'; -import { appendContentsInsideDeclarationBlock } from '@expo/config-plugins/build/android/codeMod'; -import fs from 'fs'; -import path from 'path'; -import { ISA, PBXShellScriptBuildPhase } from 'xcparse'; - -import { withXCParseXcodeProject } from '../ios/withXCParseXcodeProject'; - -export const withCliIntegration: ConfigPlugin = config => { - return withPlugins(config, [ - withCliAndroidGradle, - withCliAndroidMainApplication, - withCliIosAppDelegate, - withCliIosXcodeProject, - withCliBabelConfig, - withCliMetroConfig, - withCliGitIgnore, - ]); -}; - -const withCliAndroidGradle: ConfigPlugin = config => { - return withAppBuildGradle(config, config => { - if (config.modResults.language !== 'groovy') { - throw new Error('Cannot setup kotlin because the build.gradle is not groovy'); - } - config.modResults.contents = updateAndroidGradleFile(config.modResults.contents); - return config; - }); -}; - -const withCliAndroidMainApplication: ConfigPlugin = config => { - return withMainApplication(config, config => { - config.modResults.contents = updateVirtualMetroEntryAndroid(config.modResults.contents); - return config; - }); -}; - -const withCliIosAppDelegate: ConfigPlugin = config => { - return withAppDelegate(config, config => { - config.modResults.contents = updateVirtualMetroEntryIos(config.modResults.contents); - return config; - }); -}; - -const withCliIosXcodeProject: ConfigPlugin = config => { - return withXCParseXcodeProject(config, config => { - const pbxproj = config.modResults; - for (const section of Object.values(pbxproj.objects ?? {})) { - if (section.isa === ISA.PBXShellScriptBuildPhase) { - updateIosXcodeProjectBuildPhase(section as PBXShellScriptBuildPhase); - } - } - return config; - }); -}; - -const withCliBabelConfig: ConfigPlugin = config => { - return withDangerousMod(config, [ - 'ios', - async config => { - const babelConfigPath = path.join(config.modRequest.projectRoot, 'babel.config.js'); - let contents = await fs.promises.readFile(babelConfigPath, 'utf8'); - contents = updateBabelConfig(contents); - await fs.promises.writeFile(babelConfigPath, contents); - return config; - }, - ]); -}; - -const withCliMetroConfig: ConfigPlugin = config => { - return withDangerousMod(config, [ - 'ios', - async config => { - const metroConfigPath = path.join(config.modRequest.projectRoot, 'metro.config.js'); - let contents = await fs.promises.readFile(metroConfigPath, 'utf8'); - contents = updateMetroConfig(contents); - await fs.promises.writeFile(metroConfigPath, contents); - return config; - }, - ]); -}; - -const withCliGitIgnore: ConfigPlugin = config => { - return withDangerousMod(config, [ - 'ios', - async config => { - const gitIgnorePath = path.join(config.modRequest.projectRoot, '.gitignore'); - let contents = await fs.promises.readFile(gitIgnorePath, 'utf8'); - contents = updateGitIgnore(contents); - await fs.promises.writeFile(gitIgnorePath, contents); - return config; - }, - ]); -}; - -export function updateAndroidGradleFile(contents: string): string { - const cliContents = `\ - // - // Added by install-expo-modules - entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", rootDir.getAbsoluteFile().getParentFile().getAbsolutePath(), "android", "absolute"].execute(null, rootDir).text.trim()) - cliFile = new File(["node", "--print", "require.resolve('@expo/cli')"].execute(null, rootDir).text.trim()) - bundleCommand = "export:embed"\n`; - if (contents.indexOf(cliContents) === -1) { - contents = appendContentsInsideDeclarationBlock(contents, 'react', cliContents); - } - return contents; -} - -export function updateBabelConfig(contents: string): string { - return contents.replace(/['"]module:metro-react-native-babel-preset['"]/g, `'babel-preset-expo'`); -} - -export function updateMetroConfig(contents: string): string { - const searchPattern = /^const \{\s*getDefaultConfig, mergeConfig\s*\} = require\('@react-native\/metro-config'\);$/m; - if (!contents.match(searchPattern)) { - console.warn( - '⚠️ Unrecognized `metro.config.js` content, will skip the process to update `metro.config.js`. Please manually update the contents to use the `getDefaultConfig()` from `expo/metro-config`.' - ); - return contents; - } - return contents.replace( - searchPattern, - `\ -const { getDefaultConfig } = require('expo/metro-config'); -const { mergeConfig } = require('@react-native/metro-config');` - ); -} - -export function updateVirtualMetroEntryAndroid(contents: string): string { - return contents.replace(/^(\s*return\s+")(index)(";?)$/m, `$1.expo/.virtual-metro-entry$3`); -} - -export function updateVirtualMetroEntryIos(contents: string): string { - return contents.replace( - /^(\s*return.*RCTBundleURLProvider.*jsBundleURLForBundleRoot:@")(index)(".*;)$/m, - `$1.expo/.virtual-metro-entry$3` - ); -} - -export function updateIosXcodeProjectBuildPhase( - section: PBXShellScriptBuildPhase -): PBXShellScriptBuildPhase { - if (section.name === 'Start Packager') { - section.shellScript = `\ -if [[ -f "$PODS_ROOT/../.xcode.env" ]]; then - source "$PODS_ROOT/../.xcode.env" -fi -if [[ -f "$PODS_ROOT/../.xcode.env.local" ]]; then - source "$PODS_ROOT/../.xcode.env.local" -fi - -export RCT_METRO_PORT="\${RCT_METRO_PORT:=8081}" -echo "export RCT_METRO_PORT=\${RCT_METRO_PORT}" > \`$NODE_BINARY --print "require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/.packager.env'"\` -if [ -z "\${RCT_NO_LAUNCH_PACKAGER+xxx}" ] ; then - if nc -w 5 -z localhost \${RCT_METRO_PORT} ; then - if ! curl -s "http://localhost:\${RCT_METRO_PORT}/status" | grep -q "packager-status:running" ; then - echo "Port \${RCT_METRO_PORT} already in use, packager is either not running or not running correctly" - exit 2 - fi - else - open \`$NODE_BINARY --print "require('path').dirname(require.resolve('expo/package.json')) + '/scripts/launchPackager.command'"\` || echo "Can't start packager automatically" - fi -fi -`; - } - - if (section.name === 'Bundle React Native code and images') { - section.shellScript = `\ -if [[ -f "$PODS_ROOT/../.xcode.env" ]]; then - source "$PODS_ROOT/../.xcode.env" -fi -if [[ -f "$PODS_ROOT/../.xcode.env.local" ]]; then - source "$PODS_ROOT/../.xcode.env.local" -fi - -# The project root by default is one level up from the ios directory -export PROJECT_ROOT="$PROJECT_DIR"/.. - -if [[ "$CONFIGURATION" = *Debug* ]]; then - export SKIP_BUNDLING=1 -fi -if [[ -z "$ENTRY_FILE" ]]; then - # Set the entry JS file using the bundler's entry resolution. - export ENTRY_FILE="$("$NODE_BINARY" -e "require('expo/scripts/resolveAppEntry')" "$PROJECT_ROOT" ios relative | tail -n 1)" -fi - -if [[ -z "$CLI_PATH" ]]; then - # Use Expo CLI - export CLI_PATH="$("$NODE_BINARY" --print "require.resolve('@expo/cli')")" -fi -if [[ -z "$BUNDLE_COMMAND" ]]; then - # Default Expo CLI command for bundling - export BUNDLE_COMMAND="export:embed" -fi - -\`"$NODE_BINARY" --print "require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'"\` -`; - } - - return section; -} - -export function updateGitIgnore(contents: string): string { - if (contents.match(/^\.expo$/m)) { - return contents; - } - return ( - contents + - ` -# Expo -.expo -dist/ -web-build/` - ); -} diff --git a/packages/install-expo-modules/src/plugins/ios/__tests__/__snapshots__/withIosModulesAppDelegate-test.ts.snap b/packages/install-expo-modules/src/plugins/ios/__tests__/__snapshots__/withIosModulesAppDelegate-test.ts.snap deleted file mode 100644 index 805f337189..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/__tests__/__snapshots__/withIosModulesAppDelegate-test.ts.snap +++ /dev/null @@ -1,189 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`withIosModulesAppDelegate sdkVersion snapshots sdkVersion 43.0.0 1`] = ` -"#import -#import -#import - -@interface AppDelegate : EXAppDelegateWrapper - -@property (nonatomic, strong) UIWindow *window; - -@end -" -`; - -exports[`withIosModulesAppDelegate sdkVersion snapshots sdkVersion 43.0.0 2`] = ` -"#import \\"AppDelegate.h\\" - -#import -#import -#import - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ -#ifdef FB_SONARKIT_ENABLED - InitializeFlipper(application); -#endif - - RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; - RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge - moduleName:@\\"RN0633\\" - initialProperties:nil]; - - rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; - - self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - UIViewController *rootViewController = [UIViewController new]; - rootViewController.view = rootView; - self.window.rootViewController = rootViewController; - [self.window makeKeyAndVisible]; - [super application:application didFinishLaunchingWithOptions:launchOptions]; - return YES; -} - -- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge -{ -#if DEBUG - return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\\"index\\" fallbackResource:nil]; -#else - return [[NSBundle mainBundle] URLForResource:@\\"main\\" withExtension:@\\"jsbundle\\"]; -#endif -} - -@end -" -`; - -exports[`withIosModulesAppDelegate sdkVersion snapshots sdkVersion 43.0.0 3`] = ` -"import UIKit - -@UIApplicationMain -class AppDelegate: AppDelegateWrapper, RCTBridgeDelegate { - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - let bridge = RCTBridge(delegate: self, launchOptions: launchOptions)! - let rootView = RCTRootView(bridge: bridge, moduleName: \\"HelloWorld\\", initialProperties: nil) - - if #available(iOS 13.0, *) { - rootView.backgroundColor = UIColor.systemBackground - } else { - rootView.backgroundColor = UIColor.white - } - - self.window = UIWindow(frame: UIScreen.main.bounds); - let rootViewController = UIViewController() - rootViewController.view = rootView - self.window?.rootViewController = rootViewController - self.window?.makeKeyAndVisible() - super.application(application, didFinishLaunchingWithOptions: launchOptions) - return true - } - - func sourceURL(for bridge: RCTBridge!) -> URL! { - #if DEBUG - return RCTBundleURLProvider.sharedSettings()?.jsBundleURL(forBundleRoot: \\"index\\", fallbackResource: nil) - #else - return Bundle.main.url(forResource: \\"main\\", withExtension: \\"jsBundle\\") - #endif - } -} -" -`; - -exports[`withIosModulesAppDelegate sdkVersion snapshots sdkVersion 44.0.0 1`] = ` -"#import -#import -#import - -@interface AppDelegate : EXAppDelegateWrapper - -@property (nonatomic, strong) UIWindow *window; - -@end -" -`; - -exports[`withIosModulesAppDelegate sdkVersion snapshots sdkVersion 44.0.0 2`] = ` -"#import \\"AppDelegate.h\\" - -#import -#import -#import - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ -#ifdef FB_SONARKIT_ENABLED - InitializeFlipper(application); -#endif - - RCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self launchOptions:launchOptions]; - RCTRootView *rootView = [self.reactDelegate createRootViewWithBridge:bridge - moduleName:@\\"RN0633\\" - initialProperties:nil]; - - rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; - - self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - UIViewController *rootViewController = [self.reactDelegate createRootViewController]; - rootViewController.view = rootView; - self.window.rootViewController = rootViewController; - [self.window makeKeyAndVisible]; - [super application:application didFinishLaunchingWithOptions:launchOptions]; - return YES; -} - -- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge -{ -#if DEBUG - return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\\"index\\" fallbackResource:nil]; -#else - return [[NSBundle mainBundle] URLForResource:@\\"main\\" withExtension:@\\"jsbundle\\"]; -#endif -} - -@end -" -`; - -exports[`withIosModulesAppDelegate sdkVersion snapshots sdkVersion 44.0.0 3`] = ` -"import UIKit - -@UIApplicationMain -class AppDelegate: AppDelegateWrapper, RCTBridgeDelegate { - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - let bridge = reactDelegate.createBridge(delegate: self, launchOptions: launchOptions)! - let rootView = reactDelegate.createRootView(bridge: bridge, moduleName: \\"HelloWorld\\", initialProperties: nil) - - if #available(iOS 13.0, *) { - rootView.backgroundColor = UIColor.systemBackground - } else { - rootView.backgroundColor = UIColor.white - } - - self.window = UIWindow(frame: UIScreen.main.bounds); - let rootViewController = reactDelegate.createRootViewController() - rootViewController.view = rootView - self.window?.rootViewController = rootViewController - self.window?.makeKeyAndVisible() - super.application(application, didFinishLaunchingWithOptions: launchOptions) - return true - } - - func sourceURL(for bridge: RCTBridge!) -> URL! { - #if DEBUG - return RCTBundleURLProvider.sharedSettings()?.jsBundleURL(forBundleRoot: \\"index\\", fallbackResource: nil) - #else - return Bundle.main.url(forResource: \\"main\\", withExtension: \\"jsBundle\\") - #endif - } -} -" -`; diff --git a/packages/install-expo-modules/src/plugins/ios/__tests__/__snapshots__/withIosModulesPodfile-test.ts.snap b/packages/install-expo-modules/src/plugins/ios/__tests__/__snapshots__/withIosModulesPodfile-test.ts.snap deleted file mode 100644 index b2219a45ee..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/__tests__/__snapshots__/withIosModulesPodfile-test.ts.snap +++ /dev/null @@ -1,86 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`withIosModulesPodfile sdkVersion snapshots sdkVersion 43.0.0 1`] = ` -"require File.join(File.dirname(\`node --print \\"require.resolve('expo/package.json')\\"\`), \\"scripts/autolinking\\") -require_relative '../node_modules/react-native/scripts/react_native_pods' -require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' - -platform :ios, '10.0' - -target 'HelloWorld' do - use_expo_modules! - config = use_native_modules! - - use_react_native!(:path => config[\\"reactNativePath\\"]) - - target 'HelloWorldTests' do - inherit! :complete - # Pods for testing - end - - # Enables Flipper. - # - # Note that if you have use_frameworks! enabled, Flipper will not work and - # you should disable these next few lines. - use_flipper! - post_install do |installer| - flipper_post_install(installer) - end -end - -target 'HelloWorld-tvOS' do - # Pods for HelloWorld-tvOS - - target 'HelloWorld-tvOSTests' do - inherit! :search_paths - # Pods for testing - end -end -" -`; - -exports[`withIosModulesPodfile sdkVersion snapshots sdkVersion 44.0.0 1`] = ` -"require File.join(File.dirname(\`node --print \\"require.resolve('expo/package.json')\\"\`), \\"scripts/autolinking\\") -require_relative '../node_modules/react-native/scripts/react_native_pods' -require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' - -platform :ios, '10.0' - -target 'HelloWorld' do - use_expo_modules! - post_integrate do |installer| - begin - expo_patch_react_imports!(installer) - rescue => e - Pod::UI.warn e - end - end - config = use_native_modules! - - use_react_native!(:path => config[\\"reactNativePath\\"]) - - target 'HelloWorldTests' do - inherit! :complete - # Pods for testing - end - - # Enables Flipper. - # - # Note that if you have use_frameworks! enabled, Flipper will not work and - # you should disable these next few lines. - use_flipper! - post_install do |installer| - flipper_post_install(installer) - end -end - -target 'HelloWorld-tvOS' do - # Pods for HelloWorld-tvOS - - target 'HelloWorld-tvOSTests' do - inherit! :search_paths - # Pods for testing - end -end -" -`; diff --git a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-rn068-updated.mm b/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-rn068-updated.mm deleted file mode 100644 index e79d80b6be..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-rn068-updated.mm +++ /dev/null @@ -1,109 +0,0 @@ -#import "AppDelegate.h" - -#import -#import -#import - -#import - -#if RCT_NEW_ARCH_ENABLED -#import -#import -#import -#import -#import -#import - -#import - -@interface AppDelegate () { - RCTTurboModuleManager *_turboModuleManager; - RCTSurfacePresenterBridgeAdapter *_bridgeAdapter; - std::shared_ptr _reactNativeConfig; - facebook::react::ContextContainer::Shared _contextContainer; -} -@end -#endif - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - RCTAppSetupPrepareApp(application); - - RCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self launchOptions:launchOptions]; - -#if RCT_NEW_ARCH_ENABLED - _contextContainer = std::make_shared(); - _reactNativeConfig = std::make_shared(); - _contextContainer->insert("ReactNativeConfig", _reactNativeConfig); - _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer]; - bridge.surfacePresenter = _bridgeAdapter.surfacePresenter; -#endif - - UIView *rootView = [self.reactDelegate createRootViewWithBridge:bridge moduleName:@"HelloWorld" initialProperties:nil]; - - if (@available(iOS 13.0, *)) { - rootView.backgroundColor = [UIColor systemBackgroundColor]; - } else { - rootView.backgroundColor = [UIColor whiteColor]; - } - - self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - UIViewController *rootViewController = [self.reactDelegate createRootViewController]; - rootViewController.view = rootView; - self.window.rootViewController = rootViewController; - [self.window makeKeyAndVisible]; - [super application:application didFinishLaunchingWithOptions:launchOptions]; - return YES; -} - -- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge -{ -#if DEBUG - return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; -#else - return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; -#endif -} - -#if RCT_NEW_ARCH_ENABLED - -#pragma mark - RCTCxxBridgeDelegate - -- (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge -{ - _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge - delegate:self - jsInvoker:bridge.jsCallInvoker]; - return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager); -} - -#pragma mark RCTTurboModuleManagerDelegate - -- (Class)getModuleClassFromName:(const char *)name -{ - return RCTCoreModulesClassProvider(name); -} - -- (std::shared_ptr)getTurboModule:(const std::string &)name - jsInvoker:(std::shared_ptr)jsInvoker -{ - return nullptr; -} - -- (std::shared_ptr)getTurboModule:(const std::string &)name - initParams: - (const facebook::react::ObjCTurboModule::InitParams &)params -{ - return nullptr; -} - -- (id)getModuleInstanceFromClass:(Class)moduleClass -{ - return RCTAppSetupDefaultModuleFromClass(moduleClass); -} - -#endif - -@end diff --git a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-rn068.mm b/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-rn068.mm deleted file mode 100644 index cef8d202e8..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-rn068.mm +++ /dev/null @@ -1,108 +0,0 @@ -#import "AppDelegate.h" - -#import -#import -#import - -#import - -#if RCT_NEW_ARCH_ENABLED -#import -#import -#import -#import -#import -#import - -#import - -@interface AppDelegate () { - RCTTurboModuleManager *_turboModuleManager; - RCTSurfacePresenterBridgeAdapter *_bridgeAdapter; - std::shared_ptr _reactNativeConfig; - facebook::react::ContextContainer::Shared _contextContainer; -} -@end -#endif - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - RCTAppSetupPrepareApp(application); - - RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; - -#if RCT_NEW_ARCH_ENABLED - _contextContainer = std::make_shared(); - _reactNativeConfig = std::make_shared(); - _contextContainer->insert("ReactNativeConfig", _reactNativeConfig); - _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer]; - bridge.surfacePresenter = _bridgeAdapter.surfacePresenter; -#endif - - UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"HelloWorld", nil); - - if (@available(iOS 13.0, *)) { - rootView.backgroundColor = [UIColor systemBackgroundColor]; - } else { - rootView.backgroundColor = [UIColor whiteColor]; - } - - self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - UIViewController *rootViewController = [UIViewController new]; - rootViewController.view = rootView; - self.window.rootViewController = rootViewController; - [self.window makeKeyAndVisible]; - return YES; -} - -- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge -{ -#if DEBUG - return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; -#else - return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; -#endif -} - -#if RCT_NEW_ARCH_ENABLED - -#pragma mark - RCTCxxBridgeDelegate - -- (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge -{ - _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge - delegate:self - jsInvoker:bridge.jsCallInvoker]; - return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager); -} - -#pragma mark RCTTurboModuleManagerDelegate - -- (Class)getModuleClassFromName:(const char *)name -{ - return RCTCoreModulesClassProvider(name); -} - -- (std::shared_ptr)getTurboModule:(const std::string &)name - jsInvoker:(std::shared_ptr)jsInvoker -{ - return nullptr; -} - -- (std::shared_ptr)getTurboModule:(const std::string &)name - initParams: - (const facebook::react::ObjCTurboModule::InitParams &)params -{ - return nullptr; -} - -- (id)getModuleInstanceFromClass:(Class)moduleClass -{ - return RCTAppSetupDefaultModuleFromClass(moduleClass); -} - -#endif - -@end diff --git a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-rn071-updated.h b/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-rn071-updated.h deleted file mode 100644 index a7ebb518ad..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-rn071-updated.h +++ /dev/null @@ -1,7 +0,0 @@ -#import -#import -#import - -@interface AppDelegate : EXAppDelegateWrapper - -@end diff --git a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-rn071.h b/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-rn071.h deleted file mode 100644 index 5d2808256c..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-rn071.h +++ /dev/null @@ -1,6 +0,0 @@ -#import -#import - -@interface AppDelegate : RCTAppDelegate - -@end diff --git a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-rn071.mm b/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-rn071.mm deleted file mode 100644 index 6edcfa5188..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-rn071.mm +++ /dev/null @@ -1,32 +0,0 @@ -#import "AppDelegate.h" - -#import - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - self.moduleName = @"HelloWorld"; - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge -{ -#if DEBUG - return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; -#else - return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; -#endif -} - -/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off. -/// -/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html -/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture). -/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`. -- (BOOL)concurrentRootEnabled -{ - return true; -} - -@end diff --git a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-updated.h b/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-updated.h deleted file mode 100644 index d3d75b0b4b..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-updated.h +++ /dev/null @@ -1,9 +0,0 @@ -#import -#import -#import - -@interface AppDelegate : EXAppDelegateWrapper - -@property (nonatomic, strong) UIWindow *window; - -@end diff --git a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-updated.m b/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-updated.m deleted file mode 100644 index dfd3a1bd4c..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-updated.m +++ /dev/null @@ -1,40 +0,0 @@ -#import "AppDelegate.h" - -#import -#import -#import - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ -#ifdef FB_SONARKIT_ENABLED - InitializeFlipper(application); -#endif - - RCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self launchOptions:launchOptions]; - RCTRootView *rootView = [self.reactDelegate createRootViewWithBridge:bridge - moduleName:@"RN0633" - initialProperties:nil]; - - rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; - - self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - UIViewController *rootViewController = [self.reactDelegate createRootViewController]; - rootViewController.view = rootView; - self.window.rootViewController = rootViewController; - [self.window makeKeyAndVisible]; - [super application:application didFinishLaunchingWithOptions:launchOptions]; - return YES; -} - -- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge -{ -#if DEBUG - return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; -#else - return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; -#endif -} - -@end diff --git a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-updated.swift b/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-updated.swift deleted file mode 100644 index 6e8c2c3083..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate-updated.swift +++ /dev/null @@ -1,33 +0,0 @@ -import UIKit - -@UIApplicationMain -class AppDelegate: AppDelegateWrapper, RCTBridgeDelegate { - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - let bridge = reactDelegate.createBridge(delegate: self, launchOptions: launchOptions)! - let rootView = reactDelegate.createRootView(bridge: bridge, moduleName: "HelloWorld", initialProperties: nil) - - if #available(iOS 13.0, *) { - rootView.backgroundColor = UIColor.systemBackground - } else { - rootView.backgroundColor = UIColor.white - } - - self.window = UIWindow(frame: UIScreen.main.bounds); - let rootViewController = reactDelegate.createRootViewController() - rootViewController.view = rootView - self.window?.rootViewController = rootViewController - self.window?.makeKeyAndVisible() - super.application(application, didFinishLaunchingWithOptions: launchOptions) - return true - } - - func sourceURL(for bridge: RCTBridge!) -> URL! { - #if DEBUG - return RCTBundleURLProvider.sharedSettings()?.jsBundleURL(forBundleRoot: "index", fallbackResource: nil) - #else - return Bundle.main.url(forResource: "main", withExtension: "jsBundle") - #endif - } -} diff --git a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate.h b/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate.h deleted file mode 100644 index ef1de86a2a..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate.h +++ /dev/null @@ -1,8 +0,0 @@ -#import -#import - -@interface AppDelegate : UIResponder - -@property (nonatomic, strong) UIWindow *window; - -@end diff --git a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate.m b/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate.m deleted file mode 100644 index 5f889f6ea5..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate.m +++ /dev/null @@ -1,39 +0,0 @@ -#import "AppDelegate.h" - -#import -#import -#import - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ -#ifdef FB_SONARKIT_ENABLED - InitializeFlipper(application); -#endif - - RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; - RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge - moduleName:@"RN0633" - initialProperties:nil]; - - rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; - - self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - UIViewController *rootViewController = [UIViewController new]; - rootViewController.view = rootView; - self.window.rootViewController = rootViewController; - [self.window makeKeyAndVisible]; - return YES; -} - -- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge -{ -#if DEBUG - return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; -#else - return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; -#endif -} - -@end diff --git a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate.swift b/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate.swift deleted file mode 100644 index 5894ebf341..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/AppDelegate.swift +++ /dev/null @@ -1,32 +0,0 @@ -import UIKit - -@UIApplicationMain -class AppDelegate: NSObject, UIApplicationDelegate, RCTBridgeDelegate { - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - let bridge = RCTBridge(delegate: self, launchOptions: launchOptions)! - let rootView = RCTRootView(bridge: bridge, moduleName: "HelloWorld", initialProperties: nil) - - if #available(iOS 13.0, *) { - rootView.backgroundColor = UIColor.systemBackground - } else { - rootView.backgroundColor = UIColor.white - } - - self.window = UIWindow(frame: UIScreen.main.bounds); - let rootViewController = UIViewController() - rootViewController.view = rootView - self.window?.rootViewController = rootViewController - self.window?.makeKeyAndVisible() - return true - } - - func sourceURL(for bridge: RCTBridge!) -> URL! { - #if DEBUG - return RCTBundleURLProvider.sharedSettings()?.jsBundleURL(forBundleRoot: "index", fallbackResource: nil) - #else - return Bundle.main.url(forResource: "main", withExtension: "jsBundle") - #endif - } -} diff --git a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile b/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile deleted file mode 100644 index 6e1ebd6181..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile +++ /dev/null @@ -1,33 +0,0 @@ -require_relative '../node_modules/react-native/scripts/react_native_pods' -require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' - -platform :ios, '10.0' - -target 'HelloWorld' do - config = use_native_modules! - - use_react_native!(:path => config["reactNativePath"]) - - target 'HelloWorldTests' do - inherit! :complete - # Pods for testing - end - - # Enables Flipper. - # - # Note that if you have use_frameworks! enabled, Flipper will not work and - # you should disable these next few lines. - use_flipper! - post_install do |installer| - flipper_post_install(installer) - end -end - -target 'HelloWorld-tvOS' do - # Pods for HelloWorld-tvOS - - target 'HelloWorld-tvOSTests' do - inherit! :search_paths - # Pods for testing - end -end diff --git a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile-rn071 b/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile-rn071 deleted file mode 100644 index 72b98d9244..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile-rn071 +++ /dev/null @@ -1,51 +0,0 @@ -require_relative '../node_modules/react-native/scripts/react_native_pods' -require_relative '../node_modules/react-native/scripts/native_modules' - -platform :ios, min_ios_version_supported -prepare_react_native_project! - -flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled - -linkage = ENV['USE_FRAMEWORKS'] -if linkage != nil - Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green - use_frameworks! :linkage => linkage.to_sym -end - -target 'HelloWorld' do - config = use_native_modules! - - # Flags change depending on the env values. - flags = get_default_flags() - - use_react_native!( - :path => config[:reactNativePath], - # Hermes is now enabled by default. Disable by setting this flag to false. - # Upcoming versions of React Native may rely on get_default_flags(), but - # we make it explicit here to aid in the React Native upgrade process. - :hermes_enabled => flags[:hermes_enabled], - :fabric_enabled => flags[:fabric_enabled], - # Enables Flipper. - # - # Note that if you have use_frameworks! enabled, Flipper will not work and - # you should disable the next line. - :flipper_configuration => flipper_config, - # An absolute path to your application root. - :app_path => "#{Pod::Config.instance.installation_root}/.." - ) - - target 'HelloWorldTests' do - inherit! :complete - # Pods for testing - end - - post_install do |installer| - react_native_post_install( - installer, - # Set `mac_catalyst_enabled` to `true` in order to apply patches - # necessary for Mac Catalyst builds - :mac_catalyst_enabled => false - ) - __apply_Xcode_12_5_M1_post_install_workaround(installer) - end -end diff --git a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile-rn071-updated b/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile-rn071-updated deleted file mode 100644 index 55dc7c1008..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile-rn071-updated +++ /dev/null @@ -1,60 +0,0 @@ -require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking") -require_relative '../node_modules/react-native/scripts/react_native_pods' -require_relative '../node_modules/react-native/scripts/native_modules' - -platform :ios, min_ios_version_supported -prepare_react_native_project! - -flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled - -linkage = ENV['USE_FRAMEWORKS'] -if linkage != nil - Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green - use_frameworks! :linkage => linkage.to_sym -end - -target 'HelloWorld' do - use_expo_modules! - post_integrate do |installer| - begin - expo_patch_react_imports!(installer) - rescue => e - Pod::UI.warn e - end - end - config = use_native_modules! - - # Flags change depending on the env values. - flags = get_default_flags() - - use_react_native!( - :path => config[:reactNativePath], - # Hermes is now enabled by default. Disable by setting this flag to false. - # Upcoming versions of React Native may rely on get_default_flags(), but - # we make it explicit here to aid in the React Native upgrade process. - :hermes_enabled => flags[:hermes_enabled], - :fabric_enabled => flags[:fabric_enabled], - # Enables Flipper. - # - # Note that if you have use_frameworks! enabled, Flipper will not work and - # you should disable the next line. - :flipper_configuration => flipper_config, - # An absolute path to your application root. - :app_path => "#{Pod::Config.instance.installation_root}/.." - ) - - target 'HelloWorldTests' do - inherit! :complete - # Pods for testing - end - - post_install do |installer| - react_native_post_install( - installer, - # Set `mac_catalyst_enabled` to `true` in order to apply patches - # necessary for Mac Catalyst builds - :mac_catalyst_enabled => false - ) - __apply_Xcode_12_5_M1_post_install_workaround(installer) - end -end diff --git a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile-updated b/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile-updated deleted file mode 100644 index 2153261463..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile-updated +++ /dev/null @@ -1,42 +0,0 @@ -require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking") -require_relative '../node_modules/react-native/scripts/react_native_pods' -require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' - -platform :ios, '10.0' - -target 'HelloWorld' do - use_expo_modules! - post_integrate do |installer| - begin - expo_patch_react_imports!(installer) - rescue => e - Pod::UI.warn e - end - end - config = use_native_modules! - - use_react_native!(:path => config["reactNativePath"]) - - target 'HelloWorldTests' do - inherit! :complete - # Pods for testing - end - - # Enables Flipper. - # - # Note that if you have use_frameworks! enabled, Flipper will not work and - # you should disable these next few lines. - use_flipper! - post_install do |installer| - flipper_post_install(installer) - end -end - -target 'HelloWorld-tvOS' do - # Pods for HelloWorld-tvOS - - target 'HelloWorld-tvOSTests' do - inherit! :search_paths - # Pods for testing - end -end diff --git a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile-with-post-integrate b/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile-with-post-integrate deleted file mode 100644 index fe1da1741e..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile-with-post-integrate +++ /dev/null @@ -1,9 +0,0 @@ -target 'HelloWorld' do - config = use_native_modules! - - use_react_native!(:path => config["reactNativePath"]) - - post_integrate do |installer| - puts "Existing post_integrate hook" - end -end diff --git a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile-with-post-integrate-updated b/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile-with-post-integrate-updated deleted file mode 100644 index 17846a839d..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/__tests__/fixtures/Podfile-with-post-integrate-updated +++ /dev/null @@ -1,16 +0,0 @@ -require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking") -target 'HelloWorld' do - use_expo_modules! - config = use_native_modules! - - use_react_native!(:path => config["reactNativePath"]) - - post_integrate do |installer| - begin - expo_patch_react_imports!(installer) - rescue => e - Pod::UI.warn e - end - puts "Existing post_integrate hook" - end -end diff --git a/packages/install-expo-modules/src/plugins/ios/__tests__/withIosDeploymentTarget-test.ts b/packages/install-expo-modules/src/plugins/ios/__tests__/withIosDeploymentTarget-test.ts deleted file mode 100644 index a78594cedf..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/__tests__/withIosDeploymentTarget-test.ts +++ /dev/null @@ -1,195 +0,0 @@ -import fs from 'fs'; -import resolveFrom from 'resolve-from'; - -import { - shouldUpdateDeployTargetPodfileAsync, - updateDeploymentTargetPodfile, -} from '../withIosDeploymentTarget'; - -jest.mock('fs', () => ({ promises: { readFile: jest.fn() } })); -jest.mock('resolve-from'); - -describe(updateDeploymentTargetPodfile, () => { - beforeEach(() => { - jest.resetAllMocks(); - const mockResolve = resolveFrom.silent as jest.MockedFunction; - mockResolve.mockReturnValue('/app/node_modules/react-native/scripts/react_native_pods.rb'); - }); - - it('should update deployment target in Podfile', async () => { - const contents = `\ -platform :ios, '10.0' - -target 'HelloWorld' do - use_react_native!( - :path => config[:reactNativePath] - ) -end -`; - - const expectContents = `\ -platform :ios, '12.0' - -target 'HelloWorld' do - use_react_native!( - :path => config[:reactNativePath] - ) -end -`; - expect(await updateDeploymentTargetPodfile('/app', contents, '12.0')).toEqual(expectContents); - }); - - it(`should replace react-native's min_ios_version_supported if we need higher version`, async () => { - const reactNativePodsRubyContent = `\ -def min_ios_version_supported - return '12.4' -end`; - (fs.promises.readFile as jest.Mock).mockResolvedValue(reactNativePodsRubyContent); - const contents = `\ -platform :ios, min_ios_version_supported - -target 'HelloWorld' do - use_react_native!( - :path => config[:reactNativePath] - ) -end -`; - - const expectContents = `\ -platform :ios, '13.0' - -target 'HelloWorld' do - use_react_native!( - :path => config[:reactNativePath] - ) -end -`; - expect(await updateDeploymentTargetPodfile('/app', contents, '13.0')).toEqual(expectContents); - }); - - it('should support multiple deployment targets in Podfile', async () => { - const contents = `\ -target 'HelloWorld' do - platform :ios, '10.0' - use_react_native!( - :path => config[:reactNativePath] - ) -end - -target 'HelloWorld2' do - platform :ios, '9.0' - use_react_native!( - :path => config[:reactNativePath] - ) -end -`; - - const expectContents = `\ -target 'HelloWorld' do - platform :ios, '12.0' - use_react_native!( - :path => config[:reactNativePath] - ) -end - -target 'HelloWorld2' do - platform :ios, '12.0' - use_react_native!( - :path => config[:reactNativePath] - ) -end -`; - expect(await updateDeploymentTargetPodfile('/app', contents, '12.0')).toEqual(expectContents); - }); - - it('should leave unmodified if deployment target meets requirements', async () => { - const contents = `\ -platform :ios, '12.0' - -target 'HelloWorld' do - use_react_native!( - :path => config[:reactNativePath] - ) -end -`; - - expect(await updateDeploymentTargetPodfile('/app', contents, '12.0')).toEqual(contents); - }); - - it(`should leave unmodified if react-native's min_ios_version_supported meets requirement`, async () => { - const reactNativePodsRubyContent = `\ -def min_ios_version_supported - return '12.4' -end`; - (fs.promises.readFile as jest.Mock).mockResolvedValue(reactNativePodsRubyContent); - const contents = `\ -platform :ios, min_ios_version_supported - -target 'HelloWorld' do - use_react_native!( - :path => config[:reactNativePath] - ) -end -`; - - expect(await updateDeploymentTargetPodfile('/app', contents, '12.0')).toEqual(contents); - }); -}); - -describe(shouldUpdateDeployTargetPodfileAsync, () => { - beforeEach(() => { - jest.resetAllMocks(); - const mockResolve = resolveFrom.silent as jest.MockedFunction; - mockResolve.mockReturnValue('/app/node_modules/react-native/scripts/react_native_pods.rb'); - }); - - it('should returns true when target version is higher than current version', async () => { - const podfileContent = `platform :ios, '11.0'`; - (fs.promises.readFile as jest.Mock).mockResolvedValue(podfileContent); - - const result = await shouldUpdateDeployTargetPodfileAsync('/app', '13.0'); - expect(result).toBe(true); - }); - - it('should returns false when target version is equal to current version', async () => { - const podfileContent = `platform :ios, '12.4'`; - (fs.promises.readFile as jest.Mock).mockResolvedValue(podfileContent); - - const result = await shouldUpdateDeployTargetPodfileAsync('/app', '12.4'); - expect(result).toBe(false); - }); - - it('should returns true when target version is higher than min_ios_version_supported version', async () => { - const podfileContent = `platform :ios, min_ios_version_supported`; - (fs.promises.readFile as jest.Mock).mockResolvedValueOnce(podfileContent); - const reactNativePodsRubyContent = `\ -def min_ios_version_supported - return '12.4' -end`; - (fs.promises.readFile as jest.Mock).mockResolvedValueOnce(reactNativePodsRubyContent); - - const result = await shouldUpdateDeployTargetPodfileAsync('/app', '13.0'); - expect(result).toBe(true); - }); - - it('should returns false when target version is equal to min_ios_version_supported version', async () => { - const podfileContent = `platform :ios, min_ios_version_supported`; - (fs.promises.readFile as jest.Mock).mockResolvedValueOnce(podfileContent); - const reactNativePodsRubyContent = `\ -def min_ios_version_supported - return '12.4' -end`; - (fs.promises.readFile as jest.Mock).mockResolvedValueOnce(reactNativePodsRubyContent); - - const result = await shouldUpdateDeployTargetPodfileAsync('/app', '12.4'); - expect(result).toBe(false); - }); - - it('should show a warning when the Podfile content is not supported', async () => { - const podfileContent = `platform :ios, something || '14.0'`; - (fs.promises.readFile as jest.Mock).mockResolvedValue(podfileContent); - const spy = jest.spyOn(console, 'warn'); - await shouldUpdateDeployTargetPodfileAsync('/app', '13.0'); - expect(spy).toBeCalled(); - }); -}); diff --git a/packages/install-expo-modules/src/plugins/ios/__tests__/withIosModulesAppDelegate-test.ts b/packages/install-expo-modules/src/plugins/ios/__tests__/withIosModulesAppDelegate-test.ts deleted file mode 100644 index e299e6050f..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/__tests__/withIosModulesAppDelegate-test.ts +++ /dev/null @@ -1,99 +0,0 @@ -import fs from 'fs'; -import path from 'path'; - -import { getLatestSdkVersion } from '../../../utils/expoVersionMappings'; -import { - updateModulesAppDelegateObjcHeader, - updateModulesAppDelegateObjcImpl, - updateModulesAppDelegateSwift, -} from '../withIosModulesAppDelegate'; - -const fixturesPath = path.resolve(__dirname, 'fixtures'); - -describe(updateModulesAppDelegateObjcHeader, () => { - it('should migrate from react-native@>=0.71.0 AppDelegate header', async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'AppDelegate-rn071.h'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'AppDelegate-rn071-updated.h'), 'utf8'), - ]); - - const sdkVersion = getLatestSdkVersion().expoSdkVersion; - const contents = updateModulesAppDelegateObjcHeader(rawContents, sdkVersion); - expect(updateModulesAppDelegateObjcHeader(contents, sdkVersion)).toEqual(expectContents); - // Try it twice... - const nextContents = updateModulesAppDelegateObjcHeader(contents, sdkVersion); - expect(updateModulesAppDelegateObjcHeader(nextContents, sdkVersion)).toEqual(expectContents); - }); - - it('should migrate from classic RN AppDelegate header', async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'AppDelegate.h'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'AppDelegate-updated.h'), 'utf8'), - ]); - - const sdkVersion = getLatestSdkVersion().expoSdkVersion; - const contents = updateModulesAppDelegateObjcHeader(rawContents, sdkVersion); - expect(updateModulesAppDelegateObjcHeader(contents, sdkVersion)).toEqual(expectContents); - // Try it twice... - const nextContents = updateModulesAppDelegateObjcHeader(contents, sdkVersion); - expect(updateModulesAppDelegateObjcHeader(nextContents, sdkVersion)).toEqual(expectContents); - }); -}); - -describe(updateModulesAppDelegateObjcImpl, () => { - it('should migrate from classic react-native@>=0.68.0 AppDelegate.mm implementation', async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'AppDelegate-rn068.mm'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'AppDelegate-rn068-updated.mm'), 'utf8'), - ]); - - const sdkVersion = getLatestSdkVersion().expoSdkVersion; - const contents = updateModulesAppDelegateObjcImpl(rawContents, sdkVersion); - expect(contents).toEqual(expectContents); - // Try it twice... - const nextContents = updateModulesAppDelegateObjcImpl(contents, sdkVersion); - expect(nextContents).toEqual(expectContents); - }); - - it('should migrate from classic react-native@<0.68.0 AppDelegate.m implementation', async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'AppDelegate.m'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'AppDelegate-updated.m'), 'utf8'), - ]); - - const sdkVersion = getLatestSdkVersion().expoSdkVersion; - const contents = updateModulesAppDelegateObjcImpl(rawContents, sdkVersion); - expect(contents).toEqual(expectContents); - // Try it twice... - const nextContents = updateModulesAppDelegateObjcImpl(contents, sdkVersion); - expect(nextContents).toEqual(expectContents); - }); -}); - -describe(updateModulesAppDelegateSwift, () => { - it('should migrate from basic RN AppDelegate.swift', async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'AppDelegate.swift'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'AppDelegate-updated.swift'), 'utf8'), - ]); - - const sdkVersion = getLatestSdkVersion().expoSdkVersion; - expect(updateModulesAppDelegateSwift(rawContents, sdkVersion)).toEqual(expectContents); - }); -}); - -describe('withIosModulesAppDelegate sdkVersion snapshots', () => { - const [objcHeaderFixture, objcImplFixture, swiftFixture] = [ - fs.readFileSync(path.join(fixturesPath, 'AppDelegate.h'), 'utf8'), - fs.readFileSync(path.join(fixturesPath, 'AppDelegate.m'), 'utf8'), - fs.readFileSync(path.join(fixturesPath, 'AppDelegate.swift'), 'utf8'), - ]; - - ['43.0.0', '44.0.0'].forEach(sdkVersion => { - it(`sdkVersion ${sdkVersion}`, () => { - expect(updateModulesAppDelegateObjcHeader(objcHeaderFixture, sdkVersion)).toMatchSnapshot(); - expect(updateModulesAppDelegateObjcImpl(objcImplFixture, sdkVersion)).toMatchSnapshot(); - expect(updateModulesAppDelegateSwift(swiftFixture, sdkVersion)).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/install-expo-modules/src/plugins/ios/__tests__/withIosModulesPodfile-test.ts b/packages/install-expo-modules/src/plugins/ios/__tests__/withIosModulesPodfile-test.ts deleted file mode 100644 index d26656ae3c..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/__tests__/withIosModulesPodfile-test.ts +++ /dev/null @@ -1,49 +0,0 @@ -import fs from 'fs'; -import path from 'path'; - -import { getLatestSdkVersion } from '../../../utils/expoVersionMappings'; -import { updatePodfile } from '../withIosModulesPodfile'; - -const fixturesPath = path.resolve(__dirname, 'fixtures'); - -describe(updatePodfile, () => { - it('should support classic rn podfile', async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'Podfile'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'Podfile-updated'), 'utf8'), - ]); - - const sdkVersion = getLatestSdkVersion().expoSdkVersion; - expect(updatePodfile(rawContents, 'HelloWorld', sdkVersion)).toEqual(expectContents); - }); - - it('should support classic rn 0.71 podfile', async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'Podfile-rn071'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'Podfile-rn071-updated'), 'utf8'), - ]); - - const sdkVersion = getLatestSdkVersion().expoSdkVersion; - expect(updatePodfile(rawContents, 'HelloWorld', sdkVersion)).toEqual(expectContents); - }); - - it('minimum support for existing post_integrate hook', async () => { - const [rawContents, expectContents] = await Promise.all([ - fs.promises.readFile(path.join(fixturesPath, 'Podfile-with-post-integrate'), 'utf8'), - fs.promises.readFile(path.join(fixturesPath, 'Podfile-with-post-integrate-updated'), 'utf8'), - ]); - - const sdkVersion = getLatestSdkVersion().expoSdkVersion; - expect(updatePodfile(rawContents, 'HelloWorld', sdkVersion)).toEqual(expectContents); - }); -}); - -describe('withIosModulesPodfile sdkVersion snapshots', () => { - const podfileFixture = fs.readFileSync(path.join(__dirname, 'fixtures', 'Podfile'), 'utf-8'); - - ['43.0.0', '44.0.0'].forEach(sdkVersion => { - it(`sdkVersion ${sdkVersion}`, () => { - expect(updatePodfile(podfileFixture, 'HelloWorld', sdkVersion)).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/install-expo-modules/src/plugins/ios/withIosDeploymentTarget.ts b/packages/install-expo-modules/src/plugins/ios/withIosDeploymentTarget.ts deleted file mode 100644 index efedefc651..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/withIosDeploymentTarget.ts +++ /dev/null @@ -1,162 +0,0 @@ -import { ConfigPlugin, withDangerousMod } from '@expo/config-plugins'; -import fs from 'fs'; -import path from 'path'; -import resolveFrom from 'resolve-from'; -import semver from 'semver'; -import { ISA, XCBuildConfiguration } from 'xcparse'; - -import { withXCParseXcodeProject, XCParseXcodeProject } from './withXCParseXcodeProject'; - -type IosDeploymentTargetConfigPlugin = ConfigPlugin<{ deploymentTarget: string }>; - -export const withIosDeploymentTarget: IosDeploymentTargetConfigPlugin = (config, props) => { - config = withIosDeploymentTargetPodfile(config, props); - config = withIosDeploymentTargetXcodeProject(config, props); - return config; -}; - -const withIosDeploymentTargetPodfile: IosDeploymentTargetConfigPlugin = (config, props) => { - return withDangerousMod(config, [ - 'ios', - async config => { - const podfile = path.join(config.modRequest.platformProjectRoot, 'Podfile'); - let contents = await fs.promises.readFile(podfile, 'utf8'); - contents = await updateDeploymentTargetPodfile( - config.modRequest.projectRoot, - contents, - props.deploymentTarget - ); - - await fs.promises.writeFile(podfile, contents); - return config; - }, - ]); -}; - -// Because regexp //g is stateful, to use it multiple times, we should create a new one. -function createPodfilePlatformRegExp() { - return /^(\s*platform :ios,\s*)(['"][\d.]+['"]|min_ios_version_supported)/gm; -} - -async function parseVersionAsync(projectRoot: string, versionPart: string): Promise { - let version; - if (versionPart === 'min_ios_version_supported') { - version = await lookupReactNativeMinIosVersionSupported(projectRoot); - } else { - version = versionPart.replace(/'"/g, ''); - } - return version; -} - -export async function updateDeploymentTargetPodfile( - projectRoot: string, - contents: string, - deploymentTarget: string -): Promise { - const matchResult = createPodfilePlatformRegExp().exec(contents); - if (matchResult) { - const version = await parseVersionAsync(projectRoot, matchResult[2]); - if (version && semver.lt(toSemVer(version), toSemVer(deploymentTarget))) { - return contents.replace(createPodfilePlatformRegExp(), (match, prefix, versionPart) => { - return `${prefix}'${deploymentTarget}'`; - }); - } - } - return contents; -} - -export async function shouldUpdateDeployTargetPodfileAsync( - projectRoot: string, - targetVersion: string -) { - const podfilePath = path.join(projectRoot, 'ios', 'Podfile'); - const podfile = await fs.promises.readFile(podfilePath, 'utf-8'); - const matchResult = createPodfilePlatformRegExp().exec(podfile); - if (!matchResult) { - console.warn( - 'Unrecognized `ios/Podfile` content, will skip the process to update minimum iOS supported version.' - ); - return false; - } - - const version = await parseVersionAsync(projectRoot, matchResult[2]); - if (!version) { - console.warn( - 'Unrecognized `ios/Podfile` content, will skip the process to update minimum iOS supported version.' - ); - return false; - } - - return semver.lt(toSemVer(version), toSemVer(targetVersion)); -} - -export async function lookupReactNativeMinIosVersionSupported( - projectRoot: string -): Promise { - // [0] Try to parse the default version from **scripts/cocoapods/helpers.rb** - const reactNativeCocoaPodsHelper = resolveFrom.silent( - projectRoot, - 'react-native/scripts/cocoapods/helpers.rb' - ); - if (reactNativeCocoaPodsHelper) { - try { - const content = await fs.promises.readFile(reactNativeCocoaPodsHelper, 'utf-8'); - const matchRepExp = /^\s*def self\.min_ios_version_supported\n\s*return\s*['"]([\d.]+)['"]/gm; - const matchResult = matchRepExp.exec(content); - if (matchResult) { - return matchResult[1]; - } - } catch {} - } - - // [1] Try to parse the default version from **scripts/react_native_pods.rb** - const reactNativePodsScript = resolveFrom.silent( - projectRoot, - 'react-native/scripts/react_native_pods.rb' - ); - if (reactNativePodsScript) { - try { - const content = await fs.promises.readFile(reactNativePodsScript, 'utf-8'); - const matchRepExp = /^def min_ios_version_supported\n\s*return\s*['"]([\d.]+)['"]/gm; - const matchResult = matchRepExp.exec(content); - if (matchResult) { - return matchResult[1]; - } - } catch {} - } - - return null; -} - -const withIosDeploymentTargetXcodeProject: IosDeploymentTargetConfigPlugin = (config, props) => { - return withXCParseXcodeProject(config, config => { - config.modResults = updateDeploymentTargetXcodeProject( - config.modResults, - props.deploymentTarget - ); - return config; - }); -}; - -export function updateDeploymentTargetXcodeProject( - project: XCParseXcodeProject, - deploymentTarget: string -): XCParseXcodeProject { - for (const section of Object.values(project.objects ?? {})) { - if (section.isa === ISA.XCBuildConfiguration) { - const { buildSettings } = section as XCBuildConfiguration; - const currDeploymentTarget = buildSettings?.IPHONEOS_DEPLOYMENT_TARGET; - if ( - currDeploymentTarget && - semver.lt(toSemVer(currDeploymentTarget), toSemVer(deploymentTarget)) - ) { - buildSettings.IPHONEOS_DEPLOYMENT_TARGET = deploymentTarget; - } - } - } - return project; -} - -function toSemVer(version: string): semver.SemVer { - return semver.coerce(version) ?? new semver.SemVer('0.0.0'); -} diff --git a/packages/install-expo-modules/src/plugins/ios/withIosModules.ts b/packages/install-expo-modules/src/plugins/ios/withIosModules.ts deleted file mode 100644 index a1fbb93549..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/withIosModules.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { ConfigPlugin, withPlugins } from '@expo/config-plugins'; - -import { - withIosModulesAppDelegate, - withIosModulesAppDelegateObjcHeader, - withIosModulesSwiftBridgingHeader, -} from './withIosModulesAppDelegate'; -import { withIosModulesPodfile } from './withIosModulesPodfile'; - -export const withIosModules: ConfigPlugin = config => { - return withPlugins(config, [ - withIosModulesAppDelegate, - withIosModulesAppDelegateObjcHeader, - withIosModulesSwiftBridgingHeader, - withIosModulesPodfile, - ]); -}; diff --git a/packages/install-expo-modules/src/plugins/ios/withIosModulesAppDelegate.ts b/packages/install-expo-modules/src/plugins/ios/withIosModulesAppDelegate.ts deleted file mode 100644 index 0be00b788a..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/withIosModulesAppDelegate.ts +++ /dev/null @@ -1,165 +0,0 @@ -import { ConfigPlugin, IOSConfig, withAppDelegate, withDangerousMod } from '@expo/config-plugins'; -import { - addObjcImports, - insertContentsInsideObjcFunctionBlock, - insertContentsInsideSwiftFunctionBlock, -} from '@expo/config-plugins/build/ios/codeMod'; -import fs from 'fs'; -import { sync as globSync } from 'glob'; -import semver from 'semver'; - -import { - getDesignatedSwiftBridgingHeaderFileReference, - withXCParseXcodeProject, -} from './withXCParseXcodeProject'; - -export const withIosModulesAppDelegate: ConfigPlugin = config => { - return withAppDelegate(config, config => { - config.modResults.contents = ['objc', 'objcpp'].includes(config.modResults.language) - ? updateModulesAppDelegateObjcImpl(config.modResults.contents, config.sdkVersion) - : updateModulesAppDelegateSwift(config.modResults.contents, config.sdkVersion); - return config; - }); -}; - -export const withIosModulesAppDelegateObjcHeader: ConfigPlugin = config => { - return withDangerousMod(config, [ - 'ios', - async config => { - try { - const appDelegateObjcHeaderPath = IOSConfig.Paths.getAppDelegateObjcHeaderFilePath( - config.modRequest.projectRoot - ); - let contents = await fs.promises.readFile(appDelegateObjcHeaderPath, 'utf8'); - contents = updateModulesAppDelegateObjcHeader(contents, config.sdkVersion); - await fs.promises.writeFile(appDelegateObjcHeaderPath, contents); - } catch {} - return config; - }, - ]); -}; - -export const withIosModulesSwiftBridgingHeader: ConfigPlugin = config => { - return withXCParseXcodeProject(config, async config => { - const bridgingHeaderFileName = getDesignatedSwiftBridgingHeaderFileReference(config.modResults); - if (!bridgingHeaderFileName) { - return config; - } - - const [bridgingHeaderFilePath] = globSync( - `ios/${bridgingHeaderFileName.replace(/['"]/g, '')}`, - { - absolute: true, - cwd: config.modRequest.projectRoot, - } - ); - if (!bridgingHeaderFilePath) { - return config; - } - let contents = await fs.promises.readFile(bridgingHeaderFilePath, 'utf8'); - - if (!contents.match(/^#import\s+\s*$/m)) { - contents = addObjcImports(contents, ['']); - } - - await fs.promises.writeFile(bridgingHeaderFilePath, contents); - return config; - }); -}; - -export function updateModulesAppDelegateObjcImpl( - contents: string, - sdkVersion: string | undefined -): string { - // application:didFinishLaunchingWithOptions: - const superDidFinishLaunchingWithOptionsCode = - '[super application:application didFinishLaunchingWithOptions:launchOptions];'; - if (!contents.includes(` ${superDidFinishLaunchingWithOptionsCode}`)) { - contents = insertContentsInsideObjcFunctionBlock( - contents, - 'application:didFinishLaunchingWithOptions:', - superDidFinishLaunchingWithOptionsCode, - { position: 'tailBeforeLastReturn' } - ); - } - - // ExpoReactDelegate - if (sdkVersion && semver.gte(sdkVersion, '44.0.0')) { - contents = contents.replace( - /\[\[RCTBridge alloc\] initWithDelegate:/g, - '[self.reactDelegate createBridgeWithDelegate:' - ); - contents = contents.replace( - /\[\[RCTRootView alloc\] initWithBridge:/g, - '[self.reactDelegate createRootViewWithBridge:' - ); - contents = contents.replace(/\bRCTAppSetupDefaultRootView\((.+)\)/g, (match, group) => { - const [bridge, moduleName, initProps] = group.split(',').map((s: string) => s.trim()); - return `[self.reactDelegate createRootViewWithBridge:${bridge} moduleName:${moduleName} initialProperties:${initProps}]`; - }); - contents = contents.replace( - /\[UIViewController new\]/g, - '[self.reactDelegate createRootViewController]' - ); - } - - return contents; -} - -export function updateModulesAppDelegateObjcHeader( - contents: string, - sdkVersion: string | undefined -): string { - // Add imports if needed - if (!contents.match(/^#import\s+\s*$/m)) { - contents = addObjcImports(contents, ['']); - } - - // Replace parent class if needed - contents = contents.replace( - /^(\s*@interface\s+AppDelegate\s+:\s+)RCTAppDelegate$/m, - '$1EXAppDelegateWrapper' - ); // react-native@>=0.71.0 - - contents = contents.replace( - /^(\s*@interface\s+AppDelegate\s+:\s+)UIResponder(\s+.+)$/m, - '$1EXAppDelegateWrapper$2' - ); // react-native@<0.71.0 - - return contents; -} - -export function updateModulesAppDelegateSwift( - contents: string, - sdkVersion: string | undefined -): string { - // Replace superclass with AppDelegateWrapper - contents = contents.replace( - /^(class\s+AppDelegate\s*:\s*)NSObject,\s*UIApplicationDelegate(\W+)/m, - '$1AppDelegateWrapper$2' - ); - - // application:didFinishLaunchingWithOptions: - const superDidFinishLaunchingWithOptionsCode = - 'super.application(application, didFinishLaunchingWithOptions: launchOptions)'; - if (!contents.includes(` ${superDidFinishLaunchingWithOptionsCode}`)) { - contents = insertContentsInsideSwiftFunctionBlock( - contents, - 'application(_:didFinishLaunchingWithOptions:)', - superDidFinishLaunchingWithOptionsCode, - { position: 'tailBeforeLastReturn', indent: 4 } - ); - } - - // ExpoReactDelegate - if (sdkVersion && semver.gte(sdkVersion, '44.0.0')) { - contents = contents.replace(/\bRCTBridge\(delegate:/g, 'reactDelegate.createBridge(delegate:'); - contents = contents.replace(/\bRCTRootView\(bridge:/g, 'reactDelegate.createRootView(bridge:'); - contents = contents.replace( - /\bUIViewController\(\)/g, - 'reactDelegate.createRootViewController()' - ); - } - - return contents; -} diff --git a/packages/install-expo-modules/src/plugins/ios/withIosModulesPodfile.ts b/packages/install-expo-modules/src/plugins/ios/withIosModulesPodfile.ts deleted file mode 100644 index d19e77d9d6..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/withIosModulesPodfile.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { ConfigPlugin, IOSConfig, withDangerousMod } from '@expo/config-plugins'; -import fs from 'fs'; -import path from 'path'; -import semver from 'semver'; - -const { getProjectName } = IOSConfig.XcodeUtils; - -export const withIosModulesPodfile: ConfigPlugin = config => { - return withDangerousMod(config, [ - 'ios', - async config => { - const podfile = path.join(config.modRequest.platformProjectRoot, 'Podfile'); - let contents = await fs.promises.readFile(podfile, 'utf8'); - const projectName = getProjectName(config.modRequest.projectRoot); - contents = updatePodfile(contents, projectName, config.sdkVersion); - - await fs.promises.writeFile(podfile, contents); - return config; - }, - ]); -}; - -export function updatePodfile( - contents: string, - projectName: string, - sdkVersion: string | undefined -): string { - // require autolinking module - if (!contents.match(/^require.+'expo\/package\.json.+scripts\/autolinking/m)) { - contents = `require File.join(File.dirname(\`node --print "require.resolve('expo/package.json')"\`), "scripts/autolinking")\n${contents}`; - } - - // use_expo_modules! - if (!contents.match(/^\s*use_expo_modules!\s*$/m)) { - const targetRegExp = new RegExp(`(^\\s*target\\s+['"]${projectName}['"]\\s+do\\s*$)`, 'm'); - contents = contents.replace(targetRegExp, '$1\n use_expo_modules!'); - } - - // expo_patch_react_imports! - if (sdkVersion && semver.gte(sdkVersion, '44.0.0')) { - if (!contents.match(/\bexpo_patch_react_imports!\(installer\)\b/)) { - const regExpPostIntegrate = /(\bpost_integrate do \|installer\|)/; - if (contents.match(regExpPostIntegrate)) { - contents = contents.replace( - regExpPostIntegrate, - `$1 - begin - expo_patch_react_imports!(installer) - rescue => e - Pod::UI.warn e - end` - ); - } else { - // If there's no existing post_integrate hook, - // use the `use_expo_modules!` as the insertion anchor. - contents = contents.replace( - /(\buse_expo_modules!\n)/gm, - `$1\ - post_integrate do |installer| - begin - expo_patch_react_imports!(installer) - rescue => e - Pod::UI.warn e - end - end\n` - ); - } - } - } - - return contents; -} diff --git a/packages/install-expo-modules/src/plugins/ios/withXCParseXcodeProject.ts b/packages/install-expo-modules/src/plugins/ios/withXCParseXcodeProject.ts deleted file mode 100644 index d7025eb989..0000000000 --- a/packages/install-expo-modules/src/plugins/ios/withXCParseXcodeProject.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { BaseMods, ConfigPlugin, IOSConfig, Mod, withMod } from '@expo/config-plugins'; -import fs from 'fs'; -import { ISA, build as xcbuild, parse as xcparse } from 'xcparse'; -import type { BuildSettings, XCBuildConfiguration, XcodeProject } from 'xcparse'; - -export type XCParseXcodeProject = Partial; - -export interface BuildSettingsExtended extends BuildSettings { - SWIFT_OBJC_BRIDGING_HEADER?: string; -} - -const MOD_NAME = 'xcparseXcodeproj'; - -export const withXCParseXcodeProjectBaseMod: ConfigPlugin = config => { - return BaseMods.withGeneratedBaseMods(config, { - platform: 'ios', - skipEmptyMod: false, - providers: { - [MOD_NAME]: BaseMods.provider({ - getFilePath({ modRequest: { projectRoot } }) { - return IOSConfig.Paths.getPBXProjectPath(projectRoot); - }, - async read(filePath) { - const content = await fs.promises.readFile(filePath, 'utf8'); - const pbxproj = xcparse(content); - return pbxproj; - }, - async write(filePath: string, { modResults }) { - const content = xcbuild(modResults); - await fs.promises.writeFile(filePath, content); - }, - }), - }, - }); -}; - -export const withXCParseXcodeProject: ConfigPlugin> = (config, action) => { - return withMod(config, { - platform: 'ios', - mod: MOD_NAME, - action, - }); -}; - -export function getDesignatedSwiftBridgingHeaderFileReference( - pbxproj: XCParseXcodeProject -): string | null { - for (const section of Object.values(pbxproj.objects ?? {})) { - if (section.isa === ISA.XCBuildConfiguration) { - const buildConfigSection = section as XCBuildConfiguration; - const buildSettings = buildConfigSection.buildSettings as BuildSettingsExtended; - if ( - typeof buildSettings.PRODUCT_NAME !== 'undefined' && - typeof buildSettings.SWIFT_OBJC_BRIDGING_HEADER === 'string' && - buildSettings.SWIFT_OBJC_BRIDGING_HEADER - ) { - return buildSettings.SWIFT_OBJC_BRIDGING_HEADER; - } - } - } - return null; -} diff --git a/packages/install-expo-modules/src/utils/__tests__/expoVersionMappings-test.ts b/packages/install-expo-modules/src/utils/__tests__/expoVersionMappings-test.ts deleted file mode 100644 index f4435ef654..0000000000 --- a/packages/install-expo-modules/src/utils/__tests__/expoVersionMappings-test.ts +++ /dev/null @@ -1,32 +0,0 @@ -import resolveFrom from 'resolve-from'; - -import { getDefaultSdkVersion } from '../expoVersionMappings'; - -jest.mock('resolve-from'); - -describe(getDefaultSdkVersion, () => { - function setupReactNativeVersionMock(version: string) { - const mockResolve = resolveFrom.silent as jest.MockedFunction; - mockResolve.mockReturnValueOnce('fs'); - jest.doMock('fs', () => ({ version })); - } - - afterEach(() => { - jest.resetModules(); - }); - - it('should resolve as sdk 45 from react-native 0.68 project', async () => { - setupReactNativeVersionMock('0.68.0'); - expect(getDefaultSdkVersion('/projectRoot').expoSdkVersion).toBe('45.0.0'); - }); - - it('should resolve as sdk 45 from react-native 0.65 project', async () => { - setupReactNativeVersionMock('0.65.0'); - expect(getDefaultSdkVersion('/projectRoot').expoSdkVersion).toBe('45.0.0'); - }); - - it('should resolve as sdk 44 from react-native 0.64 project', async () => { - setupReactNativeVersionMock('0.64.3'); - expect(getDefaultSdkVersion('/projectRoot').expoSdkVersion).toBe('44.0.0'); - }); -}); diff --git a/packages/install-expo-modules/src/utils/expoVersionMappings.ts b/packages/install-expo-modules/src/utils/expoVersionMappings.ts deleted file mode 100644 index c3c41f86e3..0000000000 --- a/packages/install-expo-modules/src/utils/expoVersionMappings.ts +++ /dev/null @@ -1,76 +0,0 @@ -import resolveFrom from 'resolve-from'; -import semver from 'semver'; - -export interface VersionInfo { - expoSdkVersion: string; - iosDeploymentTarget: string; - reactNativeVersionRange: string; - androidAgpVersion?: string; - supportCliIntegration?: boolean; -} - -export const ExpoVersionMappings: VersionInfo[] = [ - // Please keep sdk versions in sorted order (latest sdk first) - { - expoSdkVersion: '49.0.0', - iosDeploymentTarget: '13.0', - reactNativeVersionRange: '>= 0.72.0', - supportCliIntegration: true, - }, - { - expoSdkVersion: '48.0.0', - iosDeploymentTarget: '13.0', - reactNativeVersionRange: '>= 0.71.0', - androidAgpVersion: '7.4.1', - }, - { - expoSdkVersion: '47.0.0', - iosDeploymentTarget: '13.0', - reactNativeVersionRange: '>= 0.70.0', - }, - { - expoSdkVersion: '46.0.0', - iosDeploymentTarget: '12.4', - reactNativeVersionRange: '>= 0.69.0', - }, - { - expoSdkVersion: '45.0.0', - iosDeploymentTarget: '12.0', - reactNativeVersionRange: '>= 0.65.0', - }, - { - expoSdkVersion: '44.0.0', - iosDeploymentTarget: '12.0', - reactNativeVersionRange: '< 0.68.0', - }, - { - expoSdkVersion: '43.0.0', - iosDeploymentTarget: '12.0', - reactNativeVersionRange: '< 0.68.0', - }, -]; - -export function getDefaultSdkVersion(projectRoot: string): VersionInfo { - const reactNativePackageJsonPath = resolveFrom.silent(projectRoot, 'react-native/package.json'); - if (!reactNativePackageJsonPath) { - throw new Error(`Unable to find react-native package - projectRoot[${projectRoot}]`); - } - const reactNativeVersion = require(reactNativePackageJsonPath).version; - const versionInfo = ExpoVersionMappings.find(info => - semver.satisfies(reactNativeVersion, info.reactNativeVersionRange) - ); - if (!versionInfo) { - throw new Error( - `Unable to find compatible expo sdk version - reactNativeVersion[${reactNativeVersion}]` - ); - } - return versionInfo; -} - -export function getLatestSdkVersion(): VersionInfo { - return ExpoVersionMappings[0]; -} - -export function getVersionInfo(sdkVersion: string): VersionInfo | null { - return ExpoVersionMappings.find(info => info.expoSdkVersion === sdkVersion) ?? null; -} diff --git a/packages/install-expo-modules/src/utils/link.ts b/packages/install-expo-modules/src/utils/link.ts deleted file mode 100644 index 68fe723a96..0000000000 --- a/packages/install-expo-modules/src/utils/link.ts +++ /dev/null @@ -1,39 +0,0 @@ -import chalk from 'chalk'; -import terminalLink from 'terminal-link'; - -/** - * Prints a link for given URL, using text if provided, otherwise text is just the URL. - * Format links as dim (unless disabled) and with an underline. - * - * @example https://expo.dev - */ -export function link( - url: string, - { text = url, dim = true }: { text?: string; dim?: boolean } = {} -): string { - let output: string; - // Links can be disabled via env variables https://github.com/jamestalmage/supports-hyperlinks/blob/master/index.js - if (terminalLink.isSupported) { - output = terminalLink(text, url); - } else { - output = `${text === url ? '' : text + ': '}${chalk.underline(url)}`; - } - return dim ? chalk.dim(output) : output; -} - -/** - * Provide a consistent "Learn more" link experience. - * Format links as dim (unless disabled) with an underline. - * - * @example [Learn more](https://expo.dev) - * @example Learn more: https://expo.dev - */ -export function learnMore( - url: string, - { - learnMoreMessage: maybeLearnMoreMessage, - dim = true, - }: { learnMoreMessage?: string; dim?: boolean } = {} -): string { - return link(url, { text: maybeLearnMoreMessage ?? 'Learn more', dim }); -} diff --git a/packages/install-expo-modules/src/utils/packageInstaller.ts b/packages/install-expo-modules/src/utils/packageInstaller.ts deleted file mode 100644 index 2a23ca0e7a..0000000000 --- a/packages/install-expo-modules/src/utils/packageInstaller.ts +++ /dev/null @@ -1,51 +0,0 @@ -import * as PackageManager from '@expo/package-manager'; -import path from 'path'; -import semver from 'semver'; - -/** - * Install a node package non-interactively - * - * @param projectRoot target project root folder - * @param pkg package name - */ -function installPackageNonInteractiveAsync(projectRoot: string, pkg: string) { - const isYarn = PackageManager.isUsingYarn(projectRoot); - const packageManager = PackageManager.createForProject(projectRoot); - if (isYarn) { - return packageManager.addWithParametersAsync([pkg], ['--non-interactive']); - } else { - return packageManager.addAsync(pkg); - } -} - -/** - * Install the `expo` package - * - * @param projectRoot target project root folder - * @param sdkVersion expo sdk version - */ -export async function installExpoPackageAsync(projectRoot: string, sdkVersion: string) { - try { - // First try to install from released versions, e.g. `expo@^45.0.0` - await installPackageNonInteractiveAsync(projectRoot, `expo@^${sdkVersion}`); - } catch { - // Fallback to install from prerelease versions, - // e.g. `expo@>=45.0.0-0 <46.0.0`, this will cover prerelease version for beta testing. - await installPackageNonInteractiveAsync( - projectRoot, - `expo@>=${sdkVersion}-0 <${semver.inc(sdkVersion, 'major')}` - ); - } -} - -/** - * Running `pod install` for the target project - * - * @param projectRoot target project root folder - */ -export async function installPodsAsync(projectRoot: string) { - const podPackageManager = new PackageManager.CocoaPodsPackageManager({ - cwd: path.join(projectRoot, 'ios'), - }); - await podPackageManager.installAsync(); -} diff --git a/packages/install-expo-modules/src/utils/projectRoot.ts b/packages/install-expo-modules/src/utils/projectRoot.ts deleted file mode 100644 index 73d780fb1c..0000000000 --- a/packages/install-expo-modules/src/utils/projectRoot.ts +++ /dev/null @@ -1,13 +0,0 @@ -import assert from 'assert'; -import findUp from 'find-up'; -import path from 'path'; - -function findUpPackageJson(root: string): string { - const packageJson = findUp.sync('package.json', { cwd: root }); - assert(packageJson, `No package.json found for module "${root}"`); - return packageJson; -} - -export function normalizeProjectRoot(projectRoot?: string): string { - return path.dirname(findUpPackageJson(projectRoot ?? process.cwd())); -} diff --git a/packages/install-expo-modules/tsconfig.json b/packages/install-expo-modules/tsconfig.json deleted file mode 100644 index 00d6e3925e..0000000000 --- a/packages/install-expo-modules/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "../../tsconfig.base", - "compilerOptions": { - "outDir": "build", - "rootDir": "src", - }, - "include": ["./src"], - "exclude": [ - "**/__mocks__/*", - "**/__tests__/*" - ] -}