more systematic java-gui-setup, also for "isabelle jedit" command-line tool;
authorwenzelm
Tue, 19 Jan 2021 14:04:31 +0100
changeset 73406 31fbde3baa97
parent 73405 aeba7bb4f4d4
child 73407 c4b688abe2c4
more systematic java-gui-setup, also for "isabelle jedit" command-line tool;
lib/scripts/java-gui-setup
src/Pure/Admin/build_release.scala
src/Tools/jEdit/lib/Tools/jedit
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/scripts/java-gui-setup	Tue Jan 19 14:04:31 2021 +0100
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+#
+# java-gui-setup --- platform-specific setup for Java/Swing GUI applications
+
+if [ "$ISABELLE_PLATFORM_FAMILY" = "macos" ]
+then
+  JAVA_VERSION="$("$ISABELLE_JDK_HOME/bin/java" -version 2>&1 | head -n 1 | cut -d '"' -f2)"
+  JAVA_DOMAIN="com.azul.zulu.${JAVA_VERSION}.java"
+  defaults read "$JAVA_DOMAIN" AppleWindowTabbingMode >/dev/null 2>/dev/null ||
+    defaults write "$JAVA_DOMAIN" AppleWindowTabbingMode manual >/dev/null 2>/dev/null
+fi
--- a/src/Pure/Admin/build_release.scala	Tue Jan 19 13:48:53 2021 +0100
+++ b/src/Pure/Admin/build_release.scala	Tue Jan 19 14:04:31 2021 +0100
@@ -287,12 +287,7 @@
 
 declare -a JAVA_OPTIONS=($(perl -p -e 's,#.*$,,g;' "$ISABELLE_HOME/Isabelle.options"))
 
-if [ "$ISABELLE_PLATFORM_FAMILY" = "macos" ]; then
-  JAVA_VERSION="$("$ISABELLE_JDK_HOME/bin/java" -version 2>&1 | head -n 1 | cut -d '"' -f2)"
-  JAVA_DOMAIN="com.azul.zulu.${JAVA_VERSION}.java"
-  defaults read "$JAVA_DOMAIN" AppleWindowTabbingMode >/dev/null 2>/dev/null ||
-    defaults write "$JAVA_DOMAIN" AppleWindowTabbingMode manual >/dev/null 2>/dev/null
-fi
+"$ISABELLE_HOME/lib/scripts/java-gui-setup"
 
 exec "$ISABELLE_JDK_HOME/bin/java" \
   "-Disabelle.root=$ISABELLE_HOME" "${JAVA_OPTIONS[@]}" \
--- a/src/Tools/jEdit/lib/Tools/jedit	Tue Jan 19 13:48:53 2021 +0100
+++ b/src/Tools/jEdit/lib/Tools/jedit	Tue Jan 19 14:04:31 2021 +0100
@@ -408,6 +408,8 @@
 
 if [ "$BUILD_ONLY" = false ]
 then
+  "$ISABELLE_HOME/lib/scripts/java-gui-setup"
+
   export JEDIT_SESSION_DIRS JEDIT_LOGIC JEDIT_LOGIC_ANCESTOR JEDIT_LOGIC_REQUIREMENTS \
     JEDIT_INCLUDE_SESSIONS JEDIT_PRINT_MODE JEDIT_NO_BUILD JEDIT_BUILD_MODE
   export JEDIT_ML_PROCESS_POLICY="$ML_PROCESS_POLICY"