src/Pure/Admin/build_jedit.scala
author wenzelm
Sat, 05 Mar 2022 11:12:26 +0100
changeset 75220 1cbdf9cfc94b
parent 75202 4fdde010086f
child 75221 ea65e18c5614
permissions -rw-r--r--
clarified signature;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
     1
/*  Title:      Pure/Admin/build_jedit.scala
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
     2
    Author:     Makarius
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
     3
73987
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
     4
Build component for jEdit text-editor.
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
     5
*/
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
     6
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
     7
package isabelle
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
     8
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
     9
73983
e2913fc81142 more systematic treatment of encodings;
wenzelm
parents: 73982
diff changeset
    10
import java.nio.charset.Charset
e2913fc81142 more systematic treatment of encodings;
wenzelm
parents: 73982
diff changeset
    11
e2913fc81142 more systematic treatment of encodings;
wenzelm
parents: 73982
diff changeset
    12
import scala.jdk.CollectionConverters._
e2913fc81142 more systematic treatment of encodings;
wenzelm
parents: 73982
diff changeset
    13
e2913fc81142 more systematic treatment of encodings;
wenzelm
parents: 73982
diff changeset
    14
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    15
object Build_JEdit
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    16
{
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    17
  /* modes */
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    18
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    19
  object Mode
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    20
  {
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    21
    val empty: Mode = new Mode("", "", Nil)
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    22
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    23
    val init: Mode =
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    24
      empty +
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    25
        ("noWordSep" -> """_'?⇩\^<>""") +
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    26
        ("unalignedOpenBrackets" -> "{[(«‹⟨⌈⌊⦇⟦⦃⦉") +
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    27
        ("unalignedCloseBrackets" -> "⦊⦄⟧⦈⌋⌉⟩›»)]}") +
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    28
        ("tabSize" -> "2") +
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    29
        ("indentSize" -> "2")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    30
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    31
    val list: List[Mode] =
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    32
    {
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    33
      val isabelle_news: Mode = init.define("isabelle-news", "Isabelle NEWS")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    34
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    35
      val isabelle: Mode =
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    36
        init.define("isabelle", "Isabelle theory") +
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    37
          ("commentStart" -> "(*") +
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    38
          ("commentEnd" -> "*)")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    39
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    40
      val isabelle_ml: Mode = isabelle.define("isabelle-ml", "Isabelle/ML")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    41
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    42
      val isabelle_root: Mode = isabelle.define("isabelle-root", "Isabelle session root")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    43
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    44
      val isabelle_options: Mode = isabelle.define("isabelle-options", "Isabelle options")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    45
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    46
      val sml: Mode =
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    47
        init.define("sml", "Standard ML") +
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    48
          ("commentStart" -> "(*") +
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    49
          ("commentEnd" -> "*)") +
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    50
          ("noWordSep" -> "_'")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    51
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    52
      List(isabelle_news, isabelle, isabelle_ml, isabelle_root, isabelle_options, sml)
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    53
    }
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    54
  }
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    55
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    56
  final case class Mode private(name: String, description: String, rev_props: Properties.T)
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    57
  {
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    58
    override def toString: String = name
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    59
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    60
    def define(a: String, b: String): Mode = new Mode(a, b, rev_props)
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    61
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    62
    def + (entry: Properties.Entry): Mode =
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    63
      new Mode(name, description, Properties.put(rev_props, entry))
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    64
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    65
    def write(dir: Path): Unit =
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    66
    {
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    67
      require(name.nonEmpty && description.nonEmpty, "Bad Isabelle/jEdit mode content")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    68
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    69
      val properties =
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    70
        rev_props.reverse.map(p =>
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    71
          Symbol.spaces(4) +
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    72
          XML.string_of_tree(XML.elem(Markup("PROPERTY", List("NAME" -> p._1, "VALUE" -> p._2)))))
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    73
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    74
      File.write(dir + Path.basic(name).xml,
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    75
"""<?xml version="1.0" encoding="UTF-8"?>
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    76
<!DOCTYPE MODE SYSTEM "xmode.dtd">
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    77
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    78
<!-- """ + XML.text(description) + """ mode -->
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    79
<MODE>
73665
9ab1d5fa84d0 tuned whitespace;
wenzelm
parents: 73660
diff changeset
    80
  <PROPS>""" + properties.mkString("\n", "\n", "") + """
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    81
  </PROPS>
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    82
</MODE>
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    83
""")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    84
    }
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    85
  }
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    86
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    87
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    88
  /* build jEdit component */
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    89
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    90
  private val download_jars: List[(String, String)] =
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    91
    List(
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    92
      "https://repo1.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar" ->
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    93
      "jsr305-3.0.2.jar")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    94
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    95
  private val download_plugins: List[(String, String)] =
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    96
    List(
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    97
      "Code2HTML" -> "0.7",
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    98
      "CommonControls" -> "1.7.4",
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    99
      "Console" -> "5.1.4",
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   100
      "ErrorList" -> "2.4.0",
74548
1861f4d1d3f9 updated to jEdit plugin Highlight 2.5;
wenzelm
parents: 74104
diff changeset
   101
      "Highlight" -> "2.5",
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   102
      "Navigator" -> "2.7",
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   103
      "SideKick" -> "1.8")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   104
74104
fa92c5f8af86 clarified jEdit java sources;
wenzelm
parents: 74057
diff changeset
   105
  private def exclude_package(name: String): Boolean =
fa92c5f8af86 clarified jEdit java sources;
wenzelm
parents: 74057
diff changeset
   106
    name.startsWith("de.masters_of_disaster.ant") ||
fa92c5f8af86 clarified jEdit java sources;
wenzelm
parents: 74057
diff changeset
   107
    name == "doclet" ||
fa92c5f8af86 clarified jEdit java sources;
wenzelm
parents: 74057
diff changeset
   108
    name == "installer"
fa92c5f8af86 clarified jEdit java sources;
wenzelm
parents: 74057
diff changeset
   109
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   110
  def build_jedit(
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   111
    component_dir: Path,
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   112
    version: String,
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   113
    original: Boolean = false,
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   114
    java_home: Path = default_java_home,
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   115
    progress: Progress = new Progress): Unit =
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   116
  {
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   117
    Isabelle_System.require_command("ant", test = "-version")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   118
    Isabelle_System.require_command("patch")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   119
    Isabelle_System.require_command("unzip", test = "-h")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   120
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   121
    Isabelle_System.new_directory(component_dir)
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   122
74030
39e05601faeb more accurate scala_project, based on build.props of components;
wenzelm
parents: 73987
diff changeset
   123
    val etc_dir = Isabelle_System.make_directory(component_dir + Path.explode("etc"))
39e05601faeb more accurate scala_project, based on build.props of components;
wenzelm
parents: 73987
diff changeset
   124
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   125
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   126
    /* jEdit directory */
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   127
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   128
    val jedit = "jedit" + version
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   129
    val jedit_patched = jedit + "-patched"
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   130
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   131
    val jedit_dir = Isabelle_System.make_directory(component_dir + Path.basic(jedit))
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   132
    val jedit_patched_dir = component_dir + Path.basic(jedit_patched)
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   133
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   134
    def download_jedit(dir: Path, name: String, target_name: String = ""): Path =
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   135
    {
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   136
      val jedit_name = jedit + name
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   137
      val url =
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   138
        "https://sourceforge.net/projects/jedit/files/jedit/" +
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   139
          version + "/" + jedit_name + "/download"
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   140
      val path = dir + Path.basic(proper_string(target_name) getOrElse jedit_name)
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   141
      Isabelle_System.download_file(url, path, progress = progress)
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   142
      path
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   143
    }
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   144
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   145
    Isabelle_System.with_tmp_dir("tmp")(tmp_dir =>
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   146
    {
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   147
      /* original version */
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   148
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   149
      val install_path = download_jedit(tmp_dir, "install.jar")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   150
      Isabelle_System.bash("""export CLASSPATH=""
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   151
isabelle_java java -Duser.home=""" + File.bash_platform_path(tmp_dir) +
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   152
        " -jar " + File.bash_platform_path(install_path) + " auto " +
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   153
        File.bash_platform_path(jedit_dir) + " unix-script=off unix-man=off").check
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   154
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   155
      val source_path = download_jedit(tmp_dir, "source.tar.bz2")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   156
      Isabelle_System.gnutar("-xjf " + File.bash_path(source_path), dir = jedit_dir).check
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   157
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   158
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   159
      /* patched version */
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   160
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   161
      Isabelle_System.copy_dir(jedit_dir, jedit_patched_dir)
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   162
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   163
      val source_dir = jedit_patched_dir + Path.basic("jEdit")
74660
a755733c1eb5 suppress sources from jEdit/test, which prevent regular build of the generated scala_project;
wenzelm
parents: 74548
diff changeset
   164
      val org_source_dir = source_dir + Path.basic("org")
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   165
      val tmp_source_dir = tmp_dir + Path.basic("jEdit")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   166
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   167
      progress.echo("Patching jEdit sources ...")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   168
      for {
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   169
        file <- File.find_files(Path.explode("~~/src/Tools/jEdit/patches").file).iterator
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   170
        name = file.getName
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   171
        if !name.endsWith("~") && !name.endsWith(".orig")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   172
      } {
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   173
        progress.bash("patch -p2 < " + File.bash_path(File.path(file)),
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   174
          cwd = source_dir.file, echo = true).check
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   175
      }
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   176
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   177
      for { theme <- List("classic", "tango") } {
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   178
        val path = Path.explode("org/gjt/sp/jedit/icons/themes/" + theme + "/32x32/apps/isabelle.gif")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   179
        Isabelle_System.copy_file(Path.explode("~~/lib/logo/isabelle_transparent-32.gif"),
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   180
          source_dir + path)
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   181
      }
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   182
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   183
      progress.echo("Building jEdit ...")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   184
      Isabelle_System.copy_dir(source_dir, tmp_source_dir)
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   185
      progress.bash("env JAVA_HOME=" + File.bash_platform_path(java_home) + " ant",
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   186
        cwd = tmp_source_dir.file, echo = true).check
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   187
      Isabelle_System.copy_file(tmp_source_dir + Path.explode("build/jedit.jar"), jedit_patched_dir)
74030
39e05601faeb more accurate scala_project, based on build.props of components;
wenzelm
parents: 73987
diff changeset
   188
39e05601faeb more accurate scala_project, based on build.props of components;
wenzelm
parents: 73987
diff changeset
   189
      val java_sources =
74104
fa92c5f8af86 clarified jEdit java sources;
wenzelm
parents: 74057
diff changeset
   190
        for {
74660
a755733c1eb5 suppress sources from jEdit/test, which prevent regular build of the generated scala_project;
wenzelm
parents: 74548
diff changeset
   191
          file <- File.find_files(org_source_dir.file, file => file.getName.endsWith(".java"))
74104
fa92c5f8af86 clarified jEdit java sources;
wenzelm
parents: 74057
diff changeset
   192
          package_name <- Scala_Project.package_name(File.path(file))
fa92c5f8af86 clarified jEdit java sources;
wenzelm
parents: 74057
diff changeset
   193
          if !exclude_package(package_name)
fa92c5f8af86 clarified jEdit java sources;
wenzelm
parents: 74057
diff changeset
   194
        } yield File.path(component_dir.java_path.relativize(file.toPath).toFile)
74030
39e05601faeb more accurate scala_project, based on build.props of components;
wenzelm
parents: 73987
diff changeset
   195
39e05601faeb more accurate scala_project, based on build.props of components;
wenzelm
parents: 73987
diff changeset
   196
      File.write(etc_dir + Path.explode("build.props"),
74057
22ad3ac2152c clarified properties: "module" and "no_build";
wenzelm
parents: 74030
diff changeset
   197
        "module = " + jedit_patched + "/jedit.jar\n" +
22ad3ac2152c clarified properties: "module" and "no_build";
wenzelm
parents: 74030
diff changeset
   198
        "no_build = true\n" +
74030
39e05601faeb more accurate scala_project, based on build.props of components;
wenzelm
parents: 73987
diff changeset
   199
        "requirements = env:JEDIT_JARS\n" +
39e05601faeb more accurate scala_project, based on build.props of components;
wenzelm
parents: 73987
diff changeset
   200
        ("sources =" :: java_sources.map(p => "  " + p.implode)).mkString("", " \\\n", "\n"))
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   201
    })
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   202
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   203
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   204
    /* jars */
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   205
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   206
    val jars_dir = Isabelle_System.make_directory(jedit_patched_dir + Path.basic("jars"))
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   207
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   208
    for { (url, name) <- download_jars } {
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   209
      Isabelle_System.download_file(url, jars_dir + Path.basic(name), progress = progress)
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   210
    }
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   211
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   212
    for { (name, vers) <- download_plugins } {
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   213
      Isabelle_System.with_tmp_file("tmp", ext = "zip")(zip_path =>
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   214
      {
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   215
        val url =
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   216
          "https://sourceforge.net/projects/jedit-plugins/files/" + name + "/" + vers + "/" +
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   217
            name + "-" + vers + "-bin.zip/download"
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   218
        Isabelle_System.download_file(url, zip_path, progress = progress)
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   219
        Isabelle_System.bash("unzip -x " + File.bash_path(zip_path), cwd = jars_dir.file).check
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   220
      })
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   221
    }
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   222
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   223
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   224
    /* resources */
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   225
73983
e2913fc81142 more systematic treatment of encodings;
wenzelm
parents: 73982
diff changeset
   226
    val keep_encodings = List("ISO-8859-1", "ISO-8859-15", "US-ASCII", "UTF-8", "windows-1252")
e2913fc81142 more systematic treatment of encodings;
wenzelm
parents: 73982
diff changeset
   227
    val drop_encodings =
e2913fc81142 more systematic treatment of encodings;
wenzelm
parents: 73982
diff changeset
   228
      Charset.availableCharsets().keySet().asScala.toList.sorted.filterNot(keep_encodings.contains)
e2913fc81142 more systematic treatment of encodings;
wenzelm
parents: 73982
diff changeset
   229
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   230
    File.write(jedit_patched_dir + Path.explode("properties/jEdit.props"),
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   231
"""#jEdit properties
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   232
autoReloadDialog=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   233
buffer.deepIndent=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   234
buffer.encoding=UTF-8-Isabelle
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   235
buffer.indentSize=2
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   236
buffer.lineSeparator=\n
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   237
buffer.maxLineLen=100
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   238
buffer.noTabs=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   239
buffer.sidekick.keystroke-parse=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   240
buffer.tabSize=2
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   241
buffer.undoCount=1000
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   242
close-docking-area.shortcut2=C+e C+CIRCUMFLEX
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   243
complete-word.shortcut=
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   244
console.dock-position=floating
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   245
console.encoding=UTF-8
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   246
console.font=Isabelle DejaVu Sans Mono
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   247
console.fontsize=14
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   248
delete-line.shortcut=A+d
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   249
delete.shortcut2=C+d
73983
e2913fc81142 more systematic treatment of encodings;
wenzelm
parents: 73982
diff changeset
   250
""" + drop_encodings.map(a => "encoding.opt-out." + a + "=true").mkString("\n") + """
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   251
encodingDetectors=BOM XML-PI buffer-local-property
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   252
end.shortcut=
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   253
expand-abbrev.shortcut2=CA+SPACE
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   254
expand-folds.shortcut=
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   255
fallbackEncodings=UTF-8 ISO-8859-15 US-ASCII
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   256
firstTime=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   257
focus-buffer-switcher.shortcut2=A+CIRCUMFLEX
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   258
foldPainter=Circle
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   259
gatchan.highlight.overview=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   260
helpviewer.font=Isabelle DejaVu Serif
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   261
helpviewer.fontsize=12
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   262
home.shortcut=
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   263
hypersearch-results.dock-position=right
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   264
insert-newline-indent.shortcut=
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   265
insert-newline.shortcut=
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   266
isabelle-debugger.dock-position=floating
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   267
isabelle-documentation.dock-position=left
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   268
isabelle-export-browser.label=Browse theory exports
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   269
isabelle-output.dock-position=bottom
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   270
isabelle-output.height=174
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   271
isabelle-output.width=412
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   272
isabelle-query.dock-position=bottom
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   273
isabelle-session-browser.label=Browse session information
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   274
isabelle-simplifier-trace.dock-position=floating
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   275
isabelle-sledgehammer.dock-position=bottom
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   276
isabelle-state.dock-position=right
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   277
isabelle-symbols.dock-position=bottom
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   278
isabelle-theories.dock-position=right
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   279
isabelle.antiquoted_cartouche.label=Make antiquoted cartouche
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   280
isabelle.complete-word.label=Complete word
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   281
isabelle.complete.label=Complete Isabelle text
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   282
isabelle.complete.shortcut2=C+b
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   283
isabelle.control-bold.label=Control bold
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   284
isabelle.control-bold.shortcut=C+e RIGHT
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   285
isabelle.control-emph.label=Control emphasized
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   286
isabelle.control-emph.shortcut=C+e LEFT
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   287
isabelle.control-reset.label=Control reset
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   288
isabelle.control-reset.shortcut=C+e BACK_SPACE
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   289
isabelle.control-sub.label=Control subscript
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   290
isabelle.control-sub.shortcut=C+e DOWN
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   291
isabelle.control-sup.label=Control superscript
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   292
isabelle.control-sup.shortcut=C+e UP
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   293
isabelle.decrease-font-size.label=Decrease font size
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   294
isabelle.decrease-font-size.shortcut2=C+SUBTRACT
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   295
isabelle.decrease-font-size.shortcut=C+MINUS
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   296
isabelle.decrease-font-size2.label=Decrease font size (clone)
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   297
isabelle.draft.label=Show draft in browser
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   298
isabelle.exclude-word-permanently.label=Exclude word permanently
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   299
isabelle.exclude-word.label=Exclude word
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   300
isabelle.first-error.label=Go to first error
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   301
isabelle.first-error.shortcut=CS+a
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   302
isabelle.goto-entity.label=Go to definition of formal entity at caret
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   303
isabelle.goto-entity.shortcut=CS+d
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   304
isabelle.include-word-permanently.label=Include word permanently
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   305
isabelle.include-word.label=Include word
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   306
isabelle.increase-font-size.label=Increase font size
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   307
isabelle.increase-font-size.shortcut2=C+ADD
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   308
isabelle.increase-font-size.shortcut=C+PLUS
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   309
isabelle.increase-font-size2.label=Increase font size (clone)
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   310
isabelle.increase-font-size2.shortcut=C+EQUALS
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   311
isabelle.java-monitor.label=Java/VM monitor
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   312
isabelle.last-error.label=Go to last error
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   313
isabelle.last-error.shortcut=CS+z
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   314
isabelle.message.label=Show message
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   315
isabelle.message.shortcut=CS+m
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   316
isabelle.newline.label=Newline with indentation of Isabelle keywords
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   317
isabelle.newline.shortcut=ENTER
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   318
isabelle.next-error.label=Go to next error
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   319
isabelle.next-error.shortcut=CS+n
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   320
isabelle.options.label=Isabelle options
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   321
isabelle.prev-error.label=Go to previous error
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   322
isabelle.prev-error.shortcut=CS+p
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   323
isabelle.preview.label=Show preview in browser
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   324
isabelle.reset-continuous-checking.label=Reset continuous checking
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   325
isabelle.reset-font-size.label=Reset font size
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   326
isabelle.reset-node-required.label=Reset node required
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   327
isabelle.reset-words.label=Reset non-permanent words
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   328
isabelle.select-entity.label=Select all occurences of formal entity at caret
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   329
isabelle.select-entity.shortcut=CS+ENTER
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   330
isabelle.set-continuous-checking.label=Set continuous checking
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   331
isabelle.set-node-required.label=Set node required
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   332
isabelle.toggle-breakpoint.label=Toggle Breakpoint
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   333
isabelle.toggle-continuous-checking.label=Toggle continuous checking
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   334
isabelle.toggle-continuous-checking.shortcut=C+e ENTER
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   335
isabelle.toggle-node-required.label=Toggle node required
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   336
isabelle.toggle-node-required.shortcut=C+e SPACE
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   337
isabelle.tooltip.label=Show tooltip
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   338
isabelle.tooltip.shortcut=CS+b
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   339
isabelle.update-state.label=Update state output
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   340
isabelle.update-state.shortcut=S+ENTER
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   341
lang.usedefaultlocale=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   342
largefilemode=full
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   343
line-end.shortcut=END
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   344
line-home.shortcut=HOME
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   345
logo.icon.medium=32x32/apps/isabelle.gif
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   346
lookAndFeel=com.formdev.flatlaf.FlatLightLaf
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   347
match-bracket.shortcut2=C+9
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   348
metal.primary.font=Isabelle DejaVu Sans
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   349
metal.primary.fontsize=12
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   350
metal.secondary.font=Isabelle DejaVu Sans
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   351
metal.secondary.fontsize=12
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   352
navigator.showOnToolbar=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   353
new-file-in-mode.shortcut=
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   354
next-bracket.shortcut2=C+e C+9
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   355
options.shortcuts.deletekeymap.label=Delete
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   356
options.shortcuts.duplicatekeymap.dialog.title=Keymap name
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   357
options.shortcuts.duplicatekeymap.label=Duplicate
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   358
options.shortcuts.resetkeymap.dialog.title=Reset keymap
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   359
options.shortcuts.resetkeymap.label=Reset
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   360
options.textarea.lineSpacing=1
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   361
plugin-blacklist.MacOSX.jar=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   362
plugin.MacOSXPlugin.altDispatcher=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   363
plugin.MacOSXPlugin.disableOption=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   364
prev-bracket.shortcut2=C+e C+8
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   365
print.font=Isabelle DejaVu Sans Mono
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   366
print.glyphVector=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   367
recent-buffer.shortcut2=C+CIRCUMFLEX
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   368
restore.remote=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   369
restore=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   370
search.subdirs.toggle=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   371
select-block.shortcut2=C+8
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   372
sidekick-tree.dock-position=right
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   373
sidekick.auto-complete-popup-get-focus=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   374
sidekick.buffer-save-parse=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   375
sidekick.complete-delay=0
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   376
sidekick.complete-instant.toggle=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   377
sidekick.complete-popup.accept-characters=\\t
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   378
sidekick.complete-popup.insert-characters=
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   379
sidekick.persistentFilter=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   380
sidekick.showFilter=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   381
sidekick.splitter.location=721
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   382
systrayicon=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   383
tip.show=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   384
toggle-full-screen.shortcut2=S+F11
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   385
toggle-multi-select.shortcut2=C+NUMBER_SIGN
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   386
toggle-rect-select.shortcut2=A+NUMBER_SIGN
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   387
twoStageSave=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   388
vfs.browser.dock-position=left
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   389
vfs.favorite.0.type=1
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   390
vfs.favorite.0=$ISABELLE_HOME
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   391
vfs.favorite.1.type=1
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   392
vfs.favorite.1=$ISABELLE_HOME_USER
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   393
vfs.favorite.2.type=1
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   394
vfs.favorite.2=$JEDIT_HOME
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   395
vfs.favorite.3.type=1
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   396
vfs.favorite.3=$JEDIT_SETTINGS
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   397
vfs.favorite.4.type=1
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   398
vfs.favorite.4=isabelle-export:
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   399
vfs.favorite.5.type=1
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   400
vfs.favorite.5=isabelle-session:
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   401
view.antiAlias=subpixel HRGB
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   402
view.blockCaret=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   403
view.caretBlink=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   404
view.docking.framework=PIDE
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   405
view.eolMarkers=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   406
view.extendedState=0
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   407
view.font=Isabelle DejaVu Sans Mono
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   408
view.fontsize=18
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   409
view.fracFontMetrics=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   410
view.gutter.font=Isabelle DejaVu Sans Mono
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   411
view.gutter.fontsize=12
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   412
view.gutter.lineNumbers=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   413
view.gutter.selectionAreaWidth=18
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   414
view.height=850
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   415
view.middleMousePaste=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   416
view.showToolbar=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   417
view.status.memory.background=#666699
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   418
view.status=( mode , fold , encoding ) locked wrap multiSelect rectSelect overwrite lineSep buffersets task-monitor java-status ml-status errors clock
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   419
view.thickCaret=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   420
view.width=1200
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   421
xml-insert-closing-tag.shortcut=
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   422
""")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   423
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   424
    val modes_dir = jedit_patched_dir + Path.basic("modes")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   425
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   426
    Mode.list.foreach(_.write(modes_dir))
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   427
75202
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   428
    File.change_lines(modes_dir + Path.basic("catalog")) { _.flatMap(line =>
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   429
      if (line.containsSlice("FILE=\"ml.xml\"") ||
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   430
        line.containsSlice("FILE_NAME_GLOB=\"*.{sml,ml}\"") ||
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   431
        line.containsSlice("FILE_NAME_GLOB=\"*.ftl\"")) Nil
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   432
      else if (line.containsSlice("NAME=\"jamon\"")) {
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   433
        List(
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   434
          """<MODE NAME="isabelle" FILE="isabelle.xml" FILE_NAME_GLOB="{*.thy,ROOT0.ML,ROOT.ML}"/>""",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   435
          "",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   436
          """<MODE NAME="isabelle-ml" FILE="isabelle-ml.xml" FILE_NAME_GLOB="*.ML"/>""",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   437
          "",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   438
          """<MODE NAME="isabelle-news" FILE="isabelle-news.xml"/>""",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   439
          "",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   440
          """<MODE NAME="isabelle-options" FILE="isabelle-options.xml"/>""",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   441
          "",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   442
          """<MODE NAME="isabelle-root" FILE="isabelle-root.xml" FILE_NAME_GLOB="ROOT"/>""",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   443
          "",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   444
          line)
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   445
      }
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   446
      else if (line.containsSlice("NAME=\"sqr\"")) {
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   447
        List(
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   448
          """<MODE NAME="sml" FILE="sml.xml" FILE_NAME_GLOB="*.{sml,sig}"/>""",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   449
          "",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   450
          line)
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   451
      }
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   452
      else List(line))
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   453
    }
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   454
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   455
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   456
    /* doc */
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   457
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   458
    val doc_dir = jedit_patched_dir + Path.basic("doc")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   459
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   460
    download_jedit(doc_dir, "manual-a4.pdf", target_name = "jedit-manual.pdf")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   461
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   462
    Isabelle_System.copy_file(
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   463
      doc_dir + Path.basic("CHANGES.txt"), doc_dir + Path.basic("jedit-changes"))
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   464
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   465
    File.write(doc_dir + Path.basic("Contents"),
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   466
"""Original jEdit Documentation
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   467
  jedit-manual    jEdit User's Guide
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   468
  jedit-changes   jEdit Version History
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   469
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   470
""")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   471
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   472
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   473
    /* diff */
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   474
75220
1cbdf9cfc94b clarified signature;
wenzelm
parents: 75202
diff changeset
   475
    Isabelle_System.make_patch(component_dir, Path.basic(jedit), Path.basic(jedit_patched))
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   476
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   477
    if (!original) Isabelle_System.rm_tree(jedit_dir)
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   478
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   479
74030
39e05601faeb more accurate scala_project, based on build.props of components;
wenzelm
parents: 73987
diff changeset
   480
    /* settings */
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   481
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   482
    File.write(etc_dir + Path.explode("settings"),
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   483
      """# -*- shell-script -*- :mode=shellscript:
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   484
73987
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   485
JEDIT_HOME="$COMPONENT/""" + jedit_patched + """"
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   486
JEDIT_JARS=""" + quote(File.read_dir(jars_dir).map("$JEDIT_HOME/jars/" + _).mkString(":")) + """
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   487
JEDIT_JAR="$JEDIT_HOME/jedit.jar"
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   488
classpath "$JEDIT_JAR"
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   489
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   490
JEDIT_SETTINGS="$ISABELLE_HOME_USER/jedit"
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   491
JEDIT_OPTIONS="-reuseview -nobackground -nosplash -log=9"
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   492
JEDIT_JAVA_OPTIONS="-Xms512m -Xmx4g -Xss16m"
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   493
JEDIT_JAVA_SYSTEM_OPTIONS="-Duser.language=en -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dapple.laf.useScreenMenuBar=true -Dapple.awt.application.name=Isabelle"
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   494
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   495
ISABELLE_DOCS="$ISABELLE_DOCS:$JEDIT_HOME/doc"
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   496
""")
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   497
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   498
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   499
    /* README */
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   500
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   501
    File.write(component_dir + Path.basic("README"),
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   502
"""This is a slightly patched version of jEdit """ + version + """ from
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   503
https://sourceforge.net/projects/jedit/files/jedit with some
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   504
additional plugins jars from
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   505
https://sourceforge.net/projects/jedit-plugins/files
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   506
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   507
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   508
        Makarius
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   509
        """ + Date.Format.date(Date.now()) + "\n")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   510
  }
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   511
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   512
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   513
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   514
  /** Isabelle tool wrappers **/
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   515
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   516
  val default_version = "5.6.0"
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   517
  def default_java_home: Path = Path.explode("$JAVA_HOME").expand
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   518
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   519
  val isabelle_tool =
73987
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   520
    Isabelle_Tool("build_jedit", "build Isabelle component from the jEdit text-editor",
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   521
      Scala_Project.here, args =>
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   522
    {
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   523
      var target_dir = Path.current
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   524
      var java_home = default_java_home
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   525
      var original = false
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   526
      var version = default_version
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   527
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   528
      val getopts = Getopts("""
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   529
Usage: isabelle build_jedit [OPTIONS]
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   530
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   531
  Options are:
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   532
    -D DIR       target directory (default ".")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   533
    -J JAVA_HOME Java version for building jedit.jar (e.g. version 11)
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   534
    -O           retain copy of original jEdit directory
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   535
    -V VERSION   jEdit version (default: """ + quote(default_version) + """)
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   536
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   537
  Build auxiliary jEdit component from original sources, with some patches.
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   538
""",
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   539
        "D:" -> (arg => target_dir = Path.explode(arg)),
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   540
        "J:" -> (arg => java_home = Path.explode(arg)),
73982
wenzelm
parents: 73947
diff changeset
   541
        "O" -> (_ => original = true),
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   542
        "V:" -> (arg => version = arg))
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   543
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   544
      val more_args = getopts(args)
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   545
      if (more_args.nonEmpty) getopts.usage()
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   546
73987
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   547
      val component_dir = target_dir + Path.basic("jedit-" + Date.Format.alt_date(Date.now()))
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   548
      val progress = new Console_Progress()
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   549
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   550
      build_jedit(component_dir, version, original = original,
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   551
        java_home = java_home, progress = progress)
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   552
    })
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   553
}