Skip to content

Commit

Permalink
Compatibility with Gradle 7
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaDudin committed Jun 19, 2022
1 parent 3825b3f commit 6ed672e
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def safeExtGet(prop, fallback) {
}

apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'maven-publish'

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

apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'maven-publish'

android {
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
Expand Down Expand Up @@ -119,17 +119,18 @@ afterEvaluate { project ->
task androidJavadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
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'
}

task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
classifier = 'javadoc'
archiveClassifier = 'javadoc'
from androidJavadoc.destinationDir
}

task androidSourcesJar(type: Jar) {
classifier = 'sources'
archiveClassifier = 'sources'
from android.sourceSets.main.java.srcDirs
include '**/*.java'
}
Expand All @@ -148,12 +149,11 @@ afterEvaluate { project ->
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
}
publishing {
repositories {
maven {
url = uri("${rootProject.projectDir}/maven-repo")
}
}
}
}

0 comments on commit 6ed672e

Please sign in to comment.