Skip to content

Commit 3f1672e

Browse files
authored
fix: use providers.exec to enable configuration-cache (#2903)
## 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 1cb2568 commit 3f1672e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

android/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ def resolveReactNativeDirectory() {
5757
}
5858

5959
// We're in non standard setup, e.g. monorepo - try to use node resolver to locate the react-native package.
60-
String maybeRnPackagePath = ["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()
60+
String maybeRnPackagePath = providers.exec {
61+
workingDir(rootDir)
62+
commandLine("node", "--print", "require.resolve('react-native/package.json')")
63+
}.standardOutput.asText.get().trim()
6164

6265
File nodeResolverRnDirFile = null
6366
// file() constructor fails in case string is null or blank

0 commit comments

Comments
 (0)