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

Commit 64469f5

Browse files
leotmfacebook-github-bot
authored andcommitted
Upgrade react-native-flipper Android to Gradle 7 (#2619)
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
1 parent c2812a9 commit 64469f5

File tree

1 file changed

+19
-33
lines changed

1 file changed

+19
-33
lines changed

react-native/react-native-flipper/android/build.gradle

+19-33
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,25 @@
77

88
// android/build.gradle
99

10+
buildscript {
11+
// The Android Gradle plugin is only required when opening the android folder stand-alone.
12+
// This avoids unnecessary downloads and potential conflicts when the library is included as a
13+
// module dependency in an application project.
14+
// ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies
15+
if (project == rootProject) {
16+
repositories {
17+
google()
18+
}
19+
dependencies {
20+
classpath 'com.android.tools.build:gradle:4.2.1'
21+
}
22+
}
23+
}
24+
25+
plugins {
26+
id 'maven-publish'
27+
}
28+
1029
// based on:
1130
//
1231
// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle
@@ -27,26 +46,6 @@ def safeExtGet(prop, fallback) {
2746
}
2847

2948
apply plugin: 'com.android.library'
30-
apply plugin: 'maven'
31-
32-
buildscript {
33-
// The Android Gradle plugin is only required when opening the android folder stand-alone.
34-
// This avoids unnecessary downloads and potential conflicts when the library is included as a
35-
// module dependency in an application project.
36-
// ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies
37-
if (project == rootProject) {
38-
repositories {
39-
google()
40-
jcenter()
41-
}
42-
dependencies {
43-
classpath 'com.android.tools.build:gradle:3.4.1'
44-
}
45-
}
46-
}
47-
48-
apply plugin: 'com.android.library'
49-
apply plugin: 'maven'
5049

5150
android {
5251
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
@@ -74,7 +73,6 @@ repositories {
7473
url "$rootDir/../node_modules/jsc-android/dist"
7574
}
7675
google()
77-
jcenter()
7876
}
7977

8078
dependencies {
@@ -120,17 +118,14 @@ afterEvaluate { project ->
120118
task androidJavadoc(type: Javadoc) {
121119
source = android.sourceSets.main.java.srcDirs
122120
classpath += files(android.bootClasspath)
123-
classpath += files(project.getConfigurations().getByName('compile').asList())
124121
include '**/*.java'
125122
}
126123

127124
task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
128-
classifier = 'javadoc'
129125
from androidJavadoc.destinationDir
130126
}
131127

132128
task androidSourcesJar(type: Jar) {
133-
classifier = 'sources'
134129
from android.sourceSets.main.java.srcDirs
135130
include '**/*.java'
136131
}
@@ -148,13 +143,4 @@ afterEvaluate { project ->
148143
archives androidSourcesJar
149144
archives androidJavadocJar
150145
}
151-
152-
task installArchives(type: Upload) {
153-
configuration = configurations.archives
154-
repositories.mavenDeployer {
155-
// Deploy to react-native-event-bridge/maven, ready to publish to npm
156-
repository url: "file://${projectDir}/../android/maven"
157-
configureReactNativePom pom
158-
}
159-
}
160146
}

0 commit comments

Comments
 (0)