Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modularize entity templates #413

Merged
merged 25 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions generators/migration/__snapshots__/generator.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,8 @@

exports[`SubGenerator migration of kotlin JHipster blueprint > run > should succeed 1`] = `
{
".mvn/jvm.config": {
"stateCleared": "modified",
},
".mvn/wrapper/maven-wrapper.jar": {
"stateCleared": "modified",
},
".mvn/wrapper/maven-wrapper.properties": {
"stateCleared": "modified",
},
".yo-rc.json": {
"stateCleared": "modified",
},
"mvnw": {
"stateCleared": "modified",
},
"mvnw.cmd": {
"stateCleared": "modified",
},
"pom.xml": {
"stateCleared": "modified",
},
"src/main/java/com/mycompany/myapp/GeneratedByJHipster.java": {
"stateCleared": "modified",
},
"src/main/java/com/mycompany/myapp/package-info.java": {
"stateCleared": "modified",
},
}
`;
28 changes: 19 additions & 9 deletions generators/migration/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,25 @@ import BaseApplicationGenerator from 'generator-jhipster/generators/base-applica
import { passthrough } from '@yeoman/transform';

export default class extends BaseApplicationGenerator {
async beforeQueue() {
await this.dependsOnJHipster('jhipster:java:build-tool');
}

get [BaseApplicationGenerator.PREPARING]() {
return this.asPreparingTaskGroup({
async source({ application, source }) {
if (application.buildToolGradle) {
// Add a noop needles for spring-gateway generator
source.addJavaDefinition = () => {};
source.addJavaDependencies = () => {};
}
this.queueTask({
method: () => {
source.addAllowBlockingCallsInside = () => undefined;
source.addApplicationPropertiesContent = () => undefined;
source.addIntegrationTestAnnotation = () => undefined;
source.addTestSpringFactory = () => undefined;

if (application.buildToolGradle) {
// Add a noop needles for spring-gateway generator
source.addJavaDefinition = () => {};
source.addJavaDependencies = () => {};
}
},
taskName: `${this.runningState.methodName}(delayed)`,
queueName: this.runningState.queueName,
});
},
});
}
Expand Down Expand Up @@ -56,6 +63,9 @@ export default class extends BaseApplicationGenerator {
}
},
async postWritingTemplateTask({ application }) {
this.editFile('src/main/resources/logback-spring.xml', contents => contents.replaceAll('jakarta.', 'javax.'));
this.editFile('src/test/resources/logback.xml', contents => contents.replaceAll('jakarta.', 'javax.'));

if (application.buildToolGradle) {
// JHipster 8 have needles fixed
this.editFile('build.gradle', contents => contents.replaceAll('//jhipster', '// jhipster'));
Expand Down
3 changes: 3 additions & 0 deletions generators/spring-boot/__snapshots__/generator.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,9 @@ exports[`SubGenerator kotlin of kotlin JHipster blueprint > run > should succeed
"src/test/kotlin/com/mycompany/myapp/config/timezone/HibernateTimeZoneIT.kt": {
"stateCleared": "modified",
},
"src/test/kotlin/com/mycompany/myapp/domain/AuthorityTest.kt": {
"stateCleared": "modified",
},
"src/test/kotlin/com/mycompany/myapp/management/SecurityMetersServiceTests.kt": {
"stateCleared": "modified",
},
Expand Down
Loading
Loading