author  wenzelm 
Tue, 16 Jan 2018 09:58:17 +0100  
changeset 67445  4311845b0412 
parent 64370  865b39487b5d 
child 71367  91d5a8255c98 
permissions  rwxrxrx 
27628
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

1 
#!/usr/bin/env bash 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

2 
# 
27629  3 
# Administrative build for Isabelle source distribution. 
27628
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

4 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

5 
## directory layout 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

6 

34282
549969a7f582
simplified build/bootstrap of Isabelle/Scala components  avoid make;
wenzelm
parents:
31831
diff
changeset

7 
if [ z "$ISABELLE_HOME" ]; then 
549969a7f582
simplified build/bootstrap of Isabelle/Scala components  avoid make;
wenzelm
parents:
31831
diff
changeset

8 
ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd P)"; cd ..; pwd)" 
549969a7f582
simplified build/bootstrap of Isabelle/Scala components  avoid make;
wenzelm
parents:
31831
diff
changeset

9 
ISABELLE_TOOL="$ISABELLE_HOME/bin/isabelle" 
549969a7f582
simplified build/bootstrap of Isabelle/Scala components  avoid make;
wenzelm
parents:
31831
diff
changeset

10 
fi 
27628
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

11 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

12 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

13 
## diagnostics 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

14 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

15 
PRG="$(basename "$0")" 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

16 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

17 
function usage() 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

18 
{ 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

19 
cat <<EOF 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

20 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

21 
Usage: $PRG [MODULES] 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

22 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

23 
Produce Isabelle distribution modules from current repository sources. 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

24 
The MODULES list may contain any of the following: 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

25 

48691
335d60e1e328
discontinued presumably obsolete attempts at docsrc testing (cf. 3b02b0ef8d48, 89cc3dfb383b);
wenzelm
parents:
48498
diff
changeset

26 
all all modules below 
58791  27 
browser graph browser 
28 
jars Isabelle/Scala 

43280  29 
jars_fresh fresh build of jars 
27628
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

30 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

31 
EOF 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

32 
exit 1 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

33 
} 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

34 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

35 
function fail() 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

36 
{ 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

37 
echo "$1" >&2 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

38 
exit 2 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

39 
} 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

40 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

41 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

42 
## process command line 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

43 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

44 
[ "$#" eq 0 ] && usage 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

45 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

46 
MODULES="$@"; shift "$#" 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

47 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

48 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

49 
## modules 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

50 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

51 
function build_all () 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

52 
{ 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

53 
build_browser 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

54 
build_jars 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

55 
} 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

56 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

57 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

58 
function build_browser () 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

59 
{ 
34283
7911e83d06c0
simplified build/bootstrap of graph browser  avoid make;
wenzelm
parents:
34282
diff
changeset

60 
pushd "$ISABELLE_HOME/lib/browser" >/dev/null 
34297  61 
"$ISABELLE_TOOL" env ./build  exit $? 
34283
7911e83d06c0
simplified build/bootstrap of graph browser  avoid make;
wenzelm
parents:
34282
diff
changeset

62 
popd >/dev/null 
27628
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

63 
} 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

64 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

65 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

66 
function build_jars () 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

67 
{ 
28956  68 
pushd "$ISABELLE_HOME/src/Pure" >/dev/null 
43280  69 
"$ISABELLE_TOOL" env ./buildjars "$@"  exit $? 
27904  70 
popd >/dev/null 
27628
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

71 
} 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

72 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

73 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

74 
## main 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

75 

57618  76 
#FIXME workarounds for scalac 2.11.0 
77 
export CYGWIN="nodosfilewarning" 

53450  78 
function stty() { :; } 
79 
export f stty 

80 

27628
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

81 
for MODULE in $MODULES 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

82 
do 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

83 
case $MODULE in 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

84 
all) build_all;; 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

85 
browser) build_browser;; 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

86 
jars) build_jars;; 
43280  87 
jars_fresh) build_jars f;; 
27628
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

88 
*) fail "Bad module $MODULE" 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

89 
esac 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

90 
done 