浏览代码

[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 年前
父节点
当前提交
52da5010cc
共有 1 个文件被更改,包括 15 次插入0 次删除
  1. 15
    0
      android/build.gradle

+ 15
- 0
android/build.gradle 查看文件

@@ -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.

正在加载...
取消
保存