mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Back out "fix: RNGP using node invocation non-compatible with Gradle Compilation Cache"
Summary: Original commit changeset: a91e47b90937 Original Phabricator Diff: D88492310 bypass-github-export-checks Reviewed By: javache Differential Revision: D88727116 fbshipit-source-id: 847c78776d9628448811158673ac8530e09a8238
This commit is contained in:
1 parent
64bb0d5510
commit
b1b2cab158
1 file changed
+8
-10
+8
-10
@@ -42,7 +42,6 @@ internal fun detectedEntryFile(config: ReactExtension, envVariableOverride: Stri
|
||||
*/
|
||||
internal fun detectedCliFile(config: ReactExtension): File =
|
||||
detectCliFile(
|
||||
project = config.project,
|
||||
reactNativeRoot = config.root.get().asFile,
|
||||
preconfiguredCliFile = config.cliFile.asFile.orNull,
|
||||
)
|
||||
@@ -72,11 +71,7 @@ private fun detectEntryFile(
|
||||
else -> File(reactRoot, "index.js")
|
||||
}
|
||||
|
||||
private fun detectCliFile(
|
||||
project: Project,
|
||||
reactNativeRoot: File,
|
||||
preconfiguredCliFile: File?,
|
||||
): File {
|
||||
private fun detectCliFile(reactNativeRoot: File, preconfiguredCliFile: File?): File {
|
||||
// 1. preconfigured path
|
||||
if (preconfiguredCliFile != null) {
|
||||
if (preconfiguredCliFile.exists()) {
|
||||
@@ -86,11 +81,14 @@ private fun detectCliFile(
|
||||
|
||||
// 2. node module path
|
||||
val nodeProcess =
|
||||
project.providers.exec {
|
||||
it.commandLine("node", "--print", "require.resolve('react-native/package.json')")
|
||||
}
|
||||
Runtime.getRuntime()
|
||||
.exec(
|
||||
arrayOf("node", "--print", "require.resolve('react-native/cli');"),
|
||||
emptyArray(),
|
||||
reactNativeRoot,
|
||||
)
|
||||
|
||||
val nodeProcessOutput = nodeProcess.standardOutput.asText.get().trim()
|
||||
val nodeProcessOutput = nodeProcess.inputStream.use { it.bufferedReader().readText().trim() }
|
||||
|
||||
if (nodeProcessOutput.isNotEmpty()) {
|
||||
val nodeModuleCliJs = File(nodeProcessOutput)
|
||||
|
||||
Reference in new issue
Block a user