Skip to content

Commit

Permalink
Trying another fix for publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
deusaquilus committed Jul 22, 2024
1 parent a2550cf commit b5d5fd3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
7 changes: 6 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,10 @@ allprojects {
tasks.withType<AbstractPublishToMaven>().configureEach {
val signingTasks = tasks.withType<Sign>()
mustRunAfter(signingTasks)

// Also, do not publish the decomat-examples project
onlyIf {
!this.project.name.contains("decomat-examples")
}
}
}
}
21 changes: 1 addition & 20 deletions decomat-examples/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -161,31 +161,12 @@ if (project.hasProperty("platform") && project.property("platform") == "linux")
}
}

tasks.withType<org.gradle.api.tasks.bundling.Jar>().configureEach {
println("-------------- Configuring org.gradle.api.tasks.bundling.Jar: ${name} --------------")
if (name.endsWith("SourcesJar")) {
//dependsOn("kspCommonMainKotlinMetadata")
}
}

tasks.withType<org.gradle.jvm.tasks.Jar>().configureEach {
println("-------------- Configuring org.gradle.jvm.tasks.Jar: ${name} ${if (name.endsWith("SourcesJar")) "(YAY)" else ""} --------------")
if (name.endsWith("SourcesJar")) {
//dependsOn("kspCommonMainKotlinMetadata")
dependsOn("kspCommonMainKotlinMetadata")
}
}

tasks.forEach {
println("---------- [PRINTING] Task: ${it.name} - ${it::class.java} ${if (name.endsWith("SourcesJar")) "(YAY)" else ""} ----------")
}

// find every task ending with SourcesJar and make it depend on kspCommonMainKotlinMetadata
tasks.matching { true }.configureEach {
println("---------- [MATCHING TRUE] Task: ${name} - ${this::class.java} ${if (name.endsWith("SourcesJar")) "(YAY)" else ""} ----------")

//dependsOn("kspCommonMainKotlinMetadata")
}

// Add the kspCommonMainKotlinMetadata dependency to sourcesJar tasks if needed
// (i.e. in some cases the task e.g. tasks("jsSourcesJar") will not exist)
//tasks.findByName("jsSourcesJar")?.dependsOn("kspCommonMainKotlinMetadata")
Expand Down

0 comments on commit b5d5fd3

Please sign in to comment.