Upgrade react-native-flipper Android to Gradle 7 (#2619)
Summary:
- Resolve https://github.com/facebook/flipper/issues/2221
Pull Request resolved: https://github.com/facebook/flipper/pull/2619
Test Plan:
- Tested working example https://github.com/leotm/react-native-template-typescript
- Commit 2fd5737c33

Reviewed By: cekkaewnumchai
Differential Revision: D29933807
Pulled By: passy
fbshipit-source-id: 1440eee21da134e9d9087a28ad95724738786f10
This commit is contained in:
committed by
Facebook GitHub Bot
parent
c2812a92ee
commit
64469f5557
@@ -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
|
||||
@@ -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)
|
||||
@@ -74,7 +73,6 @@ repositories {
|
||||
url "$rootDir/../node_modules/jsc-android/dist"
|
||||
}
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -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'
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user