Skip to content

Commit

Permalink
adjusts
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Jul 31, 2024
1 parent ab46db8 commit b8ed8ed
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions generators/spring-boot/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,22 @@ 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,
)
) {
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);
};
Expand All @@ -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,
Expand Down

0 comments on commit b8ed8ed

Please sign in to comment.