Skip to content

Commit

Permalink
fix: add sources.jar in publishing artifacts
Browse files Browse the repository at this point in the history
Signed-off-by: starry-shivam <[email protected]>
  • Loading branch information
starry-shivam committed Jun 19, 2024
1 parent e36b525 commit 8b41b8e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ val javadocJar: TaskProvider<Jar> by tasks.registering(Jar::class) {
from(dokkaHtml.outputDirectory)
}

val sourcesJar: TaskProvider<Jar> by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}

publishing {
publications {
register("mavenJava", MavenPublication::class) {
Expand Down Expand Up @@ -72,6 +77,8 @@ publishing {
afterEvaluate {
// Add Javadoc JAR to the publication.
artifact(javadocJar)
// Add sources JAR to the publication.
artifact(sourcesJar)
}
}
}
Expand Down

0 comments on commit 8b41b8e

Please sign in to comment.