diff --git a/Jenkinsfile b/Jenkinsfile index 938e593..3673bff 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -65,10 +65,16 @@ def findDownstreamDependencies(modules2deps, artifact) { def analyzeDependency(modules2deps, artifacts2projects, report, artifact, deep) { def level = "L${deep}" report['downstream_modules'][level][artifact] = [ 'dependencies':[], 'projects':[] ] + + // get all downstream dependencies report['downstream_modules'][level][artifact]['dependencies'].addAll(findDownstreamDependencies(modules2deps, artifact)) //println "${artifact} is used by ${report['downstream_modules'][level][artifact]['dependencies']}" - // then we look for the projects that build the downstream dependencies + // add the project that builds the artifact + report['downstream_modules'][level][artifact]['projects'] << artifacts2projects[artifact] + report['downstream_projects'] << artifacts2projects[artifact] + + // then we look for the projects that build the downstream dependencies and finally we go recursive if (report['downstream_modules'][level][artifact]['dependencies']) { def nextDeep = ++deep report['downstream_modules']["L${nextDeep}"] = [:] @@ -79,8 +85,6 @@ def analyzeDependency(modules2deps, artifacts2projects, report, artifact, deep) analyzeDependency(modules2deps, artifacts2projects, report, d, nextDeep) } } - - report }