src/Pure/build-jars
author wenzelm
Sat, 07 Sep 2013 11:36:03 +0200
changeset 53452 8181bc357dc4
parent 53279 763d35697338
child 53453 20ff79162ff3
permissions -rwxr-xr-x
more portable access to icon -- avoid Isabelle_System which is not yet initialized in bootstrap;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34282
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
     1
#!/usr/bin/env bash
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
     2
#
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
     3
# Author: Makarius
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
     4
#
42899
108e815fdc8e misc tuning and update;
wenzelm
parents: 42720
diff changeset
     5
# build-jars - build Isabelle/Scala
34282
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
     6
#
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
     7
# Requires proper Isabelle settings environment.
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
     8
43320
wenzelm
parents: 43285
diff changeset
     9
## sources
wenzelm
parents: 43285
diff changeset
    10
wenzelm
parents: 43285
diff changeset
    11
declare -a SOURCES=(
43660
bfc0bb115fa1 explicit class Counter;
wenzelm
parents: 43651
diff changeset
    12
  Concurrent/counter.scala
43320
wenzelm
parents: 43285
diff changeset
    13
  Concurrent/future.scala
wenzelm
parents: 43285
diff changeset
    14
  Concurrent/simple_thread.scala
wenzelm
parents: 43285
diff changeset
    15
  Concurrent/volatile.scala
wenzelm
parents: 43285
diff changeset
    16
  General/exn.scala
48411
5b3440850d36 more abstract file system operations in Scala, corresponding to ML version;
wenzelm
parents: 48410
diff changeset
    17
  General/file.scala
46611
669601fa1a62 directed graphs (in Scala);
wenzelm
parents: 45709
diff changeset
    18
  General/graph.scala
51098
22d5c010ef5c file system operations for Graphics2D output;
wenzelm
parents: 50981
diff changeset
    19
  General/graphics_file.scala
43320
wenzelm
parents: 43285
diff changeset
    20
  General/linear_set.scala
52975
457c006f91bb support for maps with multiple entries per key;
wenzelm
parents: 52971
diff changeset
    21
  General/multi_map.scala
43600
4ac04bf9ff89 abstract algebra of file paths in Scala (cf. path.ML);
wenzelm
parents: 43523
diff changeset
    22
  General/path.scala
43320
wenzelm
parents: 43285
diff changeset
    23
  General/position.scala
wenzelm
parents: 43285
diff changeset
    24
  General/pretty.scala
43780
2cb2310d68b6 more uniform Properties in ML and Scala;
wenzelm
parents: 43779
diff changeset
    25
  General/properties.scala
43320
wenzelm
parents: 43285
diff changeset
    26
  General/scan.scala
wenzelm
parents: 43285
diff changeset
    27
  General/sha1.scala
wenzelm
parents: 43285
diff changeset
    28
  General/symbol.scala
45674
eb65c9d17e2f clarified Time vs. Timing;
wenzelm
parents: 45673
diff changeset
    29
  General/time.scala
45666
d83797ef0d2d separate module for concrete Isabelle markup;
wenzelm
parents: 45027
diff changeset
    30
  General/timing.scala
52671
9a360530eac8 separate module XZ_File to avoid initial dependency on org.tukaani.xz;
wenzelm
parents: 52667
diff changeset
    31
  General/xz_file.scala
53279
763d35697338 clarified module location;
wenzelm
parents: 53055
diff changeset
    32
  Isar/completion.scala
43320
wenzelm
parents: 43285
diff changeset
    33
  Isar/keyword.scala
wenzelm
parents: 43285
diff changeset
    34
  Isar/outer_syntax.scala
wenzelm
parents: 43285
diff changeset
    35
  Isar/parse.scala
wenzelm
parents: 43285
diff changeset
    36
  Isar/token.scala
wenzelm
parents: 43285
diff changeset
    37
  PIDE/command.scala
wenzelm
parents: 43285
diff changeset
    38
  PIDE/document.scala
52530
99dd8b4ef3fe explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents: 52444
diff changeset
    39
  PIDE/document_id.scala
52971
31926d2c04ee tuned signature -- more abstract PIDE editor operations;
wenzelm
parents: 52671
diff changeset
    40
  PIDE/editor.scala
45670
b84170538043 rearranged files;
wenzelm
parents: 45666
diff changeset
    41
  PIDE/markup.scala
43320
wenzelm
parents: 43285
diff changeset
    42
  PIDE/markup_tree.scala
45709
87017fcbad83 clarified modules (again) -- NB: both Document and Protocol are specific to this particular prover;
wenzelm
parents: 45674
diff changeset
    43
  PIDE/protocol.scala
52981
c7afd884dfb2 moved generic module to its proper place;
wenzelm
parents: 52975
diff changeset
    44
  PIDE/query_operation.scala
43320
wenzelm
parents: 43285
diff changeset
    45
  PIDE/text.scala
44698
0385292321a0 moved XML/YXML to src/Pure/PIDE;
wenzelm
parents: 43780
diff changeset
    46
  PIDE/xml.scala
0385292321a0 moved XML/YXML to src/Pure/PIDE;
wenzelm
parents: 43780
diff changeset
    47
  PIDE/yxml.scala
49294
a600c017f814 provide color values via options;
wenzelm
parents: 49173
diff changeset
    48
  System/color_value.scala
48346
e2382bede914 more general support for Isabelle/Scala command line tools;
wenzelm
parents: 48276
diff changeset
    49
  System/command_line.scala
52667
d2b12523186d Scala version of init.bat;
wenzelm
parents: 52553
diff changeset
    50
  System/cygwin_init.scala
43320
wenzelm
parents: 43285
diff changeset
    51
  System/event_bus.scala
51615
072a7249e1ac separate module "GUI", to keep this out of the way of generic Isabelle_System operations, notably for non-Isabelle/jEdit applications;
wenzelm
parents: 51614
diff changeset
    52
  System/gui.scala
43320
wenzelm
parents: 43285
diff changeset
    53
  System/gui_setup.scala
49066
1067a639d42a basic setup for HTML5 panel;
wenzelm
parents: 49065
diff changeset
    54
  System/html5_panel.scala
51250
ca13a14cc52e support for POSIX interrupts (bypassed on Windows);
wenzelm
parents: 51098
diff changeset
    55
  System/interrupt.scala
43744
2c7e1565b4a3 some support to invoke Scala methods under program control;
wenzelm
parents: 43730
diff changeset
    56
  System/invoke_scala.scala
43517
87ec9a1c0f98 basic setup for Isabelle charset;
wenzelm
parents: 43405
diff changeset
    57
  System/isabelle_charset.scala
51614
22d1dd43f089 separate module Isabelle_Font, to keep this out of the way of generic Isabelle_System operations, notably for non-Isabelle/jEdit applications;
wenzelm
parents: 51508
diff changeset
    58
  System/isabelle_font.scala
43320
wenzelm
parents: 43285
diff changeset
    59
  System/isabelle_process.scala
wenzelm
parents: 43285
diff changeset
    60
  System/isabelle_system.scala
49065
8ead9e8b15fb basic support for Java FX;
wenzelm
parents: 48411
diff changeset
    61
  System/jfx_thread.scala
48365
d88aefda01c4 basic support for stand-alone options with external string representation;
wenzelm
parents: 48346
diff changeset
    62
  System/options.scala
43320
wenzelm
parents: 43285
diff changeset
    63
  System/platform.scala
wenzelm
parents: 43285
diff changeset
    64
  System/session.scala
wenzelm
parents: 43285
diff changeset
    65
  System/swing_thread.scala
45027
f459e93a038e more abstract wrapping of fifos as System_Channel;
wenzelm
parents: 44698
diff changeset
    66
  System/system_channel.scala
50203
00d8ad713e32 explicit module UTF8;
wenzelm
parents: 50201
diff changeset
    67
  System/utf8.scala
43320
wenzelm
parents: 43285
diff changeset
    68
  Thy/html.scala
50707
5b2bf7611662 maintain session index on Scala side, for more determistic results;
wenzelm
parents: 50689
diff changeset
    69
  Thy/present.scala
43320
wenzelm
parents: 43285
diff changeset
    70
  Thy/thy_header.scala
43651
511df47bcadc some support for theory files within Isabelle/Scala session;
wenzelm
parents: 43600
diff changeset
    71
  Thy/thy_info.scala
511df47bcadc some support for theory files within Isabelle/Scala session;
wenzelm
parents: 43600
diff changeset
    72
  Thy/thy_load.scala
43320
wenzelm
parents: 43285
diff changeset
    73
  Thy/thy_syntax.scala
50686
d703e3aafa8c moved files;
wenzelm
parents: 50685
diff changeset
    74
  Tools/build.scala
d703e3aafa8c moved files;
wenzelm
parents: 50685
diff changeset
    75
  Tools/build_dialog.scala
52444
2cfe6656d6d6 slightly improved "isabelle doc" based on Isabelle/Scala;
wenzelm
parents: 52439
diff changeset
    76
  Tools/doc.scala
52439
4cf3f6153eb8 improved "isabelle keywords" and "isabelle update_keywords" based on Isabelle/Scala, without requiring to build sessions first;
wenzelm
parents: 52427
diff changeset
    77
  Tools/keywords.scala
50687
a8db4bf70e90 moved files;
wenzelm
parents: 50686
diff changeset
    78
  Tools/main.scala
50981
1791a90a94fb tuned signature;
wenzelm
parents: 50980
diff changeset
    79
  Tools/ml_statistics.scala
53055
0fe8a9972eda some protocol to determine provers according to ML;
wenzelm
parents: 52981
diff changeset
    80
  Tools/sledgehammer_params.scala
50980
bc746aa3e8d5 charts for future task runtime statistics;
wenzelm
parents: 50707
diff changeset
    81
  Tools/task_statistics.scala
43320
wenzelm
parents: 43285
diff changeset
    82
  library.scala
wenzelm
parents: 43285
diff changeset
    83
  package.scala
43730
a0ed7bc688b5 lambda terms with XML data representation in Scala;
wenzelm
parents: 43715
diff changeset
    84
  term.scala
43779
47bec02c6762 more uniform Term and Term_XML modules;
wenzelm
parents: 43776
diff changeset
    85
  term_xml.scala
43320
wenzelm
parents: 43285
diff changeset
    86
)
wenzelm
parents: 43285
diff changeset
    87
