Skip to content

Commit

Permalink
Made module registry files uniquely named
Browse files Browse the repository at this point in the history
  • Loading branch information
raamcosta committed Mar 10, 2024
1 parent 867f492 commit 9c8e4c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ internal class ModuleRegistryWriter(
)
)
codeGenerator.makeFile(
"_ModuleRegistry",
"_ModuleRegistry_$registryId",
"_generated._ramcosta._composedestinations._moduleregistry"
).writeSourceFile(
packageStatement = "package _generated._ramcosta._composedestinations._moduleregistry",
Expand Down Expand Up @@ -109,7 +109,7 @@ internal class ModuleRegistryWriter(
moduleRegistryId: String
) {
codeGenerator.makeFile(
"_PathInfo_ModuleRegistry",
"_PathInfo_ModuleRegistry_$moduleRegistryId",
"_generated._ramcosta._composedestinations._moduleregistry"
).use {
it += """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class Processor(

private fun generateModuleRegistryPathInfo(resolver: Resolver) {
val moduleRegistryFile: KSFile = resolver.getNewFiles()
.firstOrNull { it.fileName == "_ModuleRegistry.kt" }
.firstOrNull { it.fileName.startsWith("_ModuleRegistry_") }
?: return
val moduleRegistryId = moduleRegistryFile
.declarations.first {
Expand Down

0 comments on commit 9c8e4c6

Please sign in to comment.