From 3a9ef58c9aab33291ae8685f84618a1013d236f7 Mon Sep 17 00:00:00 2001 From: Davide Menegatti Date: Thu, 11 Mar 2021 23:12:20 +0100 Subject: [PATCH] v1.0.1 - Added sources to publication --- build.gradle | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index f35b825..b2e2bbf 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,20 @@ +import java.nio.charset.StandardCharsets + plugins { id 'java' + id 'java-library' id 'maven-publish' } +sourceCompatibility = JavaVersion.VERSION_1_8 +targetCompatibility = JavaVersion.VERSION_1_8 + +javadoc.options.encoding = StandardCharsets.UTF_8 +compileJava.options.encoding = StandardCharsets.UTF_8 +compileTestJava.options.encoding = StandardCharsets.UTF_8 + group 'com.menecats' -version '1.0.0' +version '1.0.1' repositories { mavenCentral() @@ -13,6 +23,11 @@ repositories { dependencies { } +task sourceJar(type: Jar) { + classifier 'sources' + from sourceSets.main.allJava +} + publishing { repositories { maven { @@ -29,9 +44,10 @@ publishing { polybool(MavenPublication) { version = version groupId = group - artifactId = 'polybool-java' + artifactId = rootProject.name from components.java + artifact tasks.sourceJar } } } \ No newline at end of file