Skip to content

Commit 48b8d00

Browse files
authored
fix: use providers.exec to enable configuration-cache (#3504)
## Description Fixes: ``` Starting an external process 'node --print require.resolve('react-native/package.json')' during configuration time is unsupported ``` when `configuration-cache` is enabled. ## Changes Replace `execute` with `providers.exec`. You can read more about it here: https://docs.gradle.org/8.13/userguide/configuration_cache.html#config_cache:requirements:external_processes. ## Test code and steps to reproduce - build project with `configuration-cache` flag ✅
1 parent fee1a09 commit 48b8d00

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

android/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ def resolveReactNativeDirectory() {
3939
}
4040

4141
// Fallback to node resolver for custom directory structures like monorepos.
42-
def reactNativePackage = file(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim())
42+
def reactNativePackage = file(
43+
providers.exec {
44+
workingDir(rootDir)
45+
commandLine("node", "--print", "require.resolve('react-native/package.json')")
46+
}.standardOutput.asText.get().trim()
47+
)
4348
if (reactNativePackage.exists()) {
4449
return reactNativePackage.parentFile
4550
}

0 commit comments

Comments
 (0)