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

Commit

Permalink
Upgrade react-native-flipper Android to Gradle 7 (#2619)
Browse files Browse the repository at this point in the history
Summary:
- Resolve #2221

Pull Request resolved: #2619

Test Plan:
- Tested working example https://github.com/leotm/react-native-template-typescript
  - Commit leotm/react-native-template-new-architecture@2fd5737

![Screenshot 2021-07-26 at 09 07 06](https://user-images.githubusercontent.com/1881059/126955174-cd96087f-5201-4d4a-bb4a-18c951979c86.png)

Reviewed By: cekkaewnumchai

Differential Revision: D29933807

Pulled By: passy

fbshipit-source-id: 1440eee21da134e9d9087a28ad95724738786f10
  • Loading branch information
leotm authored and facebook-github-bot committed Jul 28, 2021
1 parent c2812a9 commit 64469f5
Showing 1 changed file with 19 additions and 33 deletions.
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
}
}
}

0 comments on commit 64469f5

Please sign in to comment.