Add project of the current artifact to the report.

This commit is contained in:
Manuele Simi 2020-03-11 11:51:14 -04:00
parent 51b58457ef
commit 7da9720c28
1 changed files with 7 additions and 3 deletions

10
Jenkinsfile vendored
View File

@ -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
}