def firstRun = file("${userDir}/First Run")
doFirst {
+ // clear out old profile
+ delete profileDir
+
mkdir profileDir
firstRun.text = ""
}
task jalviewjsLaunchTest(type: Exec) {
group "Test"
description "Check JalviewJS opens in a browser"
- dependsOn jalviewjsBuildSite
+// dependsOn jalviewjsBuildSite
dependsOn jalviewjsCopyStderrLaunchFile
dependsOn jalviewjsChromiumProfile
- def chromiumBinary = jalviewjs_chromium_binary
+ def macOS = OperatingSystem.current().isMacOsX()
+ def chromiumBinary = macOS ? jalviewjs_macos_chromium_binary : jalviewjs_chromium_binary
if (chromiumBinary.startsWith("~/")) {
chromiumBinary = System.getProperty("user.home") + chromiumBinary.substring(1)
}
def stdout
def stderr
doFirst {
- def exec = file(chromiumBinary)
- if (!exec.exists()) {
+ def binary = file(chromiumBinary)
+ if (!binary.exists()) {
throw new StopExecutionException("Could not find chromium binary '${chromiumBinary}'. Cannot run task ${name}.")
}
}
}
+ def timeoutms = Integer.valueOf(jalviewjs_chromium_timeout) * 1000
+
executable(chromiumBinary)
args([
"--no-sandbox", // --no-sandbox IS USED BY THE THORIUM APPIMAGE ON THE BUILDSERVER
"--headless=new",
"--disable-gpu",
- "--timeout=60000",
- "--virtual-time-budget=60000",
- "--user-data-dir=${jalviewjsBuildDir}/${jalviewjs_chromium_user_dir}",
+ "--timeout=${timeoutms}",
+ "--virtual-time-budget=${timeoutms}",
+ "--user-data-dir=${jalviewDirAbsolutePath}/${jalviewjsBuildDir}/${jalviewjs_chromium_user_dir}",
"--profile-directory=${jalviewjs_chromium_profile_name}",
"--allow-file-access-from-files",
"--enable-logging=stderr",
- jalviewjsStderrLaunchFilename
+ "file://${jalviewDirAbsolutePath}/${jalviewjsStderrLaunchFilename}"
])
doLast {
# for checking jalviewjs launches okay
jalviewjs_chromium_binary = ~/buildtools/chromium/chrome
+jalviewjs_macos_chromium_binary = /Applications/Chromium.app/Contents/MacOS/Chromium
jalviewjs_chromium_user_dir = chromium
+jalviewjs_chromium_timeout = 30
jalviewjs_chromium_profile_name = BUILD
jalviewjs_stderr_launch = utils/jalviewjs/chromium_test/jalview_bin_Jalview-stderr.html
jalviewjs_desktop_init_string = JALVIEWJS: CREATED DESKTOP