diff --git a/src/org/SHS/Platforms.groovy b/src/org/SHS/Platforms.groovy index 095292c..ef2e005 100644 --- a/src/org/SHS/Platforms.groovy +++ b/src/org/SHS/Platforms.groovy @@ -2,12 +2,25 @@ package org.SHS class Platforms { def steps + public Platforms(steps) {this.steps = steps} - public Boolean get() { + + public void get() { steps.stage("Download platforms.json") { steps.sh "rm -rf platforms" steps.sh "git clone --depth 1 ${steps.env.PLATFORMS_GIT} platforms" } } + public void forEach(functor, stage_suffix = "") { + def root = steps.readJSON(file: 'platforms/platforms.json') + root.Platforms.each { key, dist -> + if (dist.enabled) { + steps.stage ("${key}${stage_suffix}") { + functor(dist) + } + } + } + } + } \ No newline at end of file