JAL-3599 --no-sandbox --disable-gpu and Thorium flatpak on build server
[jalview.git] / build.gradle
index d02b08c..679fb14 100644 (file)
@@ -4242,15 +4242,33 @@ task jalviewjsLaunchTest(type: Exec) {
     chromiumBinary = System.getProperty("user.home") + chromiumBinary.substring(1)
   }
   
+  def stdout
+  def stderr
   doFirst {
     def exec = file(chromiumBinary)
     if (!exec.exists()) {
       throw new GradleException("Could not find chromium binary '${chromiumBinary}'. Cannot run task ${name}.")
     }
+    
+    stdout = new ByteArrayOutputStream()
+    stderr = new ByteArrayOutputStream()
+    if (jalviewjs_j2s_to_console.equals("true")) {
+      standardOutput = new org.apache.tools.ant.util.TeeOutputStream(
+        stdout,
+        System.out)
+      errorOutput = new org.apache.tools.ant.util.TeeOutputStream(
+        stderr,
+        System.err)
+    } else {
+      standardOutput = stdout
+      errorOutput = stderr
+    }
   }
 
   executable(chromiumBinary)
   args([
+    "--no-sandbox",
+    "--disable-gpu",
     "--headless=new",
     "--timeout=60000",
     "--virtual-time-budget=60000",
@@ -4260,14 +4278,10 @@ task jalviewjsLaunchTest(type: Exec) {
     "--enable-logging=stderr",
     jalviewjsStderrLaunchFilename
   ])
-
-  standardOutput = new ByteArrayOutputStream()
-  errorOutput = new ByteArrayOutputStream()
   
   doLast {
     def found = false
-    def stderr = errorOutput.toString()
-    stderr.eachLine { line ->
+    stderr.toString().eachLine { line ->
       if (line.contains(jalviewjs_desktop_init_string)) {
         println("Found line '"+line+"'")
         found = true
@@ -4277,5 +4291,5 @@ task jalviewjsLaunchTest(type: Exec) {
     if (!found) {
       throw new GradleException("Could not find evidence of Desktop launch in JalviewJS.")
     }
-  }
+  } 
 }