Skip to content

Commit

Permalink
set liquibaseAddH2Properties property and add check-applications ci t…
Browse files Browse the repository at this point in the history
…est (#21)

* set liquibaseAddH2Properties property

* add check-applications summary
  • Loading branch information
mshima authored Oct 15, 2023
1 parent 46cc2ef commit 238afda
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,16 @@ jobs:
with:
name: jhipster-jooq-${{ matrix.build }}.zip
path: app/archive.zip
check-applications:
permissions:
contents: none
runs-on: ubuntu-latest
needs: [applications]
if: always()
steps:
- run: |
echo '${{ toJSON(needs) }}'
if [ 'skipped' == '${{ needs.applications.result }}' ] || [ 'success' == '${{ needs.applications.result }}' ] || [ 'closed' == '${{ github.event.action }}' ]; then
exit 0
fi
exit 1
17 changes: 6 additions & 11 deletions generators/jooq/generator.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import BaseApplicationGenerator from 'generator-jhipster/generators/base-application';
import { createNeedleCallback } from 'generator-jhipster/generators/base/support';
import { getPomVersionProperties, getGradleLibsVersionsProperties } from 'generator-jhipster/generators/server/support';
import { javaMainPackageTemplatesBlock } from 'generator-jhipster/generators/java/support';

import { TEMPLATES_MAIN_RESOURCES_DIR, TEMPLATES_MAIN_SOURCES_DIR } from 'generator-jhipster';
import { TEMPLATES_MAIN_RESOURCES_DIR } from 'generator-jhipster';
import command from './command.mjs';

const groupId = 'org.jooq';
Expand Down Expand Up @@ -54,13 +53,15 @@ export default class extends BaseApplicationGenerator {
return this.asPreparingTaskGroup({
preparingJooq({ application }) {
const { packageName, prodDatabaseType } = application;
const { jooqVersion } = this.blueprintConfig;
const { jooqVersion = application.javaDependencies.jooq } = this.blueprintConfig;

application.jooqVersion = jooqVersion ?? application.javaDependencies.jooq;
application.jooqVersion = jooqVersion;
application.jooqTargetName = `${packageName}.jooq`;
application.jooqDialect = JOOQ_FAMILY_MAPPING[prodDatabaseType] || '';
// Add liquibase h2 database references.
application.liquibaseAddH2Properties = true;

this.log.info(`Using jOOQ version ${this.jooqVersion}.`);
this.log.info(`Using jOOQ version ${jooqVersion}.`);
},
});
}
Expand Down Expand Up @@ -136,12 +137,6 @@ export default class extends BaseApplicationGenerator {

get [BaseApplicationGenerator.POST_WRITING]() {
return this.asPostWritingTaskGroup({
adjustLiquibase({ application }) {
if (application.devDatabaseTypeH2Any) return;

this.editFile(`${application.srcMainResources}config/liquibase/master.xml`, content => content.replaceAll('dbms="', 'dbms="h2,'));
},

injectJooqMavenConfigurations({ application: { buildToolMaven, jooqVersion }, source }) {
if (!buildToolMaven) return;

Expand Down

0 comments on commit 238afda

Please sign in to comment.