From 7da9720c2818d1bfd1a8e273f247954b03393aaf Mon Sep 17 00:00:00 2001 From: Manuele Simi Date: Wed, 11 Mar 2020 11:51:14 -0400 Subject: [PATCH] Add project of the current artifact to the report. --- Jenkinsfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 }