Bläddra i källkod

[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.
j8
Saúl Ibarra Corretgé 7 år sedan
förälder
incheckning
52da5010cc
1 ändrade filer med 15 tillägg och 0 borttagningar
  1. 15
    0
      android/build.gradle

+ 15
- 0
android/build.gradle Visa fil

23
         maven { url "$rootDir/../node_modules/react-native/android" }
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
     // Third-party react-native modules which Jitsi Meet SDK for Android depends
41
     // Third-party react-native modules which Jitsi Meet SDK for Android depends
27
     // on and which are not available in third-party Maven repositories need to
42
     // on and which are not available in third-party Maven repositories need to
28
     // be deployed in a Maven repository of ours.
43
     // be deployed in a Maven repository of ours.

Laddar…
Avbryt
Spara