Compatibility with Gradle 7

This commit is contained in:
Nikita Dudin 2022-06-20 01:57:33 +03:00
parent 3825b3f1e0
commit 6ed672e60f

View File

@ -28,7 +28,7 @@ def safeExtGet(prop, fallback) {
} }
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
apply plugin: 'maven' apply plugin: 'maven-publish'
buildscript { buildscript {
// The Android Gradle plugin is only required when opening the android folder stand-alone. // The Android Gradle plugin is only required when opening the android folder stand-alone.
@ -47,7 +47,7 @@ buildscript {
} }
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
apply plugin: 'maven' apply plugin: 'maven-publish'
android { android {
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
@ -119,17 +119,18 @@ afterEvaluate { project ->
task androidJavadoc(type: Javadoc) { task androidJavadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs source = android.sourceSets.main.java.srcDirs
classpath += files(android.bootClasspath) classpath += files(android.bootClasspath)
classpath += files(project.getConfigurations().getByName('compile').asList()) project.getConfigurations().getByName('implementation').setCanBeResolved(true)
classpath += files(project.getConfigurations().getByName('implementation').asList())
include '**/*.java' include '**/*.java'
} }
task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
classifier = 'javadoc' archiveClassifier = 'javadoc'
from androidJavadoc.destinationDir from androidJavadoc.destinationDir
} }
task androidSourcesJar(type: Jar) { task androidSourcesJar(type: Jar) {
classifier = 'sources' archiveClassifier = 'sources'
from android.sourceSets.main.java.srcDirs from android.sourceSets.main.java.srcDirs
include '**/*.java' include '**/*.java'
} }
@ -148,12 +149,11 @@ afterEvaluate { project ->
archives androidJavadocJar archives androidJavadocJar
} }
task installArchives(type: Upload) { publishing {
configuration = configurations.archives repositories {
repositories.mavenDeployer { maven {
// Deploy to react-native-event-bridge/maven, ready to publish to npm url = uri("${rootProject.projectDir}/maven-repo")
repository url: "file://${projectDir}/../android/maven" }
configureReactNativePom pom
} }
} }
} }