tuned -- generate script by Isabelle/Scala;
authorwenzelm
Tue, 05 Jan 2021 17:40:51 +0100
changeset 73302 4b620e1cb1e9
parent 73301 523806d71dea
child 73303 abaff6fb0ff2
tuned -- generate script by Isabelle/Scala;
Admin/Linux/Isabelle_app
src/Pure/Admin/build_release.scala
--- a/Admin/Linux/Isabelle_app	Tue Jan 05 17:22:07 2021 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-#!/usr/bin/env bash
-#
-# Author: Makarius
-#
-# Main Isabelle application script.
-
-# minimal Isabelle environment
-
-ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd -P)/../.."; pwd)"
-source "$ISABELLE_HOME/lib/scripts/isabelle-platform"
-
-
-# Java runtime options
-
-declare -a JAVA_OPTIONS=($(perl -p -e 's,#.*$,,g;' "$ISABELLE_HOME/Isabelle.options"))
-
-
-# main
-
-#paranoia setting -- avoid problems of Java/Swing versus XIM/IBus etc.
-unset XMODIFIERS
-
-exec "$ISABELLE_HOME/contrib/jdk/x86_64-linux/jre/bin/java" \
-  "-Disabelle.root=$ISABELLE_HOME" "${JAVA_OPTIONS[@]}" \
-  -classpath "{CLASSPATH}" \
-  "-splash:$ISABELLE_HOME/lib/logo/isabelle.gif" \
-  isabelle.Main "$@"
--- a/src/Pure/Admin/build_release.scala	Tue Jan 05 17:22:07 2021 +0100
+++ b/src/Pure/Admin/build_release.scala	Tue Jan 05 17:40:51 2021 +0100
@@ -246,7 +246,40 @@
   }
 
 
-  /* main */
+  /* Isabelle_app script */
+
+  def isabelle_app_script(classpath: List[Path], jdk_component: String): String =
+    """#!/usr/bin/env bash
+#
+# Author: Makarius
+#
+# Main Isabelle application script.
+
+# minimal Isabelle environment
+
+ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd -P)/../.."; pwd)"
+source "$ISABELLE_HOME/lib/scripts/isabelle-platform"
+
+
+# Java runtime options
+
+declare -a JAVA_OPTIONS=($(perl -p -e 's,#.*$,,g;' "$ISABELLE_HOME/Isabelle.options"))
+
+
+# main
+
+#paranoia setting -- avoid problems of Java/Swing versus XIM/IBus etc.
+unset XMODIFIERS
+
+exec "$ISABELLE_HOME/contrib/""" + jdk_component + """/x86_64-linux/jre/bin/java" \
+  "-Disabelle.root=$ISABELLE_HOME" "${JAVA_OPTIONS[@]}" \
+  -classpath """" + classpath.map("$ISABELLE_HOME/" + _).mkString(":") + """" \
+  "-splash:$ISABELLE_HOME/lib/logo/isabelle.gif" \
+  isabelle.Main "$@"
+"""
+
+
+    /* main */
 
   private val default_platform_families: List[Platform.Family.Value] =
     List(Platform.Family.linux, Platform.Family.windows, Platform.Family.macos)
@@ -510,10 +543,7 @@
               terminate_lines(java_options_title :: java_options))
 
             val isabelle_app = isabelle_target + Path.explode("lib/scripts/Isabelle_app")
-            File.write(isabelle_app,
-              File.read(Path.explode("~~/Admin/Linux/Isabelle_app"))
-                .replace("{CLASSPATH}", classpath.map("$ISABELLE_HOME/" + _).mkString(":"))
-                .replace("/jdk/", "/" + jdk_component + "/"))
+            File.write(isabelle_app, isabelle_app_script(classpath, jdk_component))
             File.set_executable(isabelle_app, true)
 
             val linux_app = isabelle_target + Path.explode("contrib/linux_app")