Browse Source

[Android] Make sure we use the react-native version in node_modules

Releases are also published to jcenter, and due to how the dependency is
declared, we are picking the latest release from there, which is arguably not
what we want.
master
Saúl Ibarra Corretgé 7 years ago
parent
commit
52da5010cc
1 changed files with 15 additions and 0 deletions
  1. 15
    0
      android/build.gradle

+ 15
- 0
android/build.gradle View File

@@ -23,6 +23,21 @@ allprojects {
23 23
         maven { url "$rootDir/../node_modules/react-native/android" }
24 24
     }
25 25
 
26
+    // Make sure we use the react-native version in node_modules and not the one
27
+    // published in jcenter / elsewhere.
28
+    configurations.all {
29
+        resolutionStrategy {
30
+            eachDependency { DependencyResolveDetails details ->
31
+                if (details.requested.group == 'com.facebook.react'
32
+                        && details.requested.name == 'react-native') {
33
+                    def file = new File("$rootDir/../node_modules/react-native/package.json")
34
+                    def version = new groovy.json.JsonSlurper().parseText(file.text).version
35
+                    details.useVersion version
36
+                }
37
+            }
38
+        }
39
+    }
40
+
26 41
     // Third-party react-native modules which Jitsi Meet SDK for Android depends
27 42
     // on and which are not available in third-party Maven repositories need to
28 43
     // be deployed in a Maven repository of ours.

Loading…
Cancel
Save