From fe48e8cfc3a8d400701649cbb866b02c7dc33b72 Mon Sep 17 00:00:00 2001 From: Theo Kanning Date: Tue, 6 Oct 2020 18:14:35 -0500 Subject: [PATCH] Add sources and javadocs jars to published artifacts JCenter requires these --- api/build.gradle | 12 ++++++++++++ build.gradle | 1 - client/build.gradle | 12 ++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/api/build.gradle b/api/build.gradle index 4286a8f..89f9809 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -14,10 +14,22 @@ ext { version = libraryVersion group = 'com.theokanning.openai-gpt3-java' +task sourcesJar(type: Jar, dependsOn: classes) { + classifier = 'sources' + from sourceSets.main.allSource +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} + publishing { publications { ApiPublication(MavenPublication) { from components.java + artifact sourcesJar + artifact javadocJar groupId project.group artifactId 'api' version libraryVersion diff --git a/build.gradle b/build.gradle index 85a20ae..1abc4d9 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,6 @@ buildscript { } } - allprojects { repositories { jcenter() diff --git a/client/build.gradle b/client/build.gradle index 4fba7c5..0cb11b8 100644 --- a/client/build.gradle +++ b/client/build.gradle @@ -16,10 +16,22 @@ ext { version = libraryVersion group = 'com.theokanning.openai-gpt3-java' +task sourcesJar(type: Jar, dependsOn: classes) { + classifier = 'sources' + from sourceSets.main.allSource +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} + publishing { publications { ClientPublication(MavenPublication) { from components.java + artifact sourcesJar + artifact javadocJar groupId project.group artifactId 'client' version libraryVersion