From bfc645b18eb4daf87936b364aa3abc4cff26f3b5 Mon Sep 17 00:00:00 2001 From: Timo Glastra Date: Fri, 1 Jul 2022 14:13:30 +0200 Subject: [PATCH] fix(android): maven plugin id (#49) Signed-off-by: Timo Glastra --- android/build.gradle | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 3067ca5..37c0592 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -36,7 +36,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. @@ -54,9 +54,6 @@ buildscript { } } -apply plugin: 'com.android.library' -apply plugin: 'maven' - android { compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) @@ -130,17 +127,16 @@ afterEvaluate { project -> task androidJavadoc(type: Javadoc) { source = android.sourceSets.main.java.srcDirs classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').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' } @@ -154,17 +150,12 @@ afterEvaluate { project -> } } - artifacts { - archives androidSourcesJar - 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 { + publications { + maven(MavenPublication) { + artifact androidSourcesJar + artifact androidJavadocJar } + } } }