Add gradle list metaclass definitions like in maas to avoid gradle build failures for cord-tester
Change-Id: Ibc75de5b954e0f46c8f68112cf4a6ad6b41b3dae
diff --git a/build.gradle b/build.gradle
index 9b5de2c..baf28a3 100644
--- a/build.gradle
+++ b/build.gradle
@@ -71,6 +71,35 @@
}
+List.metaClass.asParam = { prefix, sep ->
+ if (delegate.size() == 0) {
+ ""
+ }
+ String result = "--" + prefix + "="
+ String p = ""
+ delegate.each {
+ result += p + "${it}"
+ p = sep
+ }
+ result
+}
+
+List.metaClass.p = { value, name ->
+ if (value != null && value != "") {
+ delegate << name + "=" + value
+ } else {
+ delegate
+ }
+}
+
+List.metaClass.p = { spec ->
+ if (spec != null && spec != "") {
+ delegate += spec
+ } else {
+ delegate
+ }
+}
+
// ~~~~~~~~~~~~~~~~~~~ Global tasks ~~~~~~~~~~~~~~~~~~~~~~~
// To be used to fetch upstream binaries, clone repos, etc.