add readme to generator and add several fixes in processor

This commit is contained in:
2023-02-22 10:20:15 +06:00
parent 9c40d7da3d
commit 9e4bb9d678
5 changed files with 144 additions and 0 deletions

View File

@@ -80,6 +80,11 @@ class Processor(
it.name,
targetType,
).apply {
addKdoc(
"""
@return Definition by key "${it.name}"
""".trimIndent()
)
getter(
FunSpec.getterBuilder().apply {
addCode(
@@ -102,6 +107,11 @@ class Processor(
if (it.generateSingle) {
addFunction(
FunSpec.builder("${it.name}Single").apply {
addKdoc(
"""
Will register [definition] with [org.koin.core.module.Module.single] and key "${it.name}"
""".trimIndent()
)
receiver(Module::class)
addParameter(
ParameterSpec.builder(
@@ -128,6 +138,11 @@ class Processor(
if (it.generateFactory) {
addFunction(
FunSpec.builder("${it.name}Factory").apply {
addKdoc(
"""
Will register [definition] with [org.koin.core.module.Module.factory] and key "${it.name}"
""".trimIndent()
)
receiver(Module::class)
addParameter(
ParameterSpec.builder(