Skip to content

Commit

Permalink
fix: add ability to provide maven profiles for generating dependency …
Browse files Browse the repository at this point in the history
…graph
  • Loading branch information
remie committed Dec 17, 2024
1 parent 49ea087 commit a477f00
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/apt/helpers/generateDependencyTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export const generateDependencyTree = async (options: TAPTDependencyTreeOptions)
const maven = spawn(
'mvn',
[
...options.activateProfiles ? [ '-P', options.activateProfiles ] : [],
'dependency:tree',
'-f', pomFile,
'-DoutputType=dot',
Expand Down
2 changes: 2 additions & 0 deletions src/commands/apt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ const DependencyTreeCommand = () => ({
action: async (options: TAPTDependencyTreeArgs) => {
await generateDependencyTree({
appKey: options.appKey,
activateProfiles: options.activateProfiles,
outputFile: options.outputFile || join(cwd(), 'maven_dependency_tree.gv')
});
},
Expand Down Expand Up @@ -498,6 +499,7 @@ program
.command('dependencies')
.description('Generate the Data Center App Performance Testing dependency tree')
.addOption(new Option('--appKey <appKey>', 'The key of the app to graph dependencies for'))
.addOption(new Option('-P, --activate-profiles <arg>', 'Comma-delimited list of profiles to activate'))
.addOption(new Option('-O, --outputFile <path>', 'Specify the output file where to store the generated dependency tree (defaults to `./maven_dependency_tree.gv`)'))
.action(options => ActionHandler(program, DependencyTreeCommand(), options));

Expand Down
5 changes: 5 additions & 0 deletions src/types/DCAPT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,19 @@ export const APTRestartOptions = APTTeardownOptions.extend({});

export const APTDependencyTreeArgs = z.object({
appKey: z.string(),
activateProfiles: z.string(),
outputFile: z.string()
}).partial({
activateProfiles: true,
outputFile: true
});

export const APTDependencyTreeOptions = z.object({
appKey: z.string(),
activateProfiles: z.string(),
outputFile: z.string()
}).partial({
activateProfiles: true
});

export const APTSCAArgs = z.object({
Expand Down

0 comments on commit a477f00

Please sign in to comment.