aboutsummaryrefslogtreecommitdiff
path: root/vars
diff options
context:
space:
mode:
Diffstat (limited to 'vars')
-rw-r--r--vars/utils.groovy32
1 files changed, 32 insertions, 0 deletions
diff --git a/vars/utils.groovy b/vars/utils.groovy
index 6a5129e..2d4a3cb 100644
--- a/vars/utils.groovy
+++ b/vars/utils.groovy
@@ -32,6 +32,38 @@ class TClass implements Serializable {
def var = "varvalue"
}
+//@AutoClone // annotation is not CPS-compatible?
+class BuildConfig implements Serializable {
+ def nodetype = ""
+ def build_mode = ""
+ def build_args = []
+ def env_vars = []
+ def configure_cmds = []
+ def build_cmds = []
+ def run_tests = true
+ //Boolean boolValue
+
+ // Constructors
+ BuildConfig() {
+ nodetype = ""
+ }
+ BuildConfig(nodetype) {
+ this.nodetype = nodetype
+ }
+ // createNewInstance method requires Jenkins script approval for the
+ // following signatures:
+ // method groovy.lang.MetaBeanProperty getSetter
+ // method groovy.lang.MetaObjectProtocol getProperties
+ // method groovy.lang.MetaProperty getProperty java.lang.Object
+ // method groovy.lang.MetaProperty setProperty java.lang.Object java.lang.Object
+ def BuildConfig copy(){
+ BuildConfig.metaClass.getProperties().findAll(){it.getSetter()!=null}.inject(new BuildConfig()){buildconfig,metaProp->
+ metaProp.setProperty(buildconfig,metaProp.getProperty(this))
+ buildconfig
+ }
+ }
+}
+
def concurrent2(configs) {
def tasks = [:]
println("Size of configs = ${configs.size()}")