Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Upgrade react-native-flipper Android to Gradle 7 #2619

Closed
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
52 changes: 19 additions & 33 deletions react-native/react-native-flipper/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@

// android/build.gradle

buildscript {
// The Android Gradle plugin is only required when opening the android folder stand-alone.
// This avoids unnecessary downloads and potential conflicts when the library is included as a
// module dependency in an application project.
// ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies
if (project == rootProject) {
repositories {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
}
}
}

plugins {
id 'maven-publish'
}

// based on:
//
// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle
Expand All @@ -27,26 +46,6 @@ def safeExtGet(prop, fallback) {
}

apply plugin: 'com.android.library'
apply plugin: 'maven'

buildscript {
// The Android Gradle plugin is only required when opening the android folder stand-alone.
// This avoids unnecessary downloads and potential conflicts when the library is included as a
// module dependency in an application project.
// ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies
if (project == rootProject) {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
}
}
}

apply plugin: 'com.android.library'
apply plugin: 'maven'

android {
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
Expand Down Expand Up @@ -74,7 +73,6 @@ repositories {
url "$rootDir/../node_modules/jsc-android/dist"
}
google()
jcenter()
}

dependencies {
Expand Down Expand Up @@ -120,17 +118,14 @@ afterEvaluate { project ->
task androidJavadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += files(android.bootClasspath)
classpath += files(project.getConfigurations().getByName('compile').asList())
include '**/*.java'
}

task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
classifier = 'javadoc'
from androidJavadoc.destinationDir
}

task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
include '**/*.java'
}
Expand All @@ -148,13 +143,4 @@ afterEvaluate { project ->
archives androidSourcesJar
archives androidJavadocJar
}

task installArchives(type: Upload) {
configuration = configurations.archives
repositories.mavenDeployer {
// Deploy to react-native-event-bridge/maven, ready to publish to npm
repository url: "file://${projectDir}/../android/maven"
configureReactNativePom pom
}
}
}