From b8ed8edddf73d9081fa8e8a180ceba160c7b985e Mon Sep 17 00:00:00 2001 From: Marcelo Boveto Shima Date: Wed, 31 Jul 2024 18:41:11 -0300 Subject: [PATCH] adjusts --- generators/spring-boot/generator.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/generators/spring-boot/generator.js b/generators/spring-boot/generator.js index afd97e7b..4f429a7d 100644 --- a/generators/spring-boot/generator.js +++ b/generators/spring-boot/generator.js @@ -154,7 +154,7 @@ export default class extends BaseApplicationGenerator { const sourceBasename = basename(sourceFile); if ( - file.namespace === 'jhipster:spring-data-relational' && + namespace === 'jhipster:spring-data-relational' && ['UserSqlHelper_reactive.java', 'ColumnConverter_reactive.java', 'EntityManager_reactive.java'].includes( sourceBasename, ) @@ -162,10 +162,14 @@ export default class extends BaseApplicationGenerator { sourceFile = sourceFile.replace('_reactive', ''); } + if (namespace === 'jhipster-kotlin:spring-boot') { + sourceFile = sourceFile.replace('/package/', '/_package_/'); + } + const isCommonFile = filename => { const sourceBasename = basename(filename); if (['_entityClass_Repository.java', '_entityClass_Repository_reactive.java'].includes(sourceBasename)) { - return file.namespace !== 'spring-data-couchbase'; + return namespace !== 'spring-data-couchbase'; } return ['TestContainersSpringContextCustomizerFactory.java'].includes(sourceBasename); }; @@ -190,16 +194,15 @@ export default class extends BaseApplicationGenerator { file.namespace === 'jhipster-kotlin:spring-boot' || isCommonFile(sourceFile) ? 'kotlin' : namespace.split(':').pop(); + if (sourceBasename === '_enumName_.java') { if (namespace === 'jhipster:java:domain') { throw new Error('Drop writeEnumFiles task and this condition'); } templateRoot = 'domain'; } + sourceFile = join(templateRoot, convertToKotlinFile(sourceFile)); - if (namespace === 'jhipster-kotlin:spring-boot') { - sourceFile = sourceFile.replace('/package/', '/_package_/'); - } return { ...file,