7
7
8
8
// android/build.gradle
9
9
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
+
10
29
// based on:
11
30
//
12
31
// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle
@@ -27,26 +46,6 @@ def safeExtGet(prop, fallback) {
27
46
}
28
47
29
48
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'
50
49
51
50
android {
52
51
compileSdkVersion safeExtGet(' compileSdkVersion' , DEFAULT_COMPILE_SDK_VERSION )
@@ -74,7 +73,6 @@ repositories {
74
73
url " $rootDir /../node_modules/jsc-android/dist"
75
74
}
76
75
google()
77
- jcenter()
78
76
}
79
77
80
78
dependencies {
@@ -120,17 +118,14 @@ afterEvaluate { project ->
120
118
task androidJavadoc(type : Javadoc ) {
121
119
source = android. sourceSets. main. java. srcDirs
122
120
classpath + = files(android. bootClasspath)
123
- classpath + = files(project. getConfigurations(). getByName(' compile' ). asList())
124
121
include ' **/*.java'
125
122
}
126
123
127
124
task androidJavadocJar(type : Jar , dependsOn : androidJavadoc) {
128
- classifier = ' javadoc'
129
125
from androidJavadoc. destinationDir
130
126
}
131
127
132
128
task androidSourcesJar(type : Jar ) {
133
- classifier = ' sources'
134
129
from android. sourceSets. main. java. srcDirs
135
130
include ' **/*.java'
136
131
}
@@ -148,13 +143,4 @@ afterEvaluate { project ->
148
143
archives androidSourcesJar
149
144
archives androidJavadocJar
150
145
}
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
- }
160
146
}
0 commit comments