Added commands and messages modules

This commit is contained in:
redtea committed 2023-08-22 03:27:05 +03:00
1 parent ad17e1e15c
commit 5d615bc63e
45 files changed
+457 -89

No files matched your search

@@ -1,8 +1,9 @@
package me.redtea.carcadex.genref.plugin
package tech.carcadex.kotlinbukkitkit.genref.plugin
import com.google.devtools.ksp.KspExperimental
import com.google.devtools.ksp.getAnnotationsByType
import com.google.devtools.ksp.processing.CodeGenerator
import com.google.devtools.ksp.processing.Dependencies
import com.google.devtools.ksp.processing.KSPLogger
import com.google.devtools.ksp.symbol.KSFile
import com.google.devtools.ksp.symbol.KSFunctionDeclaration
@@ -10,8 +11,8 @@ import com.google.devtools.ksp.symbol.KSVisitorVoid
import com.squareup.kotlinpoet.*
import com.squareup.kotlinpoet.ksp.KotlinPoetKspPreview
import com.squareup.kotlinpoet.ksp.writeTo
import me.redtea.carcadex.genref.plugin.annotations.OnDisable
import me.redtea.carcadex.genref.plugin.annotations.Plugin
import tech.carcadex.kotlinbukkitkit.genref.plugin.annotations.OnDisable
import tech.carcadex.kotlinbukkitkit.genref.plugin.annotations.Plugin
import tech.carcadex.kotlinbukkitkit.architecture.KotlinPlugin
@OptIn(KotlinPoetKspPreview::class)
@@ -54,10 +55,9 @@ class PluginVisitor(private val codeGenerator: CodeGenerator,
.build()
)
}.build()
try {
fileSpec.writeTo(codeGenerator, true)
} catch (ignored: FileAlreadyExistsException) {
}
//todo try catch?
fileSpec.writeTo(codeGenerator, Dependencies(false))
}
@OptIn(KspExperimental::class)
@@ -1,4 +1,4 @@
package me.redtea.carcadex.genref.plugin.annotations
package tech.carcadex.kotlinbukkitkit.genref.plugin.annotations
@Target(AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.SOURCE)
@@ -1,4 +1,4 @@
package me.redtea.carcadex.genref.plugin.annotations
package tech.carcadex.kotlinbukkitkit.genref.plugin.annotations
@Target(AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.SOURCE)
@@ -1,4 +1,4 @@
package me.redtea.carcadex.genref.processor
package tech.carcadex.kotlinbukkitkit.genref.processor
import com.google.devtools.ksp.KspExperimental
import com.google.devtools.ksp.isAnnotationPresent
@@ -9,8 +9,8 @@ import com.google.devtools.ksp.processing.SymbolProcessor
import com.google.devtools.ksp.symbol.KSAnnotated
import com.google.devtools.ksp.symbol.KSFunctionDeclaration
import com.google.devtools.ksp.validate
import me.redtea.carcadex.genref.plugin.PluginVisitor
import me.redtea.carcadex.genref.plugin.annotations.Plugin
import tech.carcadex.kotlinbukkitkit.genref.plugin.PluginVisitor
import tech.carcadex.kotlinbukkitkit.genref.plugin.annotations.Plugin
class GenRefProcessor(private val codeGenerator: CodeGenerator,
private val logger: KSPLogger) : SymbolProcessor {
@@ -1,4 +1,4 @@
package me.redtea.carcadex.genref.processor
package tech.carcadex.kotlinbukkitkit.genref.processor
import com.google.devtools.ksp.processing.SymbolProcessor
import com.google.devtools.ksp.processing.SymbolProcessorEnvironment
@@ -1 +1 @@
me.redtea.carcadex.genref.processor.ProcessorProvider
tech.carcadex.kotlinbukkitkit.genref.processor.ProcessorProvider