Add a new meta walker and test it

This commit is contained in:
Dan Hawkins 2021-11-06 11:10:16 +00:00
commit e7dace6cb0
2 changed files with 31 additions and 0 deletions

17
build/integrity.groovy Normal file
View file

@ -0,0 +1,17 @@
def check(buildmeta) {
def results = [
'good': true,
'comment': '',
]
// Walk the meta looking for different versions of the same components
def allmeta = buildmeta.allrelatedmeta()
echo "All meta:"
for (meta in allmeta) {
echo meta.componentversionuniqueidentifier()
}
return results
}
return this

View file

@ -847,6 +847,20 @@ class MetaInfo extends GISJsonSerialised {
return releasemetaversionuniquecollection
}
ArrayList<MetaInfo> walkrelated(ArrayList<MetaInfo> metacollection) {
metacollection.add(this)
for (relatedmetainfo in associatedmeta) {
MetaInfo othermeta = relatedmetainfo.meta
metacollection = othermeta.walkrelated(metacollection)
}
return metacollection
}
ArrayList<MetaInfo> allrelatedmeta() {
ArrayList<MetaInfo> metacollection = new ArrayList<MetaInfo>()
return walkrelated(metacollection)
}
MetaInfo getNewMetaObject(script) {
return new MetaInfo(script)
}