src/Tools/jEdit/lib/Tools/jedit
author wenzelm
Thu Nov 02 10:16:22 2017 +0100 (17 months ago)
changeset 66987 352b23c97ac8
parent 66977 fa79f18eadc7
child 66988 7f8c1dd7576a
permissions -rwxr-xr-x
support focus_session, for much faster startup of Isabelle/jEdit;
more options for "isabelle jedit";
wenzelm@34333
     1
#!/usr/bin/env bash
wenzelm@34333
     2
#
wenzelm@34664
     3
# Author: Makarius
wenzelm@34664
     4
#
wenzelm@34664
     5
# DESCRIPTION: Isabelle/jEdit interface wrapper
wenzelm@34664
     6
wenzelm@34333
     7
wenzelm@43285
     8
## sources
wenzelm@43285
     9
wenzelm@66457
    10
declare -a SOURCES_BASE=(
wenzelm@66591
    11
  "src-base/dockable.scala"
wenzelm@66457
    12
  "src-base/isabelle_encoding.scala"
wenzelm@66591
    13
  "src-base/jedit_lib.scala"
wenzelm@66591
    14
  "src-base/pide_docking_framework.scala"
wenzelm@66457
    15
  "src-base/plugin.scala"
wenzelm@66555
    16
  "src-base/syntax_style.scala"
wenzelm@66457
    17
)
wenzelm@66457
    18
wenzelm@66457
    19
declare -a RESOURCES_BASE=(
wenzelm@66457
    20
  "src-base/Isabelle_Base.props"
wenzelm@66457
    21
  "src-base/services.xml"
wenzelm@66457
    22
)
wenzelm@66457
    23
wenzelm@43320
    24
declare -a SOURCES=(
wenzelm@50450
    25
  "src/active.scala"
wenzelm@53023
    26
  "src/completion_popup.scala"
wenzelm@56585
    27
  "src/context_menu.scala"
wenzelm@60749
    28
  "src/debugger_dockable.scala"
wenzelm@43285
    29
  "src/document_model.scala"
wenzelm@43285
    30
  "src/document_view.scala"
wenzelm@52445
    31
  "src/documentation_dockable.scala"
wenzelm@50542
    32
  "src/fold_handling.scala"
wenzelm@55825
    33
  "src/font_info.scala"
wenzelm@49570
    34
  "src/graphview_dockable.scala"
wenzelm@49726
    35
  "src/info_dockable.scala"
wenzelm@50208
    36
  "src/isabelle.scala"
wenzelm@43285
    37
  "src/isabelle_encoding.scala"
wenzelm@43285
    38
  "src/isabelle_options.scala"
wenzelm@43285
    39
  "src/isabelle_sidekick.scala"
wenzelm@66120
    40
  "src/jedit_bibtex.scala"
wenzelm@52971
    41
  "src/jedit_editor.scala"
wenzelm@49406
    42
  "src/jedit_lib.scala"
wenzelm@50202
    43
  "src/jedit_options.scala"
wenzelm@64621
    44
  "src/jedit_rendering.scala"
wenzelm@56208
    45
  "src/jedit_resources.scala"
wenzelm@62973
    46
  "src/jedit_sessions.scala"
wenzelm@65139
    47
  "src/jedit_spell_checker.scala"
wenzelm@63734
    48
  "src/keymap_merge.scala"
wenzelm@50433
    49
  "src/monitor_dockable.scala"
wenzelm@43285
    50
  "src/output_dockable.scala"
wenzelm@43285
    51
  "src/plugin.scala"
wenzelm@49398
    52
  "src/pretty_text_area.scala"
wenzelm@49702
    53
  "src/pretty_tooltip.scala"
wenzelm@52934
    54
  "src/process_indicator.scala"
wenzelm@43285
    55
  "src/protocol_dockable.scala"
wenzelm@56879
    56
  "src/query_dockable.scala"
wenzelm@43285
    57
  "src/raw_output_dockable.scala"
wenzelm@49411
    58
  "src/rich_text_area.scala"
wenzelm@43285
    59
  "src/scala_console.scala"
wenzelm@61288
    60
  "src/session_build.scala"
lars@55316
    61
  "src/simplifier_trace_dockable.scala"
lars@55316
    62
  "src/simplifier_trace_window.scala"
wenzelm@58529
    63
  "src/sledgehammer_dockable.scala"
wenzelm@61208
    64
  "src/state_dockable.scala"
immler@50143
    65
  "src/symbols_dockable.scala"
wenzelm@65258
    66
  "src/syntax_style.scala"
wenzelm@48021
    67
  "src/syslog_dockable.scala"
wenzelm@46572
    68
  "src/text_overview.scala"
wenzelm@63422
    69
  "src/text_structure.scala"
wenzelm@50299
    70
  "src/theories_dockable.scala"
wenzelm@51533
    71
  "src/timing_dockable.scala"
wenzelm@43414
    72
  "src/token_markup.scala"
wenzelm@43285
    73
)
wenzelm@43285
    74
