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