diff --git a/build.gradle.kts b/build.gradle.kts index 0f43272..7c0ec54 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -40,6 +40,11 @@ val javadocJar: TaskProvider by tasks.registering(Jar::class) { from(dokkaHtml.outputDirectory) } +val sourcesJar: TaskProvider by tasks.registering(Jar::class) { + archiveClassifier.set("sources") + from(sourceSets["main"].allSource) +} + publishing { publications { register("mavenJava", MavenPublication::class) { @@ -72,6 +77,8 @@ publishing { afterEvaluate { // Add Javadoc JAR to the publication. artifact(javadocJar) + // Add sources JAR to the publication. + artifact(sourcesJar) } } }