Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 088503d

Browse files
Use project.ext.react root prop to specify node_modules path (#869)
1 parent bb0e206 commit 088503d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

android/codepush.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Adapted from https://raw.githubusercontent.com/facebook/react-native/master/local-cli/generator-android/templates/src/app/react.gradle
22

3+
import java.nio.file.Paths;
4+
35
def config = project.hasProperty("react") ? project.react : [];
46
def bundleAssetName = config.bundleAssetName ?: "index.android.bundle"
57

@@ -22,7 +24,10 @@ gradle.projectsEvaluated {
2224
def productFlavors = android.productFlavors.collect { flavor -> flavor.name }
2325
if (!productFlavors) productFlavors.add('')
2426
def nodeModulesPath;
25-
if (project.hasProperty('nodeModulesPath')) {
27+
if (config.root) {
28+
nodeModulesPath = Paths.get(config.root, "/node_modules");
29+
}
30+
else if (project.hasProperty('nodeModulesPath')) {
2631
nodeModulesPath = project.nodeModulesPath
2732
} else {
2833
nodeModulesPath = "../../node_modules";

0 commit comments

Comments
 (0)