From 04067e214d15eebdf574b58cb4f44f0cfb6f0990 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 6 Nov 2021 11:49:23 +0000 Subject: [PATCH] Add a new meta walker and test it --- build/integrity.groovy | 4 ++-- meta/folder.groovy | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/build/integrity.groovy b/build/integrity.groovy index 3f658a8..6fb9985 100644 --- a/build/integrity.groovy +++ b/build/integrity.groovy @@ -7,8 +7,8 @@ def check(buildmeta) { // Walk the meta looking for different versions of the same components def allmeta = buildmeta.allrelatedmeta() - echo "All meta:" - for (meta in allmeta) { + echo "All meta:\n${allmeta.comment}" + for (meta in allmeta.metacollection) { echo meta.componentversionuniqueidentifier() } return results diff --git a/meta/folder.groovy b/meta/folder.groovy index 63e2fa5..be4ac9f 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -847,16 +847,17 @@ class MetaInfo extends GISJsonSerialised { return releasemetaversionuniquecollection } - ArrayList walkrelated(ArrayList metacollection) { + def walkrelated(ArrayList metacollection, String comment = '', int level = 0) { metacollection.add(this) + comment += ''.padright(level) + componentversionuniqueidentifier() + '\n' for (relatedmetainfo in associatedmeta) { MetaInfo othermeta = relatedmetainfo.meta - metacollection = othermeta.walkrelated(metacollection) + results = othermeta.walkrelated(metacollection, comment, level + 1) } - return metacollection + return [ 'metacollection' : results.metacollection, 'comment': results.comment] } - ArrayList allrelatedmeta() { + def allrelatedmeta() { ArrayList metacollection = new ArrayList() return walkrelated(metacollection) }