Skip to content

Commit

Permalink
build: add root project name (#580)
Browse files Browse the repository at this point in the history
Co-authored-by: khalilou88 <[email protected]>
  • Loading branch information
khalilou88 and khalilou88 authored Nov 5, 2023
1 parent 1b6fdeb commit 61a28e3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
13 changes: 12 additions & 1 deletion packages/create-nx-gradle-workspace/bin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ async function main() {
).dsl;
}

let rootProjectName = '';
if (!args['rootProjectName']) {
rootProjectName = (
await prompt<{ rootProjectName: string }>({
type: 'input',
name: 'rootProjectName',
message: 'What rootProjectName would you like to use?',
})
).rootProjectName;
}

let gradleRootDirectory = '';
if (!args['gradleRootDirectory']) {
gradleRootDirectory = (
Expand Down Expand Up @@ -107,7 +118,7 @@ async function main() {
//init generator
javaVersion,
dsl,
rootProjectName: name,
rootProjectName,
gradleRootDirectory,
preset,
skipWrapper: false,
Expand Down
13 changes: 12 additions & 1 deletion packages/create-nx-maven-workspace/bin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ async function main() {
).groupId;
}

let parentProjectName = '';
if (!args['parentProjectName']) {
parentProjectName = (
await prompt<{ parentProjectName: string }>({
type: 'input',
name: 'parentProjectName',
message: 'What parentProjectName would you like to use?',
})
).parentProjectName;
}

let parentProjectVersion = '';
if (!args['parentProjectVersion']) {
parentProjectVersion = (
Expand Down Expand Up @@ -118,7 +129,7 @@ async function main() {
//init generator
javaVersion,
groupId,
parentProjectName: name,
parentProjectName,
parentProjectVersion,
mavenRootDirectory,
dependencyManagement,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('create-nx-gradle-workspace', () => {
it('should be installed', () => {
workspaceDirectory = createTestWorkspaceWithCustomCli(
'create-nx-gradle-workspace',
'--javaVersion 21 --dsl kotlin --gradleRootDirectory test --preset micronaut',
'--javaVersion 21 --dsl kotlin --rootProjectName root-project --gradleRootDirectory test --preset micronaut',
);

// npm ls will fail if the package is not installed properly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('create-nx-maven-workspace', () => {
it('should be installed', () => {
workspaceDirectory = createTestWorkspaceWithCustomCli(
'create-nx-maven-workspace',
'--javaVersion 17 --groupId com.example --parentProjectVersion 0.0.0 --mavenRootDirectory test --dependencyManagement spring-boot-parent-pom',
'--javaVersion 17 --groupId com.example --parentProjectName root-project --parentProjectVersion 0.0.0 --mavenRootDirectory test --dependencyManagement spring-boot-parent-pom',
);

// npm ls will fail if the package is not installed properly
Expand Down

0 comments on commit 61a28e3

Please sign in to comment.