Make the walkers carry more meta data
This commit is contained in:
parent
61e2834a1b
commit
4b72bba43e
1 changed files with 19 additions and 5 deletions
|
|
@ -917,10 +917,12 @@ class MetaInfo extends GISJsonSerialised {
|
|||
class CollectedMeta {
|
||||
private MetaInfo metainfo
|
||||
private String accumulatedpath
|
||||
private String accumulatedmetapath
|
||||
|
||||
CollectedMeta(MetaInfo metainfo, String accumulatedpath = '') {
|
||||
CollectedMeta(MetaInfo metainfo, String accumulatedpath = '', String accumulatedmetapath = '') {
|
||||
this.metainfo = metainfo
|
||||
this.accumulatedpath = accumulatedpath
|
||||
this.accumulatedmetapath = accumulatedmetapath
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -971,7 +973,7 @@ class MetaInfo extends GISJsonSerialised {
|
|||
'comment': comment
|
||||
]
|
||||
if (!limiteddepth || maxdepth > 0) {
|
||||
results.metacollection.add(new CollectedMeta(this, gatheredpath))
|
||||
results.metacollection.add(new CollectedMeta(this, gatheredpath, gatheredmetapath))
|
||||
results.comment += "${level} ".padRight(level * 4) + globalreleasetag() + '\n'
|
||||
for (relatedmetainfo in associatedmeta) {
|
||||
if (!relatedmetainfo.format || relatedmetainfo.format == '0.1') {
|
||||
|
|
@ -1004,7 +1006,7 @@ class MetaInfo extends GISJsonSerialised {
|
|||
'comment': comment
|
||||
]
|
||||
if (!limiteddepth || maxdepth > 0) {
|
||||
results.metacollection.add(new CollectedMeta(this, gatheredpath))
|
||||
results.metacollection.add(new CollectedMeta(this, gatheredpath, gatheredmetapath))
|
||||
results.comment += "${level} ".padRight(level * 4) + globalreleasetag() + '\n'
|
||||
for (relatedmetainfo in associatedmeta) {
|
||||
if (relatedmetainfo.format == '0.2') {
|
||||
|
|
@ -1038,13 +1040,25 @@ class MetaInfo extends GISJsonSerialised {
|
|||
return results.metacollection
|
||||
}
|
||||
|
||||
Map<String, CollectedMeta> putwithshortestoffsetpath(Map<String, CollectedMeta> releasemetacollection, String uniquestring, CollectedMeta metaitem) {
|
||||
if (releasemetacollection.containsKey(uniquestring)) {
|
||||
def existingentry = releasemetacollection[uniquestring]
|
||||
if (existingentry.accumulatedpath.size() > metaitem.accumulatedpath.size()) {
|
||||
releasemetacollection.put(uniquestring, metaitem)
|
||||
}
|
||||
} else {
|
||||
releasemetacollection.put(uniquestring, metaitem)
|
||||
}
|
||||
return releasemetacollection
|
||||
}
|
||||
|
||||
Map<String, CollectedMeta> releasewalkerversionunique(int maxdepth, String startpath = '', String startmetapath = '') {
|
||||
def ArrayList<CollectedMeta> metacollection = releasewalker(maxdepth, startpath, "${startmetapath}/${METAFOLDERNAME}")
|
||||
|
||||
def Map<String, CollectedMeta> versionuniquecollection = new LinkedHashMap<String, CollectedMeta>()
|
||||
for (metaitem in metacollection) {
|
||||
def String uniquestring = metaitem.metainfo.componentversionuniqueidentifier()
|
||||
versionuniquecollection.put(uniquestring, metaitem)
|
||||
versionuniquecollection = putwithshortestoffsetpath(uniquestring, metaitem)
|
||||
}
|
||||
|
||||
return versionuniquecollection
|
||||
|
|
@ -1056,7 +1070,7 @@ class MetaInfo extends GISJsonSerialised {
|
|||
def Map<String, CollectedMeta> uniquecollection = new LinkedHashMap<String, CollectedMeta>()
|
||||
for (metaitem in metacollection) {
|
||||
def String uniquestring = metaitem.metainfo.componentidentifier()
|
||||
uniquecollection.put(uniquestring, metaitem)
|
||||
versionuniquecollection = putwithshortestoffsetpath(uniquestring, metaitem)
|
||||
}
|
||||
|
||||
return uniquecollection
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue