Skip to content

Commit

Permalink
Use React Native and Hermes modules from Maven
Browse files Browse the repository at this point in the history
We no longer need to publish these binaries because React Native team is publishing React Native binaries to Maven.
  • Loading branch information
fluiddot committed Jun 8, 2023
1 parent d4159c2 commit b82d54f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 33 deletions.
10 changes: 2 additions & 8 deletions packages/react-native-aztec/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,7 @@ repositories {
}
maven { url "https://a8c-libs.s3.amazonaws.com/android/react-native-mirror" }
google()
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
mavenCentral()
}

dependencies {
Expand All @@ -100,7 +94,7 @@ dependencies {

def rnVersion = readReactNativeVersion('../../../package.json', 'devDependencies')
println "react-native version for react-native-aztec: $rnVersion"
implementation "com.facebook.react:react-native:$rnVersion"
implementation "com.facebook.react:react-android:$rnVersion"
}

project.afterEvaluate {
Expand Down
5 changes: 5 additions & 0 deletions packages/react-native-bridge/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ plugins {

allprojects {
repositories {
mavenCentral()
// Starting from React Native 0.70, we no longer need to publish React Native binaries
// because they are already published to Maven (reference: https://t.ly/Biea).
// However, the third-party dependencies from forked repositories still point to older
// versions of React Native, hence we need to keep this Maven repository.
maven { url "https://a8c-libs.s3.amazonaws.com/android/react-native-mirror" }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,7 @@ repositories {
maven { url "https://a8c-libs.s3.amazonaws.com/android" }
maven { url "https://jitpack.io" }
google()
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
mavenCentral()
}

dependencies {
Expand All @@ -68,7 +62,7 @@ dependencies {
println "react-native version for react-native-bridge: $rnVersion"
def packageJson = '../../../react-native-editor/package.json'

implementation "com.facebook.react:react-native:$rnVersion"
implementation "com.facebook.react:react-android:$rnVersion"
implementation "com.github.wordpress-mobile:react-native-video:${extractPackageVersion(packageJson, 'react-native-video', 'dependencies')}"
implementation "com.github.wordpress-mobile:react-native-linear-gradient:${extractPackageVersion(packageJson, 'react-native-linear-gradient', 'dependencies')}"
implementation "com.github.wordpress-mobile:react-native-slider:${extractPackageVersion(packageJson, '@react-native-community/slider', 'dependencies')}"
Expand All @@ -93,9 +87,7 @@ dependencies {
implementation "$reactNativeLibrariesGroupId:react-native-clipboard:${extractPackageVersion(packageJson, '@react-native-clipboard/clipboard', 'dependencies')}"
implementation "$reactNativeLibrariesGroupId:react-native-fast-image:${extractPackageVersion(packageJson, 'react-native-fast-image', 'dependencies')}"

runtimeOnly("com.facebook.react:hermes-engine:$rnVersion", {
exclude group:'com.facebook.fbjni'
})
runtimeOnly "com.facebook.react:hermes-android:$rnVersion"

if (willPublishReactNativeBridgeBinary) {
implementation "org.wordpress-mobile.gutenberg-mobile:react-native-aztec:$reactNativeAztecVersion"
Expand Down
11 changes: 5 additions & 6 deletions packages/react-native-editor/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ dependencies {

implementation "org.wordpress-mobile.gutenberg-mobile:react-native-bridge"
implementation 'androidx.appcompat:appcompat:1.2.0'
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:${extractPackageVersion(packageJson, 'react-native', 'dependencies')}"
// The version of react-native is set by the React Native Gradle Plugin
implementation "com.facebook.react:react-android"

implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"

Expand All @@ -155,10 +155,9 @@ dependencies {
implementation "$reactNativeLibrariesGroupId:react-native-masked-view:${extractPackageVersion(packageJson, '@react-native-masked-view/masked-view', 'dependencies')}"
implementation "$reactNativeLibrariesGroupId:react-native-clipboard:${extractPackageVersion(packageJson, '@react-native-clipboard/clipboard', 'dependencies')}"
implementation "$reactNativeLibrariesGroupId:react-native-fast-image:${extractPackageVersion(packageJson, 'react-native-fast-image', 'dependencies')}"

implementation("com.facebook.react:hermes-engine:${extractPackageVersion(packageJson, 'react-native', 'dependencies')}") {
exclude group:'com.facebook.fbjni'
}

// The version of react-native is set by the React Native Gradle Plugin
implementation "com.facebook.react:hermes-android"

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
Expand Down
9 changes: 1 addition & 8 deletions packages/react-native-editor/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@ buildscript {

allprojects {
repositories {
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
mavenCentral()
mavenLocal()
maven {
url "https://a8c-libs.s3.amazonaws.com/android"
Expand All @@ -41,7 +35,6 @@ allprojects {
includeGroupByRegex "org.wordpress-mobile.react-native-libraries.*"
}
}
maven { url "https://a8c-libs.s3.amazonaws.com/android/react-native-mirror" }
maven { url 'https://www.jitpack.io' }
google()
}
Expand Down

0 comments on commit b82d54f

Please sign in to comment.