From b11f555b011fcca42655832bd70ae10181d9cf81 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 6 Jan 2022 10:05:37 +0100 Subject: [PATCH] Do not upload source and Javadoc Only empty jars will be uploaded --- android/build.gradle | 15 +++++++++------ android/olm-sdk/build.gradle | 8 +++++++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index fd2647e..485b3a4 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -9,7 +9,7 @@ buildscript { // Release notes of Android Gradle Plugin (AGP): // https://developer.android.com/studio/releases/gradle-plugin classpath 'com.android.tools.build:gradle:7.0.4' - classpath 'com.vanniktech:gradle-maven-publish-plugin:0.17.0' + classpath 'com.vanniktech:gradle-maven-publish-plugin:0.18.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } @@ -21,11 +21,14 @@ allprojects { google() } - plugins.withId("com.vanniktech.maven.publish") { - // Publish on s01.oss.sonatype.org - //https://github.com/vanniktech/gradle-maven-publish-plugin#where-to-upload-to - mavenPublish { - sonatypeHost = "S01" + plugins.withId("com.vanniktech.maven.publish.base") { + group = project.getProperties().getOrDefault("GROUP", "0.0.0") + version = project.getProperties().getOrDefault("VERSION_NAME", "name") + + mavenPublishing { + publishToMavenCentral("S01") + pomFromGradleProperties() + signAllPublications() } } } diff --git a/android/olm-sdk/build.gradle b/android/olm-sdk/build.gradle index 2748b82..3643b97 100644 --- a/android/olm-sdk/build.gradle +++ b/android/olm-sdk/build.gradle @@ -1,7 +1,9 @@ import org.apache.tools.ant.taskdefs.condition.Os +import com.vanniktech.maven.publish.AndroidLibrary +import com.vanniktech.maven.publish.JavadocJar apply plugin: 'com.android.library' -apply plugin: "com.vanniktech.maven.publish" +apply plugin: "com.vanniktech.maven.publish.base" android { compileSdk 31 @@ -159,3 +161,7 @@ dependencies { androidTestImplementation 'androidx.test:rules:1.4.0' androidTestImplementation 'androidx.test.ext:junit:1.1.3' } + +mavenPublishing { + configure(new AndroidLibrary(new JavadocJar.Empty(), false)) +}