Skip to content

Commit

Permalink
feat(nx-quarkus): add option to choose which version of Java to use
Browse files Browse the repository at this point in the history
  • Loading branch information
tinesoft committed May 9, 2024
1 parent be847ff commit 6ef262c
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 1 deletion.
24 changes: 24 additions & 0 deletions packages/nx-quarkus/src/generators/preset/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,30 @@
},
"x-priority": "important"
},
"javaVersion": {
"description": "Java version.",
"type": "string",
"default": "17",
"enum": [
"17",
"21"
],
"x-prompt": {
"message": "Which version of Java would you like to use?",
"type": "list",
"items": [
{
"value": "21",
"label": "21"
},
{
"value": "17",
"label": "17"
}
]
},
"x-priority": "important"
},
"groupId": {
"description": "Group Id of the project.",
"type": "string",
Expand Down
3 changes: 2 additions & 1 deletion packages/nx-quarkus/src/generators/project/generator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ describe('project generator', () => {
groupId: 'com.tinesoft',
artifactId: 'demo',
buildSystem: 'MAVEN',
javaVersion: '17',
quarkusInitializerUrl: DEFAULT_QUARKUS_INITIALIZR_URL,
};

Expand Down Expand Up @@ -133,7 +134,7 @@ describe('project generator', () => {
wrapperName,
}) => {
const rootDir = '.';
const downloadUrl = `${options.quarkusInitializerUrl}/d?b=${buildSystem}&g=${options.groupId}&a=${options.artifactId}`;
const downloadUrl = `${options.quarkusInitializerUrl}/d?b=${buildSystem}&j=${options.javaVersion}&g=${options.groupId}&a=${options.artifactId}`;

const zipFiles = [
{
Expand Down
1 change: 1 addition & 0 deletions packages/nx-quarkus/src/generators/project/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface ProjectGeneratorOptions {
proxyUrl?: string;

buildSystem: 'MAVEN' | 'GRADLE' | 'GRADLE_KOTLIN_DSL';
javaVersion?: string;
groupId?: string;
artifactId?: string;
skipCodeSamples?: boolean;
Expand Down
24 changes: 24 additions & 0 deletions packages/nx-quarkus/src/generators/project/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,30 @@
},
"x-priority": "important"
},
"javaVersion": {
"description": "Java version.",
"type": "string",
"default": "17",
"enum": [
"17",
"21"
],
"x-prompt": {
"message": "Which version of Java would you like to use?",
"type": "list",
"items": [
{
"value": "21",
"label": "21"
},
{
"value": "17",
"label": "17"
}
]
},
"x-priority": "important"
},
"groupId": {
"description": "Group Id of the project.",
"type": "string",
Expand Down
1 change: 1 addition & 0 deletions packages/nx-quarkus/src/utils/quarkus-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export function runQuarkusPluginCommand(
export function buildQuarkusDownloadUrl(options: NormalizedSchema) {
const params = [
{ key: 'b', value: options.buildSystem },
{ key: 'j', value: options.javaVersion },
{ key: 'g', value: options.groupId },
{ key: 'a', value: options.artifactId },
{ key: 'v', value: options.version },
Expand Down

0 comments on commit 6ef262c

Please sign in to comment.