Skip to content

Commit 6ed672e

Browse files
committed
Compatibility with Gradle 7
1 parent 3825b3f commit 6ed672e

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

android/build.gradle

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def safeExtGet(prop, fallback) {
2828
}
2929

3030
apply plugin: 'com.android.library'
31-
apply plugin: 'maven'
31+
apply plugin: 'maven-publish'
3232

3333
buildscript {
3434
// The Android Gradle plugin is only required when opening the android folder stand-alone.
@@ -47,7 +47,7 @@ buildscript {
4747
}
4848

4949
apply plugin: 'com.android.library'
50-
apply plugin: 'maven'
50+
apply plugin: 'maven-publish'
5151

5252
android {
5353
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
@@ -119,17 +119,18 @@ afterEvaluate { project ->
119119
task androidJavadoc(type: Javadoc) {
120120
source = android.sourceSets.main.java.srcDirs
121121
classpath += files(android.bootClasspath)
122-
classpath += files(project.getConfigurations().getByName('compile').asList())
122+
project.getConfigurations().getByName('implementation').setCanBeResolved(true)
123+
classpath += files(project.getConfigurations().getByName('implementation').asList())
123124
include '**/*.java'
124125
}
125126

126127
task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
127-
classifier = 'javadoc'
128+
archiveClassifier = 'javadoc'
128129
from androidJavadoc.destinationDir
129130
}
130131

131132
task androidSourcesJar(type: Jar) {
132-
classifier = 'sources'
133+
archiveClassifier = 'sources'
133134
from android.sourceSets.main.java.srcDirs
134135
include '**/*.java'
135136
}
@@ -148,12 +149,11 @@ afterEvaluate { project ->
148149
archives androidJavadocJar
149150
}
150151

151-
task installArchives(type: Upload) {
152-
configuration = configurations.archives
153-
repositories.mavenDeployer {
154-
// Deploy to react-native-event-bridge/maven, ready to publish to npm
155-
repository url: "file://${projectDir}/../android/maven"
156-
configureReactNativePom pom
157-
}
152+
publishing {
153+
repositories {
154+
maven {
155+
url = uri("${rootProject.projectDir}/maven-repo")
156+
}
157+
}
158158
}
159159
}

0 commit comments

Comments
 (0)