From 5b1555f059f4aff46704d12eeaafa8170503d228 Mon Sep 17 00:00:00 2001 From: Matt Busche Date: Tue, 28 May 2024 16:25:38 -0500 Subject: [PATCH] aggregate dependencies --- gradle.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gradle.js b/gradle.js index 2996775..3c6ea53 100644 --- a/gradle.js +++ b/gradle.js @@ -10,10 +10,15 @@ export const getJSFromFile = async (filename) => { }; export const getGradleDependenciesWithVersions = async (parsedGradle) => { + let allDependencies = []; + // if it's not an array, a single dependency has been declared and it doesn't apply if (Array.isArray(parsedGradle.dependencies)) { - return parsedGradle.dependencies.filter(dep => dep.version); + allDependencies = allDependencies.concat(parsedGradle.dependencies.filter(dep => dep.version)); } - return []; + if (Array.isArray(parsedGradle?.subprojects?.dependencies)) { + allDependencies = allDependencies.concat(parsedGradle.subprojects.dependencies.filter(dep => dep.version)); + } + return allDependencies; }; export const getGradleSpringBootVersion = async (parsedGradle) => {