Skip to content

Commit 1d27008

Browse files
satya164facebook-github-bot
authored andcommitted
Add ability to customize CLI path
Summary: Closes #13248 Differential Revision: D4861273 fbshipit-source-id: 420a9dde94e888baab226e3c0d8d20e6f1464ae5
1 parent 2ab8405 commit 1d27008

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

react.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import org.apache.tools.ant.taskdefs.condition.Os
22

33
def config = project.hasProperty("react") ? project.react : [];
44

5+
def cliPath = config.cliPath ?: "node_modules/react-native/local-cli/cli.js"
56
def bundleAssetName = config.bundleAssetName ?: "index.android.bundle"
67
def entryFile = config.entryFile ?: "index.android.js"
78

@@ -79,10 +80,10 @@ gradle.projectsEvaluated {
7980
def devEnabled = !(config."devDisabledIn${targetName}"
8081
|| targetName.toLowerCase().contains("release"))
8182
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
82-
commandLine("cmd", "/c", *nodeExecutableAndArgs, "node_modules/react-native/local-cli/cli.js", "bundle", "--platform", "android", "--dev", "${devEnabled}",
83+
commandLine("cmd", "/c", *nodeExecutableAndArgs, cliPath, "bundle", "--platform", "android", "--dev", "${devEnabled}",
8384
"--reset-cache", "--entry-file", entryFile, "--bundle-output", jsBundleFile, "--assets-dest", resourcesDir, *extraPackagerArgs)
8485
} else {
85-
commandLine(*nodeExecutableAndArgs, "node_modules/react-native/local-cli/cli.js", "bundle", "--platform", "android", "--dev", "${devEnabled}",
86+
commandLine(*nodeExecutableAndArgs, cliPath, "bundle", "--platform", "android", "--dev", "${devEnabled}",
8687
"--reset-cache", "--entry-file", entryFile, "--bundle-output", jsBundleFile, "--assets-dest", resourcesDir, *extraPackagerArgs)
8788
}
8889

0 commit comments

Comments
 (0)