34282
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
    88
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
    89
## diagnostics
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
    90
43280
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
    91
PRG="$(basename "$0")"
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
    92
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
    93
function usage()
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
    94
{
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
    95
  echo
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
    96
  echo "Usage: isabelle $PRG [OPTIONS]"
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
    97
  echo
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
    98
  echo "  Options are:"
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
    99
  echo "    -f           fresh build"
47408
63c05991882e slightly faster default compilation of Isabelle/Scala;
wenzelm
parents: 47115
diff changeset
   100
  echo "    -t           test separate compilation of PIDE"
43280
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   101
  echo
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   102
  exit 1
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   103
}
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   104
34282
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
   105
function fail()
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
   106
{
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
   107
  echo "$1" >&2
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
   108
  exit 2
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
   109
}
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
   110
42899
108e815fdc8e misc tuning and update;
wenzelm
parents: 42720
diff changeset
   111
[ -z "$ISABELLE_HOME" ] && fail "Missing Isabelle settings environment"
34282
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
   112
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
   113
43280
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   114
## process command line
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   115
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   116
# options
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   117
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   118
FRESH=""
47408
63c05991882e slightly faster default compilation of Isabelle/Scala;
wenzelm
parents: 47115
diff changeset
   119
TEST_PIDE=""
43280
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   120
47408
63c05991882e slightly faster default compilation of Isabelle/Scala;
wenzelm
parents: 47115
diff changeset
   121
while getopts "ft" OPT
43280
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   122
do
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   123
  case "$OPT" in
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   124
    f)
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   125
      FRESH=true
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   126
      ;;
47408
63c05991882e slightly faster default compilation of Isabelle/Scala;
wenzelm
parents: 47115
diff changeset
   127
    t)
63c05991882e slightly faster default compilation of Isabelle/Scala;
wenzelm
parents: 47115
diff changeset
   128
      TEST_PIDE=true
63c05991882e slightly faster default compilation of Isabelle/Scala;
wenzelm
parents: 47115
diff changeset
   129
      ;;
43280
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   130
    \?)
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   131
      usage
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   132
      ;;
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   133
  esac
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   134
done
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   135
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   136
shift $(($OPTIND - 1))
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   137
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   138
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   139
# args
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   140
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   141
[ "$#" -ne 0 ] && usage
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   142
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   143
50689
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   144
## dependencies
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   145
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   146
declare -a JFREECHART_JARS=()
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   147
for NAME in $JFREECHART_JAR_NAMES
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   148
do
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   149
  JFREECHART_JARS["${#JFREECHART_JARS[@]}"]="$JFREECHART_HOME/lib/$NAME"
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   150
done
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   151
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   152
49558
af7b652180d5 minimal component and build setup for graphview;
wenzelm
parents: 49449
diff changeset
   153
## build
34282
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
   154
34284
33ad3571ad83 tuned Isabelle/Scala build;
wenzelm
parents: 34282
diff changeset
   155
TARGET_DIR="$ISABELLE_HOME/lib/classes"
43523
5aaa0fe92672 simplified arrangement of jars;
wenzelm
parents: 43521
diff changeset
   156
TARGET="$TARGET_DIR/ext/Pure.jar"
34282
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
   157
45673
cd41e3903fbf separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents: 45672
diff changeset
   158
declare -a PIDE_SOURCES=()
cd41e3903fbf separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents: 45672
diff changeset
   159
declare -a PURE_SOURCES=()
cd41e3903fbf separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents: 45672
diff changeset
   160
cd41e3903fbf separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents: 45672
diff changeset
   161
for DEP in "${SOURCES[@]}"
cd41e3903fbf separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents: 45672
diff changeset
   162
do
cd41e3903fbf separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents: 45672
diff changeset
   163
  if grep "Module:.*PIDE" "$DEP" >/dev/null
cd41e3903fbf separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents: 45672
diff changeset
   164
  then
cd41e3903fbf separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents: 45672
diff changeset
   165
    PIDE_SOURCES["${#PIDE_SOURCES[@]}"]="$DEP"
cd41e3903fbf separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents: 45672
diff changeset
   166
  else
cd41e3903fbf separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents: 45672
diff changeset
   167
    PURE_SOURCES["${#PURE_SOURCES[@]}"]="$DEP"
cd41e3903fbf separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents: 45672
diff changeset
   168
  fi
cd41e3903fbf separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents: 45672
diff changeset
   169
done
cd41e3903fbf separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents: 45672
diff changeset
   170
43405
723a8af9d3f0 tuned messages;
wenzelm
parents: 43320
diff changeset
   171
declare -a UPDATED=()
723a8af9d3f0 tuned messages;
wenzelm
parents: 43320
diff changeset
   172
43280
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   173
if [ -n "$FRESH" ]; then
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   174
  OUTDATED=true
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   175
else
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   176
  OUTDATED=false
43523
5aaa0fe92672 simplified arrangement of jars;
wenzelm
parents: 43521
diff changeset
   177
  if [ ! -e "$TARGET" ]; then
5aaa0fe92672 simplified arrangement of jars;
wenzelm
parents: 43521
diff changeset
   178
    OUTDATED=true
5aaa0fe92672 simplified arrangement of jars;
wenzelm
parents: 43521
diff changeset
   179
  else
43405
723a8af9d3f0 tuned messages;
wenzelm
parents: 43320
diff changeset
   180
    for DEP in "${SOURCES[@]}"
43280
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   181
    do
43405
723a8af9d3f0 tuned messages;
wenzelm
parents: 43320
diff changeset
   182
      [ ! -e "$DEP" ] && fail "Missing file: $DEP"
43523
5aaa0fe92672 simplified arrangement of jars;
wenzelm
parents: 43521
diff changeset
   183
      [ "$DEP" -nt "$TARGET" ] && {
5aaa0fe92672 simplified arrangement of jars;
wenzelm
parents: 43521
diff changeset
   184
        OUTDATED=true
5aaa0fe92672 simplified arrangement of jars;
wenzelm
parents: 43521
diff changeset
   185
        UPDATED["${#UPDATED[@]}"]="$DEP"
5aaa0fe92672 simplified arrangement of jars;
wenzelm
parents: 43521
diff changeset
   186
      }
43280
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   187
    done
43405
723a8af9d3f0 tuned messages;
wenzelm
parents: 43320
diff changeset
   188
  fi
43280
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   189
fi
34282
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
   190
34284
33ad3571ad83 tuned Isabelle/Scala build;
wenzelm
parents: 34282
diff changeset
   191
if [ "$OUTDATED" = true ]
33ad3571ad83 tuned Isabelle/Scala build;
wenzelm
parents: 34282
diff changeset
   192
then
49173
fa01a202399c eliminated potentially confusing terminology of Scala "layer";
wenzelm
parents: 49068
diff changeset
   193
  echo "### Building Isabelle/Scala ..."
34282
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
   194
43405
723a8af9d3f0 tuned messages;
wenzelm
parents: 43320
diff changeset
   195
  [ "${#UPDATED[@]}" -gt 0 ] && {
723a8af9d3f0 tuned messages;
wenzelm
parents: 43320
diff changeset
   196
    echo "Changed files:"
723a8af9d3f0 tuned messages;
wenzelm
parents: 43320
diff changeset
   197
    for FILE in "${UPDATED[@]}"
723a8af9d3f0 tuned messages;
wenzelm
parents: 43320
diff changeset
   198
    do
723a8af9d3f0 tuned messages;
wenzelm
parents: 43320
diff changeset
   199
      echo "  $FILE"
723a8af9d3f0 tuned messages;
wenzelm
parents: 43320
diff changeset
   200
    done
723a8af9d3f0 tuned messages;
wenzelm
parents: 43320
diff changeset
   201
  }
723a8af9d3f0 tuned messages;
wenzelm
parents: 43320
diff changeset
   202
34282
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
   203
  rm -rf classes && mkdir classes
45673
cd41e3903fbf separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents: 45672
diff changeset
   204
47009
97b68d61de2e less noisy Isabelle/Scala build process;
wenzelm
parents: 46611
diff changeset
   205
  SCALAC_OPTIONS="$ISABELLE_SCALA_BUILD_OPTIONS -d classes"
45673
cd41e3903fbf separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents: 45672
diff changeset
   206
49067
4cb40eb2eac9 proper classpath for Java FX;
wenzelm
parents: 49066
diff changeset
   207
  JFXRT="$ISABELLE_JDK_HOME/jre/lib/jfxrt.jar"
4cb40eb2eac9 proper classpath for Java FX;
wenzelm
parents: 49066
diff changeset
   208
50689
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   209
  (
51504
18095684c5a6 basic support for xz files;
wenzelm
parents: 51250
diff changeset
   210
    for X in "$JFXRT" "${JFREECHART_JARS[@]}" "$XZ_JAVA_HOME/lib/xz.jar" classes
50689
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   211
    do
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   212
      CLASSPATH="$CLASSPATH:$X"
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   213
    done
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   214
    CLASSPATH="$(jvmpath "$CLASSPATH")"
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   215
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   216
    if [ "$TEST_PIDE" = true ]; then
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   217
      isabelle_scala scalac $SCALAC_OPTIONS "${PIDE_SOURCES[@]}" || \
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   218
        fail "Failed to compile PIDE sources"
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   219
      isabelle_scala scalac $SCALAC_OPTIONS "${PURE_SOURCES[@]}" || \
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   220
        fail "Failed to compile Pure sources"
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   221
    else
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   222
      isabelle_scala scalac $SCALAC_OPTIONS "${PIDE_SOURCES[@]}" "${PURE_SOURCES[@]}" || \
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   223
        fail "Failed to compile sources"
0607d557d073 some support for chart drawing;
wenzelm
parents: 50687
diff changeset
   224
    fi
51508
48a1e09120d4 actually exit on scalac failure;
wenzelm
parents: 51504
diff changeset
   225
  ) || exit "$?"
45673
cd41e3903fbf separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents: 45672
diff changeset
   226
43523
5aaa0fe92672 simplified arrangement of jars;
wenzelm
parents: 43521
diff changeset
   227
  mkdir -p "$TARGET_DIR/ext" || fail "Failed to create directory $TARGET_DIR/ext"
43280
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   228
43285
966f359dc724 further jedit build option;
wenzelm
parents: 43280
diff changeset
   229
  pushd classes >/dev/null
43280
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   230
43517
87ec9a1c0f98 basic setup for Isabelle charset;
wenzelm
parents: 43405
diff changeset
   231
  CHARSET_SERVICE="META-INF/services/java.nio.charset.spi.CharsetProvider"
87ec9a1c0f98 basic setup for Isabelle charset;
wenzelm
parents: 43405
diff changeset
   232
  mkdir -p "$(dirname "$CHARSET_SERVICE")"
87ec9a1c0f98 basic setup for Isabelle charset;
wenzelm
parents: 43405
diff changeset
   233
  echo isabelle.Isabelle_Charset_Provider > "$CHARSET_SERVICE"
87ec9a1c0f98 basic setup for Isabelle charset;
wenzelm
parents: 43405
diff changeset
   234
53452
8181bc357dc4 more portable access to icon -- avoid Isabelle_System which is not yet initialized in bootstrap;
wenzelm
parents: 53279
diff changeset
   235
  cp "$ISABELLE_HOME/lib/logo/isabelle.gif" isabelle/.
8181bc357dc4 more portable access to icon -- avoid Isabelle_System which is not yet initialized in bootstrap;
wenzelm
parents: 53279
diff changeset
   236
47115
1a05adae1cc9 more robust command invocation via ISABELLE_JDK_HOME or SCALA_HOME (NB: bash exec requires genuine executable, not function);
wenzelm
parents: 47113
diff changeset
   237
  isabelle_jdk jar cfe "$(jvmpath "$TARGET")" isabelle.GUI_Setup META-INF isabelle || \
43523
5aaa0fe92672 simplified arrangement of jars;
wenzelm
parents: 43521
diff changeset
   238
    fail "Failed to produce $TARGET"
34282
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
   239
49449
ffc06b54cb22 JavaFX is inactive by default;
wenzelm
parents: 49294
diff changeset
   240
  cp "$SCALA_HOME/lib/scala-compiler.jar" \
47995
72f52cd7c633 include scala-compiler.jar in basic Isabelle/Scala environment, to make Isabelle/jEdit console work with scala-2.10.0-M3;
wenzelm
parents: 47849
diff changeset
   241
    "$SCALA_HOME/lib/scala-library.jar" \
72f52cd7c633 include scala-compiler.jar in basic Isabelle/Scala environment, to make Isabelle/jEdit console work with scala-2.10.0-M3;
wenzelm
parents: 47849
diff changeset
   242
    "$SCALA_HOME/lib/scala-swing.jar" "$TARGET_DIR/ext"
72f52cd7c633 include scala-compiler.jar in basic Isabelle/Scala environment, to make Isabelle/jEdit console work with scala-2.10.0-M3;
wenzelm
parents: 47849
diff changeset
   243
47849
48b52cdc214a accomodate scala-2.10.0-M3 with its extra jar;
wenzelm
parents: 47663
diff changeset
   244
  [ -e "$SCALA_HOME/lib/scala-actors.jar" ] && \
48b52cdc214a accomodate scala-2.10.0-M3 with its extra jar;
wenzelm
parents: 47663
diff changeset
   245
    cp "$SCALA_HOME/lib/scala-actors.jar" "$TARGET_DIR/ext"
43521
d477b92109b8 provide Isabelle/Scala environment as Java extension, instead of user classpath
wenzelm
parents: 43517
diff changeset
   246
49955
10b2c0b68a4d extra jar for scala-2.10.0-RC1;
wenzelm
parents: 49678
diff changeset
   247
  [ -e "$SCALA_HOME/lib/scala-reflect.jar" ] && \
10b2c0b68a4d extra jar for scala-2.10.0-RC1;
wenzelm
parents: 49678
diff changeset
   248
    cp "$SCALA_HOME/lib/scala-reflect.jar" "$TARGET_DIR/ext"
10b2c0b68a4d extra jar for scala-2.10.0-RC1;
wenzelm
parents: 49678
diff changeset
   249
43280
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   250
  popd >/dev/null
e5dd0ae1b054 support fresh build of jars;
wenzelm
parents: 42899
diff changeset
   251
34282
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
   252
  rm -rf classes
549969a7f582 simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff changeset
   253
fi