Skip to content

Commit

Permalink
Copy javadoc and sources in publishing tasks
Browse files Browse the repository at this point in the history
so that signing doesn't happen in-place and introduce dangling
artifacts.
  • Loading branch information
ting-yuan committed Oct 1, 2024
1 parent c82ba0d commit d409236
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 13 deletions.
12 changes: 7 additions & 5 deletions symbol-processing-aa-embeddable/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -224,22 +224,24 @@ tasks {
from(copyDeps)
filter { it.replaceWithKsp() }
}

withType<PublishToMavenRepository> { dependsOn("signShadowPublication") }
withType<PublishToMavenLocal> { dependsOn("signShadowPublication") }
val javadocJar by creating(Jar::class) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set("javadoc")
from(project(":kotlin-analysis-api").tasks["dokkaJavadocJar"])
}

publish {
dependsOn(shadowJar)
dependsOn(sourcesJar)
dependsOn(project(":kotlin-analysis-api").tasks["dokkaJavadocJar"])
dependsOn(javadocJar)
}
}

publishing {
publications {
create<MavenPublication>("shadow") {
artifactId = "symbol-processing-aa-embeddable"
artifact(project(":kotlin-analysis-api").tasks["dokkaJavadocJar"])
artifact(tasks["javadocJar"])
artifact(tasks["sourcesJar"])
artifact(tasks["shadowJar"])
pom {
Expand Down
18 changes: 14 additions & 4 deletions symbol-processing-cmdline/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,30 @@ tasks.withType<ShadowJar>() {
}

tasks {
val sourcesJar by creating(Jar::class) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set("sources")
from(project(":kotlin-analysis-api").sourceSets.main.get().allSource)
}
val javadocJar by creating(Jar::class) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set("javadoc")
from(project(":compiler-plugin").tasks["dokkaJavadocJar"])
}
publish {
dependsOn(shadowJar)
dependsOn(project(":compiler-plugin").tasks["dokkaJavadocJar"])
dependsOn(project(":compiler-plugin").tasks["sourcesJar"])
dependsOn(javadocJar)
dependsOn(sourcesJar)
}
}

publishing {
publications {
create<MavenPublication>("shadow") {
artifactId = "symbol-processing-cmdline"
artifact(tasks["javadocJar"])
artifact(tasks["sourcesJar"])
artifact(tasks["shadowJar"])
artifact(project(":compiler-plugin").tasks["dokkaJavadocJar"])
artifact(project(":compiler-plugin").tasks["sourcesJar"])
pom {
name.set("com.google.devtools.ksp:symbol-processing-cmdline")
description.set("Symbol processing for K/N and command line")
Expand Down
18 changes: 14 additions & 4 deletions symbol-processing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,29 @@ tasks.withType<ShadowJar> {
}

tasks {
val sourcesJar by creating(Jar::class) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set("sources")
from(project(":kotlin-analysis-api").sourceSets.main.get().allSource)
}
val javadocJar by creating(Jar::class) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set("javadoc")
from(project(":compiler-plugin").tasks["dokkaJavadocJar"])
}
publish {
dependsOn(shadowJar)
dependsOn(project(":compiler-plugin").tasks["dokkaJavadocJar"])
dependsOn(project(":compiler-plugin").tasks["sourcesJar"])
dependsOn(javadocJar)
dependsOn(sourcesJar)
}
}

publishing {
publications {
create<MavenPublication>("shadow") {
artifactId = "symbol-processing"
artifact(project(":compiler-plugin").tasks["dokkaJavadocJar"])
artifact(project(":compiler-plugin").tasks["sourcesJar"])
artifact(tasks["javadocJar"])
artifact(tasks["sourcesJar"])
artifact(tasks["shadowJar"])
pom {
name.set("com.google.devtools.ksp:symbol-processing")
Expand Down

0 comments on commit d409236

Please sign in to comment.