@@ -7,6 +7,7 @@ import aws.sdk.kotlin.gradle.kmp.NATIVE_ENABLED
77import com.amazonaws.services.dynamodbv2.local.main.ServerRunner
88import com.amazonaws.services.dynamodbv2.local.server.DynamoDBProxyServer
99import com.google.devtools.ksp.gradle.KspTaskJvm
10+ import com.google.devtools.ksp.gradle.KspTaskMetadata
1011import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
1112import java.nio.file.Files
1213import java.nio.file.StandardCopyOption
@@ -71,21 +72,11 @@ if (project.NATIVE_ENABLED) {
7172 // https://github.com/google/ksp/issues/965
7273 dependencies.kspCommonMainMetadata(project(" :hll:dynamodb-mapper:dynamodb-mapper-ops-codegen" ))
7374
74- // Set up task dependencies since KSP doesn't handle this well:
75- tasks.withType<KotlinCompilationTask <* >>().all {
76- if (name != " kspCommonMainKotlinMetadata" ) {
77- dependsOn(" kspCommonMainKotlinMetadata" )
78- }
79- }
80-
81- listOf (" sourcesJar" , " linuxX64SourcesJar" , " jvmSourcesJar" ).forEach {
82- tasks.named(it) {
83- dependsOn(" kspCommonMainKotlinMetadata" )
84- }
85- }
86-
8775 kotlin.sourceSets.commonMain {
88- kotlin.srcDir(" build/generated/ksp/metadata/commonMain/kotlin" )
76+ tasks.withType<KspTaskMetadata > {
77+ // Wire up the generated source to the commonMain source set
78+ kotlin.srcDir(destinationDirectory)
79+ }
8980 }
9081} else {
9182 // FIXME This is a dirty hack for JVM-only builds which KSP doesn't consider to be "multiplatform". Explanation of
0 commit comments