From 229f928269511eecc726a2182f001f37d609db52 Mon Sep 17 00:00:00 2001 From: Vankka Date: Thu, 9 Jun 2022 19:29:21 +0300 Subject: [PATCH] Add sources & javadoc jars to api, configure publication --- api/build.gradle | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/api/build.gradle b/api/build.gradle index 742785c3..ba9ad6c7 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -1,4 +1,5 @@ apply from: rootProject.file('buildscript/relocations.gradle') +apply plugin: 'maven-publish' dependencies { // Annotations @@ -30,6 +31,11 @@ sourceSets { } } +java { + withSourcesJar() + withJavadocJar() +} + jar { from sourceSets.ap.output } @@ -38,3 +44,24 @@ license { // Overwrite the default header = rootProject.file('buildscript/license/API_LICENSE_HEADER') } + +publishing { + publications { + maven(MavenPublication) { + // Shaded & relocated jar... + artifact source: shadowJar, classifier: null + artifact sourcesJar + artifact javadocJar + + // ...and a pom with no dependencies + pom { + licenses { + license { + name = 'The MIT License' + url = 'https://opensource.org/licenses/MIT' + } + } + } + } + } +}