Skip to content

Commit

Permalink
Add javadoc jar and sources jar to make Maven Central happy
Browse files Browse the repository at this point in the history
  • Loading branch information
bioball committed Oct 8, 2024
1 parent 800eec4 commit 018a1b2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ val nativeLibDir = layout.buildDirectory.dir("generated/libs/native/")
val treeSitterPklRepoDir = layout.buildDirectory.dir("repos/tree-sitter-pkl")
val treeSitterRepoDir = layout.buildDirectory.dir("repos/tree-sitter")

val dummy: SourceSet by sourceSets.creating

dependencies {
implementation(kotlin("reflect"))
implementation(libs.clikt)
Expand Down Expand Up @@ -137,6 +139,22 @@ tasks.shadowJar {
from(pklStdlibFiles) { rename("(.*).zip", "$1.jar") }
}

val javadocDummy by tasks.creating(Javadoc::class) { source = dummy.allJava }

// create a dummy javadoc jar to make maven central happy
val javadocJar by
tasks.registering(Jar::class) {
dependsOn(javadocDummy)
archiveClassifier = "javadoc"
from(javadocDummy.destinationDir)
}

val sourcesJar by
tasks.registering(Jar::class) {
from(sourceSets.main.get().allSource)
archiveClassifier = "sources"
}

fun configureRepo(
repo: String,
simpleRepoName: String,
Expand Down Expand Up @@ -397,6 +415,8 @@ publishing {
classifier = null
extension = "jar"
}
artifact(javadocJar.flatMap { it.archiveFile }) { classifier = "javadoc" }
artifact(sourcesJar.flatMap { it.archiveFile }) { classifier = "sources" }
pom {
name.set("pkl-lsp")
url.set("https://github.com/apple/pkl-lsp")
Expand Down

0 comments on commit 018a1b2

Please sign in to comment.