Revert D59170923 (#45447)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45447

This diff reverts D59170923
Breaking OSS build

Changelog: [Internal]

Reviewed By: blakef

Differential Revision: D59759991

fbshipit-source-id: 39aa0b447a90801d1da5a39461b33b4c4cc4197b
This commit is contained in:
generatedunixname89002005232357 2024-07-15 13:44:09 -07:00 committed by Facebook GitHub Bot
parent 2d67b723d3
commit 85dd14c912
6 changed files with 9 additions and 94 deletions

View File

@ -85,8 +85,6 @@ if (ios != null) {
projectConfig: ios.projectConfig,
dependencyConfig: ios.dependencyConfig,
};
} else {
config.platforms.ios = {};
}
if (android != null) {
@ -95,8 +93,6 @@ if (android != null) {
projectConfig: android.projectConfig,
dependencyConfig: android.dependencyConfig,
};
} else {
config.platforms.android = {};
}
module.exports = config;

View File

@ -12,8 +12,8 @@
const {bundleCommand: bc} = require('@react-native/community-cli-plugin');
const {execSync} = require('child_process');
const {program} = require('commander');
const {readFileSync} = require('fs');
const program = require('commander');
const {existsSync, readFileSync} = require('fs');
const path = require('path');
program.version(
@ -63,7 +63,7 @@ if (bc.options != null) {
}
if (require.main === module) {
program.allowUnknownOption().parse(process.argv);
program.parse(process.argv);
}
module.exports = program;

View File

@ -29,7 +29,7 @@ react {
codegenDir = file("$rootDir/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("../../../react-native/scripts/bundle.js")
cliFile = file("$reactNativeDirPath/cli.js")
/* Variants */
// The list of variants to that are debuggable. For those we're going to
@ -55,7 +55,7 @@ react {
//
// 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 = listOf("--config-cmd", "/bin/sh config.sh")
// extraPackagerArgs = []
/* Hermes Commands */
// The hermes compiler command to run. By default it is 'hermesc'

View File

@ -1,11 +0,0 @@
#!/bin/bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
set -e
script_dir=$(dirname "$(readlink -f "$0")")
node -p "JSON.stringify(require(\"$script_dir/react-native.config.js\"), null, 2)"

View File

@ -12,84 +12,16 @@
// Inside the React Native monorepo, we need to explicitly extend the base
// CLI config as the adjacent package will not be conventionally discovered.
const config = require('../react-native/react-native.config.js');
const path = require('path');
const folder = (dep, ...folders) =>
path.join(path.dirname(require.resolve(dep)), ...folders);
// Hard coding these to drop the @react-native-community/cli-platform-{ios,android} dependencies. This
// is the cleaned up output from npx @react-native-community/cli config.
const dependencies = {
'@react-native/oss-library-example': {
root: folder('@react-native/oss-library-example'),
name: '@react-native/oss-library-example',
platforms: {
ios: {
podspecPath: folder(
'@react-native/oss-library-example',
'OSSLibraryExample.podspec',
),
version: '0.76.0-main',
configurations: [],
scriptPhases: [],
},
android: {
sourceDir: folder('@react-native/oss-library-example', 'android'),
packageImportPath:
'import com.facebook.react.osslibraryexample.OSSLibraryExamplePackage;',
packageInstance: 'new OSSLibraryExamplePackage()',
buildTypes: [],
libraryName: 'OSSLibraryExampleSpec',
componentDescriptors: ['SampleNativeComponentComponentDescriptor'],
cmakeListsPath: folder(
'@react-native/oss-library-example',
'android',
'src',
'main',
'jni',
'CMakeLists.txt',
),
cxxModuleCMakeListsModuleName: null,
cxxModuleCMakeListsPath: null,
cxxModuleHeaderName: null,
},
},
},
'@react-native/popup-menu-android': {
root: folder('@react-native/popup-menu-android'),
name: '@react-native/popup-menu-android',
platforms: {
ios: null,
android: {
sourceDir: folder('@react-native/popup-menu-android', 'android'),
packageImportPath:
'import com.facebook.react.popupmenu.PopupMenuPackage;',
packageInstance: 'new PopupMenuPackage()',
buildTypes: [],
libraryName: 'ReactPopupMenuAndroidSpecs',
componentDescriptors: ['AndroidPopupMenuComponentDescriptor'],
cmakeListsPath: folder(
'@react-native/popup-menu-android/android/src/main/jni/CMakeLists.txt',
),
cxxModuleCMakeListsModuleName: null,
cxxModuleCMakeListsPath: null,
cxxModuleHeaderName: null,
},
},
},
};
module.exports = {
...config,
root: path.resolve('.'),
reactNativePath: path.resolve('../react-native'),
dependencies,
reactNativePath: '../react-native',
project: {
ios: {
sourceDir: path.resolve('.'),
sourceDir: '.',
},
android: {
sourceDir: path.resolve('../../'),
sourceDir: '../../',
// To remove once the CLI fix for manifestPath search path is landed.
manifestPath:
'packages/rn-tester/android/app/src/main/AndroidManifest.xml',

View File

@ -37,7 +37,5 @@ plugins {
configure<com.facebook.react.ReactSettingsExtension> {
autolinkLibrariesFromCommand(
command = listOf("/bin/sh", "./config.sh"),
workingDirectory = file("packages/rn-tester/"),
lockFiles = files("yarn.lock"))
workingDirectory = file("packages/rn-tester/"), lockFiles = files("yarn.lock"))
}