DEADSOFTWARE

Add Generated annotation to generated code
authorfredboy <fredboy@protonmail.com>
Tue, 14 May 2024 17:34:09 +0000 (00:34 +0700)
committerfredboy <fredboy@protonmail.com>
Tue, 14 May 2024 17:39:19 +0000 (00:39 +0700)
dagger-multibind-ksp/src/main/kotlin/ru/fredboy/cavedroid/ksp/processor/GenerateMapMultibindingsSymbolProcessor.kt
dagger-multibind-ksp/src/main/kotlin/ru/fredboy/cavedroid/ksp/processor/GenerateSetMultibindingsSymbolProcessor.kt

index cfaa3a590393d3478e34994c39174da0db93a147..860653f01fc0151e757fef3550b6c4120046d7ba 100644 (file)
@@ -52,6 +52,11 @@ class GenerateMapMultibindingsSymbolProcessor(
 
         val moduleObject = TypeSpec.objectBuilder(moduleName)
             .addAnnotation(ClassName("dagger", "Module"))
+            .addAnnotation(
+                AnnotationSpec.builder(ClassName("javax.annotation.processing", "Generated"))
+                    .addMember("value = [%S]", this::class.qualifiedName!!)
+                    .build()
+            )
             .addFunctions(bindings)
             .build()
 
index 18cd3c9bceb185c21022a0ea1501d723f7bc503b..6bcb60cad518c57e7e234d231462a4b64c176752 100644 (file)
@@ -35,6 +35,11 @@ class GenerateSetMultibindingsSymbolProcessor(
 
         val moduleObject = TypeSpec.objectBuilder(moduleName)
             .addAnnotation(ClassName("dagger", "Module"))
+            .addAnnotation(
+                AnnotationSpec.builder(ClassName("javax.annotation.processing", "Generated"))
+                    .addMember("value = [%S]", this::class.qualifiedName!!)
+                    .build()
+            )
             .addFunctions(bindings)
             .build()