File tree Expand file tree Collapse file tree 2 files changed +20
-9
lines changed Expand file tree Collapse file tree 2 files changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -25,15 +25,18 @@ repositories {
25
25
mavenCentral()
26
26
google()
27
27
28
- // TODO: Remove these when they've been published to Maven Central.
29
- // See https://github.com/microsoft/react-native-test-app/issues/305
30
- // noinspection JcenterRepositoryObsolete
31
- jcenter() {
32
- content {
33
- includeGroup(" com.facebook.fbjni" )
34
- includeGroup(" com.facebook.flipper" )
35
- includeGroup(" com.facebook.fresco" )
36
- includeGroup(" com.facebook.yoga" )
28
+ // TODO: Remove this block when we drop support for 0.64.
29
+ if (getReactNativeVersionNumber(rootDir) < 6500 ) {
30
+ // Artifacts for 0.65+ are published to Maven Central. If we're on an
31
+ // older version, we still need to use JCenter.
32
+ // noinspection JcenterRepositoryObsolete
33
+ jcenter() {
34
+ content {
35
+ includeGroup(" com.facebook.fbjni" )
36
+ includeGroup(" com.facebook.flipper" )
37
+ includeGroup(" com.facebook.fresco" )
38
+ includeGroup(" com.facebook.yoga" )
39
+ }
37
40
}
38
41
}
39
42
Original file line number Diff line number Diff line change @@ -137,3 +137,11 @@ ext.getFlipperVersion = { baseDir ->
137
137
// Use the recommended Flipper version
138
138
return recommendedFlipperVersion
139
139
}
140
+
141
+ ext. getReactNativeVersionNumber = { baseDir ->
142
+ def reactNativePath = findNodeModulesPath(baseDir, " react-native" )
143
+ def packageJson = file(" ${ reactNativePath} /package.json" )
144
+ def manifest = new JsonSlurper (). parseText(packageJson. text)
145
+ def (major, minor, patch) = manifest[" version" ]. tokenize(" ." )
146
+ return (major as int ) * 10000 + (minor as int ) * 100 + (patch as int )
147
+ }
You can’t perform that action at this time.
0 commit comments