From 2b998ce6facaa778754fcf2bc9449f9186cc45c8 Mon Sep 17 00:00:00 2001 From: Rick Herrick <jrherrick@wustl.edu> Date: Wed, 10 Feb 2016 11:32:46 -0600 Subject: [PATCH] Added propertyWithDefault() method to allow for not setting deploy properties explicitly. --- build.gradle | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 8f9d9583..68dacaa4 100644 --- a/build.gradle +++ b/build.gradle @@ -278,16 +278,16 @@ dependencies { cargo { containerId = 'tomcat7x' - port = deployPort as int + port = propertyWithDefault('deployPort', 8080) as int deployable { - context = deployContext + context = propertyWithDefault('deployContext', '/') } remote { - hostname = deployHost - username = deployUser - password = deployPassword + hostname = propertyWithDefault('deployHost', 'localhost') + username = propertyWithDefault('deployUser', 'deploy') + password = propertyWithDefault('deployPassword', 'deploy') } } @@ -350,3 +350,7 @@ publishing { } } } + +def propertyWithDefault(def String property, def defaultValue) { + hasProperty(property) ? eval(property) : defaultValue +} -- GitLab