DEADSOFTWARE

Add RenderModule code generation
authorfredboy <fredboy@protonmail.com>
Tue, 14 May 2024 13:37:29 +0000 (20:37 +0700)
committerfredboy <fredboy@protonmail.com>
Tue, 14 May 2024 15:45:11 +0000 (22:45 +0700)
26 files changed:
.gitignore
core/build.gradle
core/src/ru/deadsoftware/cavedroid/game/render/BackgroundBlocksRenderer.kt
core/src/ru/deadsoftware/cavedroid/game/render/DebugRenderer.kt
core/src/ru/deadsoftware/cavedroid/game/render/DropsRenderer.kt
core/src/ru/deadsoftware/cavedroid/game/render/ForegroundBlocksRenderer.kt
core/src/ru/deadsoftware/cavedroid/game/render/GameRenderer.kt [new file with mode: 0644]
core/src/ru/deadsoftware/cavedroid/game/render/HudRenderer.kt
core/src/ru/deadsoftware/cavedroid/game/render/MobsRenderer.kt
core/src/ru/deadsoftware/cavedroid/game/render/RenderModule.kt [deleted file]
core/src/ru/deadsoftware/cavedroid/game/render/TouchControlsRenderer.kt
core/src/ru/deadsoftware/cavedroid/game/render/WindowsRenderer.kt
dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/GenerateSetMultibindingsModule.kt [new file with mode: 0644]
dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/actions/PlaceBlockAction.kt [deleted file]
dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/actions/UpdateBlockAction.kt [deleted file]
dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/actions/UseBlockAction.kt [deleted file]
dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/actions/UseItemAction.kt [deleted file]
dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/input/KeyboardInputHandler.kt [deleted file]
dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/input/MouseInputHandler.kt [deleted file]
dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/render/Renderer.kt [deleted file]
dagger-multibind-ksp/src/main/kotlin/ru/fredboy/cavedroid/ksp/processor/GenerateSetMultibindingsSymbolProcessor.kt [new file with mode: 0644]
dagger-multibind-ksp/src/main/kotlin/ru/fredboy/cavedroid/ksp/processor/RendererSymbolProcessor.kt [deleted file]
dagger-multibind-ksp/src/main/kotlin/ru/fredboy/cavedroid/ksp/processor/SymbolProcessorUtils.kt
dagger-multibind-ksp/src/main/kotlin/ru/fredboy/cavedroid/ksp/provider/GenerateSetMultibindingsSymbolProcessorProvider.kt [moved from dagger-multibind-ksp/src/main/kotlin/ru/fredboy/cavedroid/ksp/provider/RendererSymbolProcessorProvider.kt with 59% similarity]
dagger-multibind-ksp/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider
desktop/build.gradle

index e03f5587f9ef9b42b0be788ce28a0aa394291c60..b24a8edfa256f29fdaa63c65c53aa04125be7892 100644 (file)
@@ -119,3 +119,5 @@ Thumbs.db
 
 release-*/
 keystore.properties
