From 118014e213413f29a55903dcc9cd9a5fea176288 Mon Sep 17 00:00:00 2001 From: Sean Yap Date: Tue, 19 Feb 2019 00:03:58 +0800 Subject: [PATCH] build.gradle: fix headless task issue --- build.gradle | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index a3636f538..e2dc4a3fe 100644 --- a/build.gradle +++ b/build.gradle @@ -132,6 +132,24 @@ test { } } + +task headless { + doLast { + println 'Setting headless mode properties.' + test { + systemProperties = [ + 'testfx.robot': 'glass', + 'testfx.headless': 'true', + 'prism.order': 'sw', + 'prism.text': 't2k', + ] + } + } +} + +// Makes sure that headless properties are set before running tests +test.mustRunAfter headless + asciidoctor { backends 'html5' sourceDir 'docs' @@ -169,4 +187,4 @@ task copyStylesheets(type: Copy) { } asciidoctor.dependsOn copyStylesheets -defaultTasks 'clean', 'test', 'asciidoctor', 'checkstyleMain', 'checkstyleTest' +defaultTasks 'clean', 'headless', 'test', 'asciidoctor', 'checkstyleMain', 'checkstyleTest'