Skip to content

Commit

Permalink
Try another way
Browse files Browse the repository at this point in the history
  • Loading branch information
deusaquilus committed Jul 22, 2024
1 parent f149105 commit afe1515
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions decomat-examples/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.com.intellij.psi.impl.source.SourceJavaCodeReference
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

plugins {
Expand Down Expand Up @@ -160,13 +161,17 @@ if (project.hasProperty("platform") && project.property("platform") == "linux")
}
}

afterEvaluate {
// find every task ending with SourcesJar and make it depend on kspCommonMainKotlinMetadata
tasks.matching { name.endsWith("SourcesJar") }.configureEach {
tasks.withType<Jar>().configureEach {
if (name.endsWith("SourcesJar")) {
dependsOn("kspCommonMainKotlinMetadata")
}
}

// find every task ending with SourcesJar and make it depend on kspCommonMainKotlinMetadata
//tasks.matching { name.endsWith("SourcesJar") }.configureEach {
// 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 afe1515

Please sign in to comment.