From a19b213d7db7e274dba093e8978f0e12bf26ba81 Mon Sep 17 00:00:00 2001 From: Clinton Date: Wed, 17 Jan 2018 13:08:00 +0000 Subject: [PATCH] Added conditional to disable tests when CORDA_DOCS_ONLY_BUILD envvar is present (#2371) --- build.gradle | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/build.gradle b/build.gradle index e416f5a248..a64dc578eb 100644 --- a/build.gradle +++ b/build.gradle @@ -329,3 +329,30 @@ artifactory { task generateApi(type: net.corda.plugins.GenerateApi){ baseName = "api-corda" } + +// This exists to reduce CI build time when the envvar is set (can save up to 40 minutes) +if(System.getenv('CORDA_DOCS_ONLY_BUILD') != null) { + logger.info("Tests are disabled due to presence of envvar CORDA_DOCS_ONLY_BUILD") + + allprojects { + test { + exclude '*/**' + } + + it.afterEvaluate { + if(it.tasks.findByName("integrationTest") != null) { + integrationTest { + exclude '*/**' + } + } + } + + it.afterEvaluate { + if(it.tasks.findByName("smokeTest") != null) { + smokeTest { + exclude '*/**' + } + } + } + } +}