+
+*/build/
index c16072417b3af6ca26908531e628898aed54765e..0cff94fb362992f6bfd232f3d9b802327fc97aff 100644 (file)
@@ -13,6 +13,9 @@ java.sourceCompatibility = JavaVersion.VERSION_17
 sourceSets.main.java.srcDirs = ["src/"]
 
 dependencies {
+    implementation project(':dagger-multibind-annotations')
+    ksp project(':dagger-multibind-ksp')
+
     api "com.badlogicgames.gdx:gdx:$gdxVersion"
     api "com.google.guava:guava:$guavaVersion-android"
     api "com.google.dagger:dagger:$daggerVersion"
@@ -20,5 +23,4 @@ dependencies {
     implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
     implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinSerializationVersion"
     annotationProcessor "com.google.dagger:dagger-compiler:$daggerVersion"
-    ksp project(':dagger-multibind-ksp')
 }
\ No newline at end of file
index aae4f9891e26212224ec020b8be8ce67f910faf8..e86450c07a752233c586ecb2427c585093070b82 100644 (file)
@@ -12,6 +12,7 @@ import ru.deadsoftware.cavedroid.misc.utils.forEachBlockInArea
 import javax.inject.Inject
 
 @GameScope
+@GameRenderer
 class BackgroundBlocksRenderer @Inject constructor(
     gameWorld: GameWorld,
     mobsController: MobsController
index 03f62534522264f008936a451faaa9d2139ea989..d1a1d162090c0a7724347d5260deefb656968079 100644 (file)
@@ -10,13 +10,13 @@ import ru.deadsoftware.cavedroid.game.debug.DebugInfoStringsProvider
 import ru.deadsoftware.cavedroid.game.mobs.MobsController
 import ru.deadsoftware.cavedroid.game.model.block.Block
 import ru.deadsoftware.cavedroid.game.world.GameWorld
-import ru.deadsoftware.cavedroid.misc.Assets
 import ru.deadsoftware.cavedroid.misc.utils.bl
 import ru.deadsoftware.cavedroid.misc.utils.drawString
 import ru.deadsoftware.cavedroid.misc.utils.forEachBlockInArea
 import ru.deadsoftware.cavedroid.misc.utils.px
 import javax.inject.Inject
 
+@GameRenderer
 @GameScope
 class DebugRenderer @Inject constructor(
     private val mainConfig: MainConfig,
index f14d36b943a7389d546824d48f7e786d320fe4fc..5e1da4a42d8e057b2f2f1585f44441828e52bfce 100644 (file)
@@ -12,6 +12,7 @@ import ru.deadsoftware.cavedroid.misc.utils.px
 import javax.inject.Inject
 
 @GameScope
+@GameRenderer
 class DropsRenderer @Inject constructor(
     private val dropController: DropController,
     private val gameWorld: GameWorld,
index ef8be714220b88ce94b849893be3883cc9d14a31..0bb4001f7824b94ff5b2906cd030899016fdec97 100644 (file)
@@ -10,6 +10,7 @@ import ru.deadsoftware.cavedroid.misc.utils.forEachBlockInArea
 import javax.inject.Inject
 
 @GameScope
+@GameRenderer
 class ForegroundBlocksRenderer @Inject constructor(
     gameWorld: GameWorld,
     mobsController: MobsController
diff --git a/core/src/ru/deadsoftware/cavedroid/game/render/GameRenderer.kt b/core/src/ru/deadsoftware/cavedroid/game/render/GameRenderer.kt
new file mode 100644 (file)
index 0000000..7e40f17
--- /dev/null
@@ -0,0 +1,10 @@
+package ru.deadsoftware.cavedroid.game.render
+
+import ru.fredboy.cavedroid.ksp.annotations.GenerateSetMultibindingsModule
+
+@GenerateSetMultibindingsModule(
+    interfaceClass = IGameRenderer::class,
+    modulePackage = "ru.deadsoftware.cavedroid.game.render",
+    moduleName = "RenderModule"
+)
+annotation class GameRenderer
index a2570e25f3120f8208233038f3b85e4738409dc4..cb70e1614ec707d4a9a8002f88154da329af2cee 100644 (file)
@@ -15,6 +15,7 @@ import ru.deadsoftware.cavedroid.misc.utils.px
 import javax.inject.Inject
 
 @GameScope
+@GameRenderer
 class HudRenderer @Inject constructor(
     private val gameWorld: GameWorld,
     private val mobsController: MobsController,
index 6d388bb94aa7c8a98d3222895a00273c7a094b20..ab1dd01187dcb56e566aea21a7055d25ce79a46d 100644 (file)
@@ -12,6 +12,7 @@ import ru.deadsoftware.cavedroid.misc.utils.px
 import javax.inject.Inject
 
 @GameScope
+@GameRenderer
 class MobsRenderer @Inject constructor(
     private val mobsController: MobsController,
     private val gameWorld: GameWorld,
diff --git a/core/src/ru/deadsoftware/cavedroid/game/render/RenderModule.kt b/core/src/ru/deadsoftware/cavedroid/game/render/RenderModule.kt
deleted file mode 100644 (file)
index 9ae3b46..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-package ru.deadsoftware.cavedroid.game.render
-
-import dagger.Binds
-import dagger.Module
-import dagger.multibindings.IntoSet
-import ru.deadsoftware.cavedroid.game.GameScope
-
-@Module
-object RenderModule {
-
-    @Binds
-    @IntoSet
-    @GameScope
-    fun bindBackGroundBlocksRenderer(renderer: BackgroundBlocksRenderer): IGameRenderer = renderer
-
-    @Binds
-    @IntoSet
-    @GameScope
-    fun bindForegroundBlocksRenderer(renderer: ForegroundBlocksRenderer): IGameRenderer = renderer
-
-    @Binds
-    @IntoSet
-    @GameScope
-    fun bindMobsRenderer(renderer: MobsRenderer): IGameRenderer = renderer
-
-    @Binds
-    @IntoSet
-    @GameScope
-    fun bindDropsRenderer(renderer: DropsRenderer): IGameRenderer = renderer
-
-    @Binds
-    @IntoSet
-    @GameScope
-    fun bindHudRenderer(renderer: HudRenderer): IGameRenderer = renderer
-
-    @Binds
-    @IntoSet
-    @GameScope
-    fun bindWindowsRenderer(renderer: WindowsRenderer): IGameRenderer = renderer
-
-    @Binds
-    @IntoSet
-    @GameScope
-    fun bindTouchControlsRenderer(renderer: TouchControlsRenderer): IGameRenderer = renderer
-
-    @Binds
-    @IntoSet
-    @GameScope
-    fun bindDebugRenderer(renderer: DebugRenderer): IGameRenderer = renderer
-
-//    @Provides
-//    @GameScope
-//    fun provideGameRenderers(renderers: Set<@JvmSuppressWildcards IGameRenderer>): List<IGameRenderer> {
-//        return renderers.asSequence()
-//            .sortedWith(Comparator.comparingInt(IGameRenderer::renderLayer))
-//            .toList()
-//    }
-
-}
index 63aa09fd74fce303e6d45b7d976ee6edab53c8ce..29702aece89cc3d9fcec5f0b87f429d0de239062 100644 (file)
@@ -17,6 +17,7 @@ import ru.deadsoftware.cavedroid.misc.utils.drawSprite
 import javax.inject.Inject
 
 @GameScope
+@GameRenderer
 class TouchControlsRenderer @Inject constructor(
     private val mainConfig: MainConfig,
     private val mobsController: MobsController,
index fa37f8dc3d71798056ae72378bcca3e49991cb35..4e65b41dc3dce3102e12c501ac9aa845d8692aaa 100644 (file)
@@ -11,6 +11,7 @@ import ru.deadsoftware.cavedroid.game.ui.windows.GameWindowsManager
 import javax.inject.Inject
 
 @GameScope
+@GameRenderer
 class WindowsRenderer @Inject constructor(
     private val creativeWindowRenderer: CreativeWindowRenderer,
     private val survivalWindowRenderer: SurvivalWindowRenderer,
diff --git a/dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/GenerateSetMultibindingsModule.kt b/dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/GenerateSetMultibindingsModule.kt
new file mode 100644 (file)
index 0000000..2fb4915
--- /dev/null
@@ -0,0 +1,11 @@
+package ru.fredboy.cavedroid.ksp.annotations
+
+import kotlin.reflect.KClass
+
+@Target(AnnotationTarget.ANNOTATION_CLASS)
+@Retention(AnnotationRetention.SOURCE)
+annotation class GenerateSetMultibindingsModule(
+    val interfaceClass: KClass<*>,
+    val modulePackage: String,
+    val moduleName: String,
+)
diff --git a/dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/actions/PlaceBlockAction.kt b/dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/actions/PlaceBlockAction.kt
deleted file mode 100644 (file)
index 2d3046e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-package ru.fredboy.cavedroid.ksp.annotations.actions
-
-@Target(AnnotationTarget.CLASS)
-@Retention(AnnotationRetention.SOURCE)
-annotation class PlaceBlockAction(val actionKey: String)
diff --git a/dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/actions/UpdateBlockAction.kt b/dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/actions/UpdateBlockAction.kt
deleted file mode 100644 (file)
index 1ba6b87..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-package ru.fredboy.cavedroid.ksp.annotations.actions
-
-@Target(AnnotationTarget.CLASS)
-@Retention(AnnotationRetention.SOURCE)
-annotation class UpdateBlockAction(val blockKey: String)
diff --git a/dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/actions/UseBlockAction.kt b/dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/actions/UseBlockAction.kt
deleted file mode 100644 (file)
index 4e53819..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-package ru.fredboy.cavedroid.ksp.annotations.actions
-
-@Target(AnnotationTarget.CLASS)
-@Retention(AnnotationRetention.SOURCE)
-annotation class UseBlockAction(val blockKey: String)
diff --git a/dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/actions/UseItemAction.kt b/dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/actions/UseItemAction.kt
deleted file mode 100644 (file)
index fc47677..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-package ru.fredboy.cavedroid.ksp.annotations.actions
-
-@Target(AnnotationTarget.CLASS)
-@Retention(AnnotationRetention.SOURCE)
-annotation class UseItemAction(val actionKey: String)
diff --git a/dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/input/KeyboardInputHandler.kt b/dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/input/KeyboardInputHandler.kt
deleted file mode 100644 (file)
index 311a050..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-package ru.fredboy.cavedroid.ksp.annotations.input
-
-@Target(AnnotationTarget.CLASS)
-@Retention(AnnotationRetention.SOURCE)
-annotation class KeyboardInputHandler
diff --git a/dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/input/MouseInputHandler.kt b/dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/input/MouseInputHandler.kt
deleted file mode 100644 (file)
index d3a630e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-package ru.fredboy.cavedroid.ksp.annotations.input
-
-@Target(AnnotationTarget.CLASS)
-@Retention(AnnotationRetention.SOURCE)
-annotation class MouseInputHandler
diff --git a/dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/render/Renderer.kt b/dagger-multibind-annotations/src/main/kotlin/ru.fredboy.cavedroid.ksp.annotations/render/Renderer.kt
deleted file mode 100644 (file)
index 8a813df..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-package ru.fredboy.cavedroid.ksp.annotations.render
-
-@Target(AnnotationTarget.CLASS)
-@Retention(AnnotationRetention.SOURCE)
-annotation class Renderer
diff --git a/dagger-multibind-ksp/src/main/kotlin/ru/fredboy/cavedroid/ksp/processor/GenerateSetMultibindingsSymbolProcessor.kt b/dagger-multibind-ksp/src/main/kotlin/ru/fredboy/cavedroid/ksp/processor/GenerateSetMultibindingsSymbolProcessor.kt
new file mode 100644 (file)
index 0000000..18cd3c9
--- /dev/null
@@ -0,0 +1,81 @@
+package ru.fredboy.cavedroid.ksp.processor
+
+import com.google.devtools.ksp.processing.*
+import com.google.devtools.ksp.symbol.KSAnnotated
+import com.google.devtools.ksp.symbol.KSClassDeclaration
+import com.google.devtools.ksp.symbol.KSType
+import com.squareup.kotlinpoet.*
+import com.squareup.kotlinpoet.ksp.toClassName
+import com.squareup.kotlinpoet.ksp.writeTo
+import ru.fredboy.cavedroid.ksp.annotations.GenerateSetMultibindingsModule
+
+class GenerateSetMultibindingsSymbolProcessor(
+    private val codeGenerator: CodeGenerator,
+    private val logger: KSPLogger,
+) : SymbolProcessor {
+
+    private fun generateModule(
+        interfaceName: ClassName,
+        moduleName: ClassName,
+        classes: List<ClassName>
+    ): FileSpec? {
+        if (classes.isEmpty()) {
+            return null
+        }
+
+        val bindings = classes.map { clazz ->
+            FunSpec.builder("bind${clazz.simpleName}")
+                .addAnnotation(ClassName("dagger", "Binds"))
+                .addAnnotation(ClassName("dagger.multibindings", "IntoSet"))
+                .addParameter(ParameterSpec("impl", clazz))
+                .returns(interfaceName)
+                .addCode("return impl")
+                .build()
+        }
+
+        val moduleObject = TypeSpec.objectBuilder(moduleName)
+            .addAnnotation(ClassName("dagger", "Module"))
+            .addFunctions(bindings)
+            .build()
+
+        return FileSpec.builder(moduleName)
+            .addType(moduleObject)
+            .build()
+
+    }
+
+    private fun processAnnotation(resolver: Resolver, annotation: KSClassDeclaration) {
+        val args = annotation.annotations.first {
+            it.shortName.getShortName() == "GenerateSetMultibindingsModule"
+        }.arguments.takeIf { it.size == 3 } ?: run {
+            logger.error("GenerateSetMultibindingsModule should have 3 arguments")
+            throw IllegalArgumentException()
+        }
+
+        val interfaceName = args.first { it.name?.getShortName() == "interfaceClass" }.value as KSType
+        val modulePackage = args.first { it.name?.getShortName() == "modulePackage" }.value as String
+        val moduleName = args.first { it.name?.getShortName() == "moduleName" }.value as String
+
+        val moduleClassName = ClassName(modulePackage, moduleName)
+        val elements = resolver.getSymbolsWithAnnotation(annotation.qualifiedName!!.asString())
+            .filterIsInstance<KSClassDeclaration>()
+            .map(KSClassDeclaration::toClassName)
+            .toList()
+
+        logger.info("Found elements: ${elements.joinToString()}")
+
+        generateModule(
+            interfaceName = interfaceName.toClassName(),
+            moduleName = moduleClassName,
+            classes = elements
+        )?.writeTo(codeGenerator, Dependencies(true))
+    }
+
+    override fun process(resolver: Resolver): List<KSAnnotated> {
+        val annotations = resolver.getAnnotatedClasses(GenerateSetMultibindingsModule::class.qualifiedName!!, logger)
+        logger.info("Found annotations: ${annotations.joinToString { it.qualifiedName!!.asString() }}")
+        annotations.forEach { processAnnotation(resolver, it) }
+        return emptyList()
+    }
+
+}
\ No newline at end of file
diff --git a/dagger-multibind-ksp/src/main/kotlin/ru/fredboy/cavedroid/ksp/processor/RendererSymbolProcessor.kt b/dagger-multibind-ksp/src/main/kotlin/ru/fredboy/cavedroid/ksp/processor/RendererSymbolProcessor.kt
deleted file mode 100644 (file)
index d97c2ab..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-package ru.fredboy.cavedroid.ksp.processor
-
-import com.google.devtools.ksp.processing.CodeGenerator
-import com.google.devtools.ksp.processing.Dependencies
-import com.google.devtools.ksp.processing.Resolver
-import com.google.devtools.ksp.processing.SymbolProcessor
-import com.google.devtools.ksp.symbol.KSAnnotated
-import com.google.devtools.ksp.symbol.KSClassDeclaration
-import com.squareup.kotlinpoet.*
-import com.squareup.kotlinpoet.ksp.toClassName
-import com.squareup.kotlinpoet.ksp.writeTo
-import ru.fredboy.cavedroid.ksp.annotations.render.Renderer
-import java.lang.reflect.Type
-
-internal class RendererSymbolProcessor(
-    private val codeGenerator: CodeGenerator,
-) : SymbolProcessor {
-
-    private fun generateModule(renderers: List<ClassName>): FileSpec? {
-        if (renderers.isEmpty()) {
-            return null
-        }
-
-        val bindings = renderers.map { renderer ->
-            FunSpec.builder("bind${renderer.simpleName}")
-                .addAnnotation(ClassName("dagger", "Binds"))
-                .addAnnotation(ClassName("dagger", "IntoSet"))
-                .addAnnotations(renderer.annotations)
-                .addParameter(ParameterSpec("renderer", renderer))
-                .returns(IGameRendererType)
-                .beginControlFlow("return renderer")
-                .build()
-        }
-
-        val moduleObject = TypeSpec.objectBuilder(MODULE_NAME)
-            .addAnnotation(ClassName("dagger", "Module"))
-            .addFunctions(bindings)
-            .build()
-
-        return FileSpec.builder(MODULE_PACKAGE, MODULE_NAME)
-//            .addImport("dagger", "Binds", "Module", "IntoSet")
-//            .addImport("ru.deadsoftware.cavedroid.game", "GameScope")
-            .addType(moduleObject)
-            .build()
-
-    }
-
-    override fun process(resolver: Resolver): List<KSAnnotated> {
-        generateModule(
-            resolver.getAnnotatedClasses(MODULE_PACKAGE, Renderer::class)
-                .map(KSClassDeclaration::toClassName)
-                .toList()
-        )?.writeTo(codeGenerator, Dependencies(true))
-
-        return emptyList()
-    }
-
-    private object IGameRendererType : Type {
-        override fun getTypeName(): String = "IGameRenderer"
-    }
-
-    companion object {
-        private const val MODULE_PACKAGE = "ru.deadsoftware.cavedroid.game.render"
-        private const val MODULE_NAME = "RenderModule"
-    }
-}
\ No newline at end of file
index 0b0e0b9f59f02c940823c77f348a8ded04035a41..1ac8a6abbff2683dd3e61b9497b6611f4a8371c8 100644 (file)
@@ -1,5 +1,6 @@
 package ru.fredboy.cavedroid.ksp.processor
 
+import com.google.devtools.ksp.processing.KSPLogger
 import com.google.devtools.ksp.processing.Resolver
 import com.google.devtools.ksp.symbol.KSClassDeclaration
 import com.google.devtools.ksp.symbol.KSNode
@@ -7,11 +8,11 @@ import com.google.devtools.ksp.validate
 import kotlin.reflect.KClass
 
 internal fun Resolver.getAnnotatedClasses(
-    packageName: String,
-    annotationClass: KClass<*>
+    annotation: String,
+    logger: KSPLogger,
 ): Sequence<KSClassDeclaration> {
-    return getSymbolsWithAnnotation(annotationClass.qualifiedName.orEmpty())
+    logger.info("Resolving annotation $annotation")
+    return getSymbolsWithAnnotation(annotation)
         .filterIsInstance<KSClassDeclaration>()
-        .filter { it.packageName.getShortName() == packageName }
         .filter(KSNode::validate)
 }
\ No newline at end of file
@@ -3,13 +3,14 @@ package ru.fredboy.cavedroid.ksp.provider
 import com.google.devtools.ksp.processing.SymbolProcessor
 import com.google.devtools.ksp.processing.SymbolProcessorEnvironment
 import com.google.devtools.ksp.processing.SymbolProcessorProvider
-import ru.fredboy.cavedroid.ksp.processor.RendererSymbolProcessor
+import ru.fredboy.cavedroid.ksp.processor.GenerateSetMultibindingsSymbolProcessor
 
-internal class RendererSymbolProcessorProvider : SymbolProcessorProvider {
+internal class GenerateSetMultibindingsSymbolProcessorProvider : SymbolProcessorProvider {
 
     override fun create(environment: SymbolProcessorEnvironment): SymbolProcessor {
-        return RendererSymbolProcessor(
+        return GenerateSetMultibindingsSymbolProcessor(
             codeGenerator = environment.codeGenerator,
+            logger = environment.logger,
         )
     }
 
index 04317e4a995c6299132e0aa0225ce17e69d005de..58553a37aa12bf8a975da701cb9d299b03bef8a7 100644 (file)
@@ -46,12 +46,12 @@ task dist(type: Jar) {
         attributes 'Main-Class': project.mainClassName
     }
     from {
-        configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) }
+        configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
     }
     with jar
 }
 
-dist.dependsOn classes
+dist.dependsOn build
 
 dependencies {
     implementation project(":core")