Skip to content

Commit

Permalink
add log
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentlauvlwj committed Aug 6, 2023
1 parent 4a122ff commit a9fdcf6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ internal object FileGenerator {
val extCodeGenerators = ServiceLoader.load(ExtCodeGenerator::class.java).toList()

fun generate(table: TableMetadata, environment: SymbolProcessorEnvironment): FileSpec {
val fileName = table.entityClass.packageName.asString().replace('.', '/') + table.tableClassName + ".kt"
environment.logger.info("[ktorm-ksp-compiler] generate file: $fileName")

val fileSpec = FileSpec.builder(table.entityClass.packageName.asString(), table.tableClassName)
.addFileComment("Auto-generated by ktorm-ksp-compiler, DO NOT EDIT!")
.addAnnotation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import kotlin.reflect.jvm.jvmName
internal class MetadataParser(resolver: Resolver, environment: SymbolProcessorEnvironment) {
private val _resolver = resolver
private val _options = environment.options
private val _logger = environment.logger
private val _databaseNamingStrategy = loadDatabaseNamingStrategy()
private val _codingNamingStrategy = loadCodingNamingStrategy()
private val _tablesCache = HashMap<String, TableMetadata>()
Expand Down Expand Up @@ -87,6 +88,7 @@ internal class MetadataParser(resolver: Resolver, environment: SymbolProcessorEn
throw IllegalStateException("$name must extends from org.ktorm.entity.Entity.")
}

_logger.info("[ktorm-ksp-compiler] parse table metadata for entity: ${cls.qualifiedName!!.asString()}")
val table = cls.getAnnotationsByType(Table::class).first()
val tableDef = TableMetadata(
entityClass = cls,
Expand Down

0 comments on commit a9fdcf6

Please sign in to comment.