Skip to content

Commit

Permalink
Revert D59170923 (facebook#45447)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#45447

This diff reverts D59170923
Breaking OSS build

Changelog: [Internal]

Reviewed By: blakef

Differential Revision: D59759991

fbshipit-source-id: 39aa0b447a90801d1da5a39461b33b4c4cc4197b
  • Loading branch information
generatedunixname89002005232357 authored and facebook-github-bot committed Jul 15, 2024
1 parent 2d67b72 commit 85dd14c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 94 deletions.
4 changes: 0 additions & 4 deletions packages/react-native/react-native.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ if (ios != null) {
projectConfig: ios.projectConfig,
dependencyConfig: ios.dependencyConfig,
};
} else {
config.platforms.ios = {};
}

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

module.exports = config;
6 changes: 3 additions & 3 deletions packages/react-native/scripts/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -63,7 +63,7 @@ if (bc.options != null) {
}

if (require.main === module) {
program.allowUnknownOption().parse(process.argv);
program.parse(process.argv);
}

module.exports = program;
4 changes: 2 additions & 2 deletions packages/rn-tester/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand Down
11 changes: 0 additions & 11 deletions packages/rn-tester/config.sh

This file was deleted.

74 changes: 3 additions & 71 deletions packages/rn-tester/react-native.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 1 addition & 3 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}

0 comments on commit 85dd14c

Please sign in to comment.