From 4d8a5ed60381595e67ee6ba08a35ea3461e40487 Mon Sep 17 00:00:00 2001 From: Moritz Ruth Date: Sun, 3 Jan 2021 20:15:29 +0100 Subject: [PATCH] Suffix entity class names with "Entity" --- .../kotlin/space/uranos/mdsp/generator/EntitiesGenerator.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/space/uranos/mdsp/generator/EntitiesGenerator.kt b/buildSrc/src/main/kotlin/space/uranos/mdsp/generator/EntitiesGenerator.kt index d071f8b..672adf4 100644 --- a/buildSrc/src/main/kotlin/space/uranos/mdsp/generator/EntitiesGenerator.kt +++ b/buildSrc/src/main/kotlin/space/uranos/mdsp/generator/EntitiesGenerator.kt @@ -29,7 +29,8 @@ class EntitiesGenerator( private fun generateEntityStubs(entities: List) { for (entity in entities) { - val name = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, entity.get("name").toString())!! + val name = + CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, entity.get("name").toString())!! + "Entity" val filePathRelativeToSourceRoot = "./${BLOCK_PACKAGE.replace(".", "/")}/$name.kt" if (sourcesDir.resolve(filePathRelativeToSourceRoot).exists()) continue @@ -63,7 +64,7 @@ class EntitiesGenerator( private fun generateEntitiesList(entities: List) { val names = entities .map { it.get("name").toString() } - .map { CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, it) } + .map { CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, it) + "Entity" } val property = PropertySpec.builder( "GENERATED_ENTITIES",