Skip to content

Commit

Permalink
remove jcenter (facebook#31609)
Browse files Browse the repository at this point in the history
Summary:
jcenter is read-only now, and newer versions of dependencies will be published to either MavenCentral or Jitpack. This PR removes jcenter to avoid future issues, then uses MavenCentral and Jitpack as replacement. Current flipper depends on Stetho version that is not available on MavenCentral, so had to exclude and bump the version.

Both Gradle and Buck successfully download all the dependencies.

[Android] [Changed] - Remove jcenter

Pull Request resolved: facebook#31609

Test Plan: rn-tester builds and runs as expected.

Reviewed By: mdvacca

Differential Revision: D28802444

Pulled By: ShikaSD

fbshipit-source-id: 043ef079d0cda77a1f8dd732678452ed712741a4
  • Loading branch information
dulmandakh authored and Titozzz committed Jun 7, 2021
1 parent b9b682d commit 551b397
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 36 deletions.
1 change: 0 additions & 1 deletion .buckconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
[maven_repositories]
central = https://repo1.maven.org/maven2
google = https://maven.google.com/
jcenter = https://jcenter.bintray.com/

[alias]
rntester = //packages/rn-tester/android/app:app
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ indent_size = 2
[*.gradle]
indent_size = 4

[*.kts]
indent_size = 4

[BUCK]
indent_size = 4

Expand Down
2 changes: 1 addition & 1 deletion ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ android {

dependencies {
api("com.facebook.infer.annotation:infer-annotation:0.11.2")
api("com.facebook.yoga:proguard-annotations:1.17.0")
api("com.facebook.yoga:proguard-annotations:1.19.0")
api("javax.inject:javax.inject:1")
api("androidx.appcompat:appcompat:1.0.2")
api("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ rn_prebuilt_jar(

fb_native.remote_file(
name = "annotations-binary.jar",
sha1 = "95ff77fd4870136a0454dd7ccad8813db87bd9ab",
url = "https://jcenter.bintray.com/com/facebook/yoga/proguard-annotations/1.17.0/proguard-annotations-1.17.0.jar",
sha1 = "fcbbb39052e6490eaaf6a6959c49c3a4fbe87c63",
url = "mvn:com.facebook.yoga:proguard-annotations:jar:1.19.0",
)

rn_android_library(
Expand Down
15 changes: 1 addition & 14 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ buildscript {
mavenLocal()
google()
mavenCentral()
jcenter {
content {
includeModule("org.jetbrains.trove4j", "trove4j")
}
}
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.1")
Expand All @@ -38,18 +33,10 @@ allprojects {
mavenLocal()
google()
mavenCentral()
jcenter {
content {
includeModule("org.jetbrains.trove4j", "trove4j")
includeModule("com.facebook.yoga", "proguard-annotations")
includeModule("com.facebook.fbjni", "fbjni-java-only")
includeModule("com.facebook.fresco", "stetho")
}
}
}

// used to override ndk path on CI
if (System.getenv("LOCAL_ANDROID_NDK_VERSION") != null) {
setProperty("ANDROID_NDK_VERSION", System.getenv("LOCAL_ANDROID_NDK_VERSION"))
setProperty("ANDROID_NDK_VERSION", System.getenv("LOCAL_ANDROID_NDK_VERSION"))
}
}
10 changes: 0 additions & 10 deletions packages/react-native-codegen/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ buildscript {
mavenLocal()
google()
mavenCentral()
jcenter {
content {
includeGroup("org.jetbrains.trove4j")
}
}
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.1")
Expand All @@ -28,11 +23,6 @@ allprojects {
mavenLocal()
google()
mavenCentral()
jcenter {
content {
includeGroup("org.jetbrains.trove4j")
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,5 @@ allprojects {
mavenLocal()
google()
mavenCentral()
jcenter {
content {
includeGroup("org.jetbrains.trove4j")
}
}
}
}
2 changes: 1 addition & 1 deletion packages/react-native-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins {

repositories {
google()
jcenter()
mavenCentral()
}

gradlePlugin {
Expand Down
2 changes: 2 additions & 0 deletions packages/rn-tester/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ dependencies {
hermesDebugImplementation files(hermesPath + "hermes-debug.aar")
hermesReleaseImplementation files(hermesPath + "hermes-release.aar")

debugImplementation("com.facebook.fresco:stetho:2.3.0")
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}
Expand All @@ -223,6 +224,7 @@ dependencies {

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.facebook.fresco', module:'stetho'
}

if (useIntlJsc) {
Expand Down
2 changes: 2 additions & 0 deletions template/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ dependencies {

implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"

debugImplementation("com.facebook.fresco:stetho:2.3.0")
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}
Expand All @@ -196,6 +197,7 @@ dependencies {

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.facebook.fresco', module:'stetho'
}

if (enableHermes) {
Expand Down
4 changes: 2 additions & 2 deletions template/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
}
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.1")
Expand All @@ -21,6 +21,7 @@ buildscript {

allprojects {
repositories {
mavenCentral()
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
Expand All @@ -32,7 +33,6 @@ allprojects {
}

google()
jcenter()
maven { url 'https://www.jitpack.io' }
}
}

0 comments on commit 551b397

Please sign in to comment.