From 1c73c61a259d43e2caaaebb17acf4ab8d86a2fd3 Mon Sep 17 00:00:00 2001 From: khalilou88 <32600911+khalilou88@users.noreply.github.com> Date: Thu, 10 Oct 2024 16:13:12 +0200 Subject: [PATCH] fix: use installPackagesTask again during init --- packages/nx-gradle/src/generators/init/generator.ts | 5 +++++ packages/nx-maven/src/generators/init/generator.ts | 5 +++++ .../jnxplus-smoke/tests/nx-maven/quarkus.spec.ts | 2 ++ 3 files changed, 12 insertions(+) diff --git a/packages/nx-gradle/src/generators/init/generator.ts b/packages/nx-gradle/src/generators/init/generator.ts index aa1a81651..190564208 100644 --- a/packages/nx-gradle/src/generators/init/generator.ts +++ b/packages/nx-gradle/src/generators/init/generator.ts @@ -20,6 +20,7 @@ import { addProjectConfiguration, formatFiles, generateFiles, + installPackagesTask, joinPathFragments, logger, offsetFromRoot, @@ -146,6 +147,10 @@ export async function initGenerator( if (!options.skipFormat) { await formatFiles(tree); } + + return () => { + installPackagesTask(tree); + }; } function updateNxJson(tree: Tree, options: NormalizedSchema) { diff --git a/packages/nx-maven/src/generators/init/generator.ts b/packages/nx-maven/src/generators/init/generator.ts index 3a574c012..846a6f3d7 100644 --- a/packages/nx-maven/src/generators/init/generator.ts +++ b/packages/nx-maven/src/generators/init/generator.ts @@ -16,6 +16,7 @@ import { addProjectConfiguration, formatFiles, generateFiles, + installPackagesTask, joinPathFragments, logger, offsetFromRoot, @@ -122,6 +123,10 @@ export async function initGenerator( if (!options.skipFormat) { await formatFiles(tree); } + + return () => { + installPackagesTask(tree); + }; } function updateNxJson(tree: Tree, options: NormalizedSchema) { diff --git a/testing-projects/jnxplus-smoke/tests/nx-maven/quarkus.spec.ts b/testing-projects/jnxplus-smoke/tests/nx-maven/quarkus.spec.ts index 32ae85156..8c92be961 100644 --- a/testing-projects/jnxplus-smoke/tests/nx-maven/quarkus.spec.ts +++ b/testing-projects/jnxplus-smoke/tests/nx-maven/quarkus.spec.ts @@ -117,6 +117,8 @@ describe('nx-maven quarkus smoke', () => { execSyncOptions(), ); + execSync(`npx nx format --projects ${testLib}`, execSyncOptions()); + execSync(`npx nx test ${testLib}`, execSyncOptions()); execSync(`npx nx run-many --target=build --parallel`, execSyncOptions());