git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9ca56c0
)
JAL-3599 STDOUT and STDERR saved and sent to System.out/err
author
Ben Soares
<b.soares@dundee.ac.uk>
Fri, 9 Jun 2023 10:15:17 +0000
(11:15 +0100)
committer
Ben Soares
<b.soares@dundee.ac.uk>
Fri, 9 Jun 2023 10:15:17 +0000
(11:15 +0100)
build.gradle
patch
|
blob
|
history
diff --git
a/build.gradle
b/build.gradle
index
23f3a7b
..
3fc0fed
100644
(file)
--- a/
build.gradle
+++ b/
build.gradle
@@
-4242,11
+4242,27
@@
task jalviewjsLaunchTest(type: Exec) {
chromiumBinary = System.getProperty("user.home") + chromiumBinary.substring(1)
}
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}.")
}
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)
}
executable(chromiumBinary)
@@
-4260,20
+4276,10
@@
task jalviewjsLaunchTest(type: Exec) {
"--enable-logging=stderr",
jalviewjsStderrLaunchFilename
])
"--enable-logging=stderr",
jalviewjsStderrLaunchFilename
])
-
- /*
- standardOutput = new ByteArrayOutputStream()
- errorOutput = new ByteArrayOutputStream()
doLast {
doLast {
- println("Chrome STDOUT: ")
- println(standardOutput.toString())
- println("Chrome STDERR: ")
- println(errorOutput.toString())
-
def found = false
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
if (line.contains(jalviewjs_desktop_init_string)) {
println("Found line '"+line+"'")
found = true
@@
-4283,6
+4289,5
@@
task jalviewjsLaunchTest(type: Exec) {
if (!found) {
throw new GradleException("Could not find evidence of Desktop launch in JalviewJS.")
}
if (!found) {
throw new GradleException("Could not find evidence of Desktop launch in JalviewJS.")
}
- }
- */
+ }
}
}