Skip to content

Commit 572a80f

Browse files
committed
test(e2e, android): switch to different method for pinning react-native dep location
1 parent 5f183c4 commit 572a80f

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

tests/android/build.gradle

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,25 @@ buildscript {
3939
}
4040
}
4141

42-
def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())
43-
4442
allprojects {
4543
println "${project.name} ${projectDir} ${rootDir}"
4644

47-
48-
configurations.all {
49-
resolutionStrategy {
50-
force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
45+
repositories {
46+
exclusiveContent {
47+
// We get React Native's Android binaries exclusively through npm,
48+
// from a local Maven repo inside node_modules/react-native/.
49+
// (The use of exclusiveContent prevents looking elsewhere like Maven Central
50+
// and potentially getting a wrong version.)
51+
filter {
52+
includeGroup "com.facebook.react"
53+
}
54+
forRepository {
55+
maven {
56+
url "$rootDir/../node_modules/react-native/android"
57+
}
58+
}
5159
}
52-
}
5360

54-
repositories {
5561
maven {
5662
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
5763
url("$rootDir/../node_modules/react-native/android")
@@ -64,13 +70,7 @@ allprojects {
6470
// // Detox as an .aar file (we're going to use it as a compile dependency though, to patch it)
6571
// url "$rootDir/../node_modules/detox/Detox-android"
6672
// }
67-
mavenCentral {
68-
// We don't want to fetch react-native from Maven Central as there are
69-
// older versions over there.
70-
content {
71-
excludeGroup "com.facebook.react"
72-
}
73-
}
73+
mavenCentral()
7474
google()
7575
maven { url 'https://www.jitpack.io' }
7676
}

0 commit comments

Comments
 (0)