wenzelm@43320
    75
declare -a RESOURCES=(
wenzelm@43286
    76
  "src/actions.xml"
wenzelm@43286
    77
  "src/dockables.xml"
wenzelm@43286
    78
  "src/Isabelle.props"
wenzelm@50306
    79
  "src/jEdit.props"
wenzelm@43286
    80
  "src/services.xml"
wenzelm@55500
    81
  "src/modes/isabelle-ml.xml"
wenzelm@52540
    82
  "src/modes/isabelle-news.xml"
wenzelm@52540
    83
  "src/modes/isabelle-options.xml"
wenzelm@52540
    84
  "src/modes/isabelle-root.xml"
wenzelm@52540
    85
  "src/modes/isabelle.xml"
wenzelm@56277
    86
  "src/modes/sml.xml"
wenzelm@43285
    87
)
wenzelm@43285
    88
wenzelm@43285
    89
wenzelm@34333
    90
## diagnostics
wenzelm@34333
    91
wenzelm@34664
    92
PRG="$(basename "$0")"
wenzelm@34664
    93
wenzelm@43284
    94
function usage()
wenzelm@34333
    95
{
wenzelm@34333
    96
  echo
wenzelm@34664
    97
  echo "Usage: isabelle $PRG [OPTIONS] [FILES ...]"
wenzelm@34333
    98
  echo
wenzelm@34333
    99
  echo "  Options are:"
wenzelm@66977
   100
  echo "    -B           use base session image, with theories from other sessions"
wenzelm@66987
   101
  echo "    -F           focus on selected logic session: ignore unrelated theories"
wenzelm@62039
   102
  echo "    -D NAME=X    set JVM system property"
wenzelm@66683
   103
  echo "    -J OPTION    add JVM runtime option"
wenzelm@66683
   104
  echo "                 (default $JEDIT_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS)"
wenzelm@66973
   105
  echo "    -P           use parent session image"
wenzelm@66973
   106
  echo "    -R           open ROOT entry of logic session"
wenzelm@66987
   107
  echo "    -S NAME      edit specified logic session, same as abbreviates -B -F -R -l NAME"
wenzelm@43285
   108
  echo "    -b           build only"
wenzelm@48791
   109
  echo "    -d DIR       include session directory"
wenzelm@43285
   110
  echo "    -f           fresh build"
wenzelm@34333
   111
  echo "    -j OPTION    add jEdit runtime option"
wenzelm@66683
   112
  echo "                 (default $JEDIT_OPTIONS)"
wenzelm@50403
   113
  echo "    -l NAME      logic session name"
wenzelm@34333
   114
  echo "    -m MODE      add print mode for output"
wenzelm@57086
   115
  echo "    -n           no build of session image on startup"
wenzelm@63986
   116
  echo "    -p CMD       ML process command prefix (process policy)"
wenzelm@50373
   117
  echo "    -s           system build mode for session image"
wenzelm@34333
   118
  echo
wenzelm@61171
   119
  echo "  Start jEdit with Isabelle plugin setup and open FILES"
wenzelm@61512
   120
  echo "  (default \"$USER_HOME/Scratch.thy\" or \":\" for empty buffer)."
wenzelm@34333
   121
  echo
wenzelm@34333
   122
  exit 1
wenzelm@34333
   123
}
wenzelm@34333
   124
wenzelm@43284
   125
function fail()
wenzelm@34333
   126
{
wenzelm@34333
   127
  echo "$1" >&2
wenzelm@34333
   128
  exit 2
wenzelm@34333
   129
}
wenzelm@34333
   130
wenzelm@43284
   131
function failed()
wenzelm@43284
   132
{
wenzelm@43284
   133
  fail "Failed!"
wenzelm@43284
   134
}
wenzelm@43284
   135
wenzelm@34333
   136
wenzelm@34333
   137
## process command line
wenzelm@34333
   138
wenzelm@34333
   139
# options
wenzelm@34333
   140
wenzelm@43285
   141
BUILD_ONLY=false
wenzelm@43285
   142
BUILD_JARS="jars"
wenzelm@63986
   143
ML_PROCESS_POLICY=""
wenzelm@66973
   144
JEDIT_LOGIC_BASE=""
wenzelm@66987
   145
JEDIT_LOGIC_FOCUS=""
wenzelm@48791
   146
JEDIT_SESSION_DIRS=""
wenzelm@66574
   147
JEDIT_LOGIC_ROOT=""
wenzelm@66973
   148
JEDIT_LOGIC_PARENT=""
wenzelm@50403
   149
JEDIT_LOGIC=""
wenzelm@34333
   150
JEDIT_PRINT_MODE=""
wenzelm@53449
   151
JEDIT_BUILD_MODE="normal"
wenzelm@34333
   152
wenzelm@43284
   153
function getoptions()
wenzelm@34780
   154
{
wenzelm@34780
   155
  OPTIND=1
wenzelm@66987
   156
  while getopts "BFD:J:PRS:bd:fj:l:m:np:s" OPT
wenzelm@34780
   157
  do
wenzelm@34780
   158
    case "$OPT" in
wenzelm@66973
   159
      B)
wenzelm@66973
   160
        JEDIT_LOGIC_BASE="true"
wenzelm@66973
   161
        JEDIT_LOGIC_PARENT=""
wenzelm@66973
   162
        ;;
wenzelm@62039
   163
      D)
wenzelm@62039
   164
        JAVA_ARGS["${#JAVA_ARGS[@]}"]="-D$OPTARG"
wenzelm@62039
   165
        ;;
wenzelm@66987
   166
      F)
wenzelm@66987
   167
        JEDIT_LOGIC_FOCUS="true"
wenzelm@66987
   168
        ;;
wenzelm@34780
   169
      J)
wenzelm@34780
   170
        JAVA_ARGS["${#JAVA_ARGS[@]}"]="$OPTARG"
wenzelm@34780
   171
        ;;
wenzelm@66973
   172
      P)
wenzelm@66973
   173
        JEDIT_LOGIC_PARENT="true"
wenzelm@66973
   174
        JEDIT_LOGIC_BASE=""
wenzelm@66973
   175
        ;;
wenzelm@64602
   176
      R)
wenzelm@66574
   177
        JEDIT_LOGIC_ROOT="true"
wenzelm@64602
   178
        ;;
wenzelm@66987
   179
      S)
wenzelm@66987
   180
        JEDIT_LOGIC="$OPTARG"
wenzelm@66987
   181
        JEDIT_LOGIC_BASE="true"
wenzelm@66987
   182
        JEDIT_LOGIC_PARENT=""
wenzelm@66987
   183
        JEDIT_LOGIC_FOCUS="true"
wenzelm@66987
   184
        JEDIT_LOGIC_ROOT="true"
wenzelm@66987
   185
        ;;
wenzelm@43285
   186
      b)
wenzelm@43285
   187
        BUILD_ONLY=true
wenzelm@43285
   188
        ;;
wenzelm@48791
   189
      d)
wenzelm@48791
   190
        if [ -z "$JEDIT_SESSION_DIRS" ]; then
wenzelm@48791
   191
          JEDIT_SESSION_DIRS="$OPTARG"
wenzelm@48791
   192
        else
wenzelm@48791
   193
          JEDIT_SESSION_DIRS="$JEDIT_SESSION_DIRS:$OPTARG"
wenzelm@48791
   194
        fi
wenzelm@48791
   195
        ;;
wenzelm@43285
   196
      f)
wenzelm@43285
   197
        BUILD_JARS="jars_fresh"
wenzelm@43285
   198
        ;;
wenzelm@34780
   199
      j)
wenzelm@34780
   200
        ARGS["${#ARGS[@]}"]="$OPTARG"
wenzelm@34780
   201
        ;;
wenzelm@34780
   202
      l)
wenzelm@34780
   203
        JEDIT_LOGIC="$OPTARG"
wenzelm@34780
   204
        ;;
wenzelm@34780
   205
      m)
wenzelm@34780
   206
        if [ -z "$JEDIT_PRINT_MODE" ]; then
wenzelm@34780
   207
          JEDIT_PRINT_MODE="$OPTARG"
wenzelm@34780
   208
        else
wenzelm@34780
   209
          JEDIT_PRINT_MODE="$JEDIT_PRINT_MODE,$OPTARG"
wenzelm@34780
   210
        fi
wenzelm@34780
   211
        ;;
wenzelm@50405
   212
      n)
wenzelm@53449
   213
        JEDIT_BUILD_MODE="none"
wenzelm@50405
   214
        ;;
wenzelm@63986
   215
      p)
wenzelm@63986
   216
        ML_PROCESS_POLICY="$OPTARG"
wenzelm@63986
   217
        ;;
wenzelm@50373
   218
      s)
wenzelm@53449
   219
        JEDIT_BUILD_MODE="system"
wenzelm@50373
   220
        ;;
wenzelm@34780
   221
      \?)
wenzelm@34780
   222
        usage
wenzelm@34780
   223
        ;;
wenzelm@34780
   224
    esac
wenzelm@34780
   225
  done
wenzelm@34780
   226
}
wenzelm@34581
   227
wenzelm@66906
   228
eval "declare -a JAVA_ARGS=($JEDIT_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS)"
wenzelm@34843
   229
wenzelm@53446
   230
declare -a ARGS=()
wenzelm@34333
   231
wenzelm@34780
   232
declare -a OPTIONS; eval "OPTIONS=($ISABELLE_JEDIT_OPTIONS)"
wenzelm@34780
   233
getoptions "${OPTIONS[@]}"
wenzelm@34780
   234
wenzelm@34780
   235
getoptions "$@"
wenzelm@34333
   236
shift $(($OPTIND - 1))
wenzelm@34333
   237
wenzelm@34333
   238
wenzelm@34333
   239
# args
wenzelm@34333
   240
wenzelm@61512
   241
while [ "$#" -gt 0 ]; do
wenzelm@61512
   242
  ARGS["${#ARGS[@]}"]="$(platform_path "$1")"
wenzelm@61512
   243
  shift
wenzelm@61512
   244
done
wenzelm@34333
   245
wenzelm@34333
   246
wenzelm@43284
   247
## dependencies
wenzelm@43284
   248
wenzelm@49953
   249
if [ -e "$ISABELLE_HOME/Admin/build" ]; then
wenzelm@62589
   250
  isabelle browser -b || exit $?
wenzelm@57032
   251
  "$ISABELLE_HOME/Admin/build" "$BUILD_JARS" || exit $?
wenzelm@49953
   252
fi
wenzelm@43413
   253
wenzelm@53577
   254
PURE_JAR="$ISABELLE_HOME/lib/classes/Pure.jar"
wenzelm@43413
   255
wenzelm@43285
   256
pushd "$JEDIT_HOME" >/dev/null || failed
wenzelm@43284
   257
wenzelm@43284
   258
JEDIT_JAR="$ISABELLE_JEDIT_BUILD_HOME/contrib/$ISABELLE_JEDIT_BUILD_VERSION/jedit.jar"
wenzelm@43284
   259
wenzelm@43284
   260
JEDIT_JARS=(
wenzelm@56421
   261
  "$ISABELLE_JEDIT_BUILD_HOME/contrib/Code2HTML.jar"
wenzelm@56421
   262
  "$ISABELLE_JEDIT_BUILD_HOME/contrib/CommonControls.jar"
wenzelm@53445
   263
  "$ISABELLE_JEDIT_BUILD_HOME/contrib/Console.jar"
wenzelm@53445
   264
  "$ISABELLE_JEDIT_BUILD_HOME/contrib/ErrorList.jar"
wenzelm@53445
   265
  "$ISABELLE_JEDIT_BUILD_HOME/contrib/Highlight.jar"
wenzelm@56421
   266
  "$ISABELLE_JEDIT_BUILD_HOME/contrib/kappalayout.jar"
wenzelm@53883
   267
  "$ISABELLE_JEDIT_BUILD_HOME/contrib/MacOSX.jar"
wenzelm@56421
   268
  "$ISABELLE_JEDIT_BUILD_HOME/contrib/Navigator.jar"
wenzelm@53445
   269
  "$ISABELLE_JEDIT_BUILD_HOME/contrib/SideKick.jar"
wenzelm@53445
   270
  "$ISABELLE_JEDIT_BUILD_HOME/contrib/idea-icons.jar"
wenzelm@53445
   271
  "$ISABELLE_JEDIT_BUILD_HOME/contrib/jsr305-2.0.0.jar"
wenzelm@43284
   272
)
wenzelm@43284
   273
wenzelm@43284
   274
wenzelm@43284
   275
# target
wenzelm@43284
   276
wenzelm@66457
   277
TARGET_BASE="dist/jars/Isabelle-jEdit-base.jar"
wenzelm@43284
   278
TARGET="dist/jars/Isabelle-jEdit.jar"
wenzelm@43284
   279
wenzelm@43384
   280
declare -a UPDATED=()
wenzelm@43384
   281
wenzelm@43285
   282
if [ "$BUILD_JARS" = jars_fresh ]; then
wenzelm@43285
   283
  OUTDATED=true
wenzelm@43285
   284
else
wenzelm@43285
   285
  OUTDATED=false
wenzelm@66457
   286
  if [ ! -e "$TARGET_BASE" -a ! -e "$TARGET" ]; then
wenzelm@43368
   287
    OUTDATED=true
wenzelm@43384
   288
  else
wenzelm@43384
   289
    if [ -n "$ISABELLE_JEDIT_BUILD_HOME" ]; then
wenzelm@49566
   290
      declare -a DEPS=(
wenzelm@57032
   291
        "$JEDIT_JAR" "${JEDIT_JARS[@]}" "$PURE_JAR"
wenzelm@66457
   292
        "${SOURCES_BASE[@]}" "${RESOURCES_BASE[@]}"
wenzelm@53576
   293
        "${SOURCES[@]}" "${RESOURCES[@]}"
wenzelm@49566
   294
      )
wenzelm@47666
   295
    elif [ -e "$ISABELLE_HOME/Admin/build" ]; then
wenzelm@66457
   296
      declare -a DEPS=(
wenzelm@66457
   297
        "$PURE_JAR"
wenzelm@66457
   298
        "${SOURCES_BASE[@]}" "${RESOURCES_BASE[@]}"
wenzelm@66457
   299
        "${SOURCES[@]}" "${RESOURCES[@]}"
wenzelm@66457
   300
      )
wenzelm@43384
   301
    else
wenzelm@47666
   302
      declare -a DEPS=()
wenzelm@43384
   303
    fi
wenzelm@43384
   304
    for DEP in "${DEPS[@]}"
wenzelm@43368
   305
    do
wenzelm@43384
   306
      [ ! -e "$DEP" ] && fail "Missing file: $DEP"
wenzelm@66457
   307
      [ "$DEP" -nt "$TARGET_BASE" -o "$DEP" -nt "$TARGET" ] && {
wenzelm@43384
   308
        OUTDATED=true
wenzelm@43384
   309
        UPDATED["${#UPDATED[@]}"]="$DEP"
wenzelm@43384
   310
      }
wenzelm@43368
   311
    done
wenzelm@43368
   312
  fi
wenzelm@43285
   313
fi
wenzelm@43284
   314
wenzelm@43284
   315
wenzelm@43284
   316
# build
wenzelm@43284
   317
wenzelm@66457
   318
function init_resources ()
wenzelm@66457
   319
{
wenzelm@66457
   320
  mkdir -p dist/classes || failed
wenzelm@66457
   321
  cp -p -R -f "$@" dist/classes/.
wenzelm@66457
   322
}
wenzelm@66457
   323
wenzelm@66457
   324
function compile_sources ()
wenzelm@66457
   325
{
wenzelm@66457
   326
  (
wenzelm@66457
   327
    #FIXME workarounds for scalac 2.11.0
wenzelm@66457
   328
    export CYGWIN="nodosfilewarning"
wenzelm@66457
   329
    function stty() { :; }
wenzelm@66457
   330
    export -f stty
wenzelm@66457
   331
wenzelm@66457
   332
    for JAR in "$JEDIT_JAR" "${JEDIT_JARS[@]}" "$PURE_JAR"
wenzelm@66457
   333
    do
wenzelm@66457
   334
      classpath "$JAR"
wenzelm@66457
   335
    done
wenzelm@66457
   336
    export CLASSPATH="$(platform_path "$ISABELLE_CLASSPATH")"
wenzelm@66457
   337
    isabelle_scala scalac $ISABELLE_SCALAC_OPTIONS -d dist/classes "$@"
wenzelm@66457
   338
  ) || fail "Failed to compile sources"
wenzelm@66457
   339
}
wenzelm@66457
   340
wenzelm@66457
   341
function make_jar ()
wenzelm@66457
   342
{
wenzelm@66457
   343
  cd dist/classes
wenzelm@66457
   344
  isabelle_jdk jar cf "../../$1" * || failed
wenzelm@66457
   345
  cd ../..
wenzelm@66457
   346
  rm -rf dist/classes
wenzelm@66457
   347
}
wenzelm@66457
   348
wenzelm@43284
   349
if [ "$OUTDATED" = true ]
wenzelm@43284
   350
then
wenzelm@43405
   351
  echo "### Building Isabelle/jEdit ..."
wenzelm@43405
   352
wenzelm@43384
   353
  [ "${#UPDATED[@]}" -gt 0 ] && {
wenzelm@43405
   354
    echo "Changed files:"
wenzelm@43384
   355
    for FILE in "${UPDATED[@]}"
wenzelm@43384
   356
    do
wenzelm@43384
   357
      echo "  $FILE"
wenzelm@43384
   358
    done
wenzelm@43384
   359
  }
wenzelm@43384
   360
wenzelm@43284
   361
  [ -z "$ISABELLE_JEDIT_BUILD_HOME" ] && \
wenzelm@43284
   362
    fail "Unknown ISABELLE_JEDIT_BUILD_HOME -- missing auxiliary component"
wenzelm@43284
   363
wenzelm@43284
   364
  rm -rf dist || failed
wenzelm@66457
   365
  mkdir -p dist || failed
wenzelm@43287
   366
wenzelm@46502
   367
  cp -p -R -f "$ISABELLE_JEDIT_BUILD_HOME/contrib/$ISABELLE_JEDIT_BUILD_VERSION/." dist/.
wenzelm@66457
   368
wenzelm@66457
   369
  init_resources "${RESOURCES_BASE[@]}"
wenzelm@66457
   370
  compile_sources "${SOURCES_BASE[@]}"
wenzelm@66457
   371
  make_jar "$TARGET_BASE"
wenzelm@66590
   372
  classpath "$PWD/$TARGET_BASE"
wenzelm@66457
   373
wenzelm@66457
   374
  init_resources "${RESOURCES[@]}"
wenzelm@43287
   375
  cp src/jEdit.props dist/properties/.
wenzelm@46502
   376
  cp -p -R -f src/modes/. dist/modes/.
wenzelm@43284
   377
wenzelm@43391
   378
  perl -i -e 'while (<>) {
wenzelm@61305
   379
    if (m/FILE="ml.xml"/ or m/FILE_NAME_GLOB="...sml,ml."/) { }
wenzelm@55500
   380
    elsif (m/NAME="javacc"/) {
wenzelm@62932
   381
      print qq!<MODE NAME="isabelle" FILE="isabelle.xml" FILE_NAME_GLOB="{*.thy,ROOT0.ML,ROOT.ML}"/>\n\n!;
wenzelm@62908
   382
      print qq!<MODE NAME="isabelle-ml" FILE="isabelle-ml.xml" FILE_NAME_GLOB="*.ML"/>\n\n!;
wenzelm@62908
   383
      print qq!<MODE NAME="isabelle-news" FILE="isabelle-news.xml"/>\n\n!;
wenzelm@62908
   384
      print qq!<MODE NAME="isabelle-options" FILE="isabelle-options.xml"/>\n\n!;
wenzelm@62908
   385
      print qq!<MODE NAME="isabelle-root" FILE="isabelle-root.xml" FILE_NAME_GLOB="ROOT"/>\n\n!;
wenzelm@55500
   386
      print;
wenzelm@55500
   387
    }
wenzelm@56277
   388
    elsif (m/NAME="sqr"/) {
wenzelm@56277
   389
      print qq!<MODE NAME="sml" FILE="sml.xml" FILE_NAME_GLOB="*.{sml,sig}"/>\n\n!;
wenzelm@56277
   390
      print;
wenzelm@56277
   391
    }
wenzelm@55500
   392
    else { print; }
wenzelm@55500
   393
  }' dist/modes/catalog
wenzelm@43284
   394
wenzelm@54660
   395
  cd dist
wenzelm@54660
   396
  isabelle_jdk jar xf jedit.jar
wenzelm@54676
   397
  cp "$ISABELLE_HOME/lib/logo/isabelle_transparent-32.gif" \
wenzelm@54660
   398
    "org/gjt/sp/jedit/icons/themes/classic/32x32/apps/isabelle.gif" || failed
wenzelm@54676
   399
  cp "$ISABELLE_HOME/lib/logo/isabelle_transparent-32.gif" \
wenzelm@54660
   400
    "org/gjt/sp/jedit/icons/themes/tango/32x32/apps/isabelle.gif" || failed
wenzelm@54666
   401
  isabelle_jdk jar cfe jedit.jar org.gjt.sp.jedit.jEdit org || failed
wenzelm@54667
   402
  rm -rf META-INF org
wenzelm@54660
   403
  cd ..
wenzelm@54660
   404
wenzelm@53445
   405
  cp -p -R -f "${JEDIT_JARS[@]}" dist/jars/. || failed
wenzelm@66457
   406
  compile_sources "${SOURCES[@]}"
wenzelm@66457
   407
  make_jar "$TARGET"
wenzelm@56422
   408
wenzelm@65329
   409
  cp "$ISABELLE_JEDIT_BUILD_HOME/doc/jedit5.4.0manual-a4.pdf" dist/doc/jedit-manual.pdf
wenzelm@56422
   410
  cp dist/doc/CHANGES.txt dist/doc/jedit-changes
wenzelm@56422
   411
  cat > dist/doc/Contents <<EOF
wenzelm@57338
   412
Original jEdit Documentation
wenzelm@65329
   413
  jedit-manual    jEdit 5.4 User's Guide
wenzelm@65329
   414
  jedit-changes   jEdit 5.4 Version History
wenzelm@56422
   415
wenzelm@56422
   416
EOF
wenzelm@56422
   417
wenzelm@43284
   418
fi
wenzelm@43284
   419
wenzelm@43284
   420
popd >/dev/null
wenzelm@43284
   421
wenzelm@43284
   422
wenzelm@43284
   423
## main
wenzelm@43284
   424
wenzelm@53576
   425
if [ "$BUILD_ONLY" = false ]
wenzelm@53576
   426
then
wenzelm@66987
   427
  export JEDIT_SESSION_DIRS JEDIT_LOGIC JEDIT_LOGIC_BASE JEDIT_LOGIC_FOCUS \
wenzelm@66987
   428
    JEDIT_LOGIC_PARENT JEDIT_LOGIC_ROOT JEDIT_PRINT_MODE JEDIT_BUILD_MODE
wenzelm@63986
   429
  export JEDIT_ML_PROCESS_POLICY="$ML_PROCESS_POLICY"
wenzelm@53576
   430
  classpath "$JEDIT_HOME/dist/jedit.jar"
wenzelm@63987
   431
  exec isabelle java "${JAVA_ARGS[@]}" isabelle.Main "${ARGS[@]}"
wenzelm@50416
   432
fi