# HG changeset patch # User wenzelm # Date 1609874997 -3600 # Node ID a95f5ae5a12a3da95ca1ffdaccff169a22993d73 # Parent d045d900a92917be66f8538e348850088a413fe4 discontinued macOS JavaAppLauncher: re-use plain shell script; more uniform java_options for all platforms; diff -r d045d900a929 -r a95f5ae5a12a src/Pure/Admin/build_release.scala --- a/src/Pure/Admin/build_release.scala Tue Jan 05 19:34:32 2021 +0100 +++ b/src/Pure/Admin/build_release.scala Tue Jan 05 20:29:57 2021 +0100 @@ -248,6 +248,12 @@ /* Isabelle application */ + def make_isabelle_options(path: Path, options: List[String], line_ending: String = "\n") + { + val title = "# Java runtime options" + File.write(path, (title :: options).map(_ + line_ending).mkString) + } + def make_isabelle_app( path: Path, isabelle_home_prefix: String, @@ -291,7 +297,7 @@ } - def make_isabelle_plist(path: Path, isabelle_name: String, java_options: List[String]) + def make_isabelle_plist(path: Path, isabelle_name: String) { File.write(path, """ @@ -299,8 +305,6 @@ CFBundleDevelopmentRegion English -CFBundleExecutable -JavaAppLauncher CFBundleIconFile isabelle.icns CFBundleIdentifier @@ -329,10 +333,6 @@ true NSSupportsAutomaticGraphicsSwitching true -JVMRuntime -bundled.jdk -JVMMainClassName -isabelle.Main CFBundleDocumentTypes @@ -350,17 +350,6 @@ -JVMOptions - -""" + cat_lines(java_options.map(opt => "" + opt + "")) + """ --splash:$APP_ROOT/Contents/Resources/""" + isabelle_name + """/lib/logo/isabelle.gif --Dapple.awt.application.name=""" + isabelle_name + """ --Disabelle.root=$APP_ROOT/Contents/Resources/""" + isabelle_name + """ --Disabelle.app=true - -JVMArguments - - """) @@ -576,7 +565,6 @@ // Java parameters - val java_options_title = "# Java runtime options" val java_options: List[String] = (for { variable <- @@ -585,7 +573,11 @@ "JEDIT_JAVA_SYSTEM_OPTIONS", "JEDIT_JAVA_OPTIONS") opt <- Word.explode(other_isabelle.getenv(variable)) - } yield opt) ::: List("-Disabelle.jedit_server=" + isabelle_name) + } + yield { + val s = "-Dapple.awt.application.name=" + if (opt.startsWith(s)) s + isabelle_name else opt + }) ::: List("-Disabelle.jedit_server=" + isabelle_name) val classpath: List[Path] = { @@ -627,8 +619,8 @@ .replaceAll("view.fontsize=.*", "view.fontsize=24") .replaceAll("view.gutter.fontsize=.*", "view.gutter.fontsize=16")) - File.write(isabelle_target + Path.explode("Isabelle.options"), - terminate_lines(java_options_title :: java_options)) + make_isabelle_options( + isabelle_target + Path.explode("Isabelle.options"), java_options) make_isabelle_app( isabelle_target + Path.explode("lib/scripts/Isabelle_app"), @@ -665,31 +657,22 @@ val app_resources = app_contents + Path.explode("Resources") File.move(tmp_dir + Path.explode(isabelle_name), app_resources) - make_isabelle_plist( - app_contents + Path.explode("Info.plist"), isabelle_name, java_options) - - for (cp <- classpath) { - File.link( - Path.explode("../Resources/" + isabelle_name + "/") + cp, - app_contents + Path.explode("Java"), - force = true) - } + val isabelle_home_prefix = "Contents/Resources/" + isabelle_name File.link( - Path.explode("../Resources/" + isabelle_name + "/contrib/" + - jdk_component + "/x86_64-darwin"), - app_contents + Path.explode("PlugIns/bundled.jdk"), + Path.explode(isabelle_home_prefix), + app_dir + Path.explode("Isabelle"), force = true) - File.link( - Path.explode("../../Info.plist"), - app_resources + Path.explode(isabelle_name + "/" + isabelle_name + ".plist"), - force = true) + make_isabelle_app( + app_dir + Path.explode(isabelle_name), + isabelle_home_prefix, jdk_component, classpath) - File.link( - Path.explode("Contents/Resources/" + isabelle_name), - app_dir + Path.explode("Isabelle"), - force = true) + make_isabelle_options( + app_dir + Path.explode("Isabelle.options"), + java_options ::: List("-Disabelle.app=true")) + + make_isabelle_plist(app_contents + Path.explode("Info.plist"), isabelle_name) // application archive @@ -714,8 +697,9 @@ val app_template = Path.explode("~~/Admin/Windows/launch4j") - File.write(isabelle_target + Path.explode(isabelle_name + ".l4j.ini"), - (java_options_title :: java_options).map(_ + "\r\n").mkString) + make_isabelle_options( + isabelle_target + Path.explode(isabelle_name + ".l4j.ini"), + java_options, line_ending = "\r\n") val isabelle_xml = Path.explode("isabelle.xml") val isabelle_exe = Path.explode(isabelle_name + ".exe")