Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,18 @@ repositories {
google()
mavenCentral()

// TODO: Remove these when they've been published to Maven Central.
// See https://github.com/microsoft/react-native-test-app/issues/305
// noinspection JcenterRepositoryObsolete
jcenter() {
content {
includeGroup("com.facebook.fbjni")
includeGroup("com.facebook.flipper")
includeGroup("com.facebook.fresco")
includeGroup("com.facebook.yoga")
// TODO: Remove this block when we drop support for 0.64.
if (getReactNativeVersionNumber(rootDir) < 6500) {
// Artifacts for 0.65+ are published to Maven Central. If we're on an
// older version, we still need to use JCenter.
// noinspection JcenterRepositoryObsolete
jcenter() {
content {
includeGroup("com.facebook.fbjni")
includeGroup("com.facebook.flipper")
includeGroup("com.facebook.fresco")
includeGroup("com.facebook.yoga")
}
}
}

Expand Down
8 changes: 8 additions & 0 deletions android/test-app-util.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,11 @@ ext.getFlipperVersion = { baseDir ->
// Use the recommended Flipper version
return recommendedFlipperVersion
}

ext.getReactNativeVersionNumber = { baseDir ->
def reactNativePath = findNodeModulesPath(baseDir, "react-native")
def packageJson = file("${reactNativePath}/package.json")
def manifest = new JsonSlurper().parseText(packageJson.text)
def (major, minor, patch) = manifest["version"].tokenize(".")
return (major as int) * 10000 + (minor as int) * 100 + (patch as int)
}