Skip to content

Commit

Permalink
Merge pull request #25933 from mshima/project-version
Browse files Browse the repository at this point in the history
adjust project version for sonar
  • Loading branch information
DanielFran authored Apr 24, 2024
2 parents 18b277b + 1036178 commit 5531e66
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .blueprint/generate-sample/generator.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { extname } from 'path';
import { transform } from '@yeoman/transform';
import BaseGenerator from '../../generators/base/index.js';
import { packageJson } from '../../lib/index.js';
import { generateSample } from './support/generate-sample.js';
import { promptSamplesFolder } from '../support.mjs';
import { GENERATOR_APP, GENERATOR_JDL } from '../../generators/generator-list.js';
Expand All @@ -9,12 +10,16 @@ export default class extends BaseGenerator {
sampleName;
global;
projectFolder;
projectVersion;

get [BaseGenerator.INITIALIZING]() {
return this.asInitializingTaskGroup({
async parseCommand() {
await this.parseCurrentJHipsterCommand();
},
projectVersion() {
this.projectVersion = `${packageJson.version}-git`;
},
});
}

Expand All @@ -35,6 +40,7 @@ export default class extends BaseGenerator {

await this.composeWithJHipster(GENERATOR_JDL, {
generatorArgs: [this.templatePath('samples', this.sampleName)],
generatorOptions: { projectVersion: this.projectVersion },
});
},
async generateSample() {
Expand All @@ -52,7 +58,7 @@ export default class extends BaseGenerator {
transform(() => {}),
);

let generatorOptions = { ...sample.sample.generatorOptions };
let generatorOptions = { projectVersion: this.projectVersion, ...sample.sample.generatorOptions };
if (sample.sample.workspaces && sample.sample.workspaces !== 'false') {
generatorOptions = { ...generatorOptions, workspaces: true, monorepository: true };
}
Expand Down
1 change: 1 addition & 0 deletions test-integration/scripts/99-build-changes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ echo "::endgroup::"

echo "::group::Check Common"
git -c color.ui=always diff --exit-code @~1 -- \
'.blueprint' \
'.github/actions' \
'.github/workflows' \
'generators/app' \
Expand Down

0 comments on commit 5531e66

Please sign in to comment.