Skip to content

Commit

Permalink
[gradle] Fix KMP component publication configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
terrakok committed Aug 30, 2024
1 parent f86b9ed commit 6dbe547
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,18 @@ private fun Project.configureKmpResources(
//TODO temporary API misuse. will be changed on the KMP side
//https://youtrack.jetbrains.com/issue/KT-70909
val target = compilation.target
val kmpResourceRoot = KotlinTargetResourcesPublication.ResourceRoot(
allCompilationResources,
emptyList(),
emptyList()
)
val kmpEmptyPath = provider { File("") }
val emptyDir = layout.buildDirectory.dir("$RES_GEN_DIR/emptyResourcesDir").map { it.asFile }
logger.info("Configure KMP component publication for '${compilation.target.targetName}'")
kmpResources.publishResourcesAsKotlinComponent(
target,
{ kmpResourceRoot },
{ kotlinSourceSet ->
if (kotlinSourceSet == compilation.defaultSourceSet) {
KotlinTargetResourcesPublication.ResourceRoot(allCompilationResources, emptyList(), emptyList())
} else {
KotlinTargetResourcesPublication.ResourceRoot(emptyDir, emptyList(), emptyList())
}
},
kmpEmptyPath
)

Expand Down

0 comments on commit 6dbe547

Please # to comment.