/
postBuild
80 lines (73 loc) · 2.31 KB
/
postBuild
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/env bash
set -e
# Install coursier
curl -fLo cs https://github.com/coursier/coursier/releases/download/v2.0.3/cs-x86_64-pc-linux
chmod +x cs
ALMOND_VERSION=0.11.1
# Install almond for Scala 2.13
./cs launch "almond:$ALMOND_VERSION" --scala 2.13.3 -- \
--install \
--id scala213 \
--display-name "Scala (2.13)" \
--env "JAVA_OPTS=-XX:MaxRAMPercentage=80.0" \
--variable-inspector \
</dev/null 2>&1 | grep -v '^Download'
# Install almond for Scala 2.12
./cs launch "almond:$ALMOND_VERSION" --scala 2.12.12 -- \
--install \
--id scala212 \
--display-name "Scala (2.12)" \
--env "JAVA_OPTS=-XX:MaxRAMPercentage=80.0" \
--variable-inspector \
</dev/null 2>&1 | grep -v '^Download'
# Install almond 0.6.0 for Scala 2.11
# TODO remove once TransmogrifAI and vegas are updated for Scala 2.12
SCALA_VERSION=2.11.12 ALMOND_VERSION=0.6.0
./cs bootstrap \
-r jitpack \
-i user -I user:sh.almond:scala-kernel-api_$SCALA_VERSION:$ALMOND_VERSION \
sh.almond:scala-kernel_$SCALA_VERSION:$ALMOND_VERSION \
--sources --default=true \
-o almond-scala-2.11 \
</dev/null 2>&1 | grep -v '^Download'
./almond-scala-2.11 --install --id scala211 --display-name "Scala (2.11)" \
--command "java -XX:MaxRAMPercentage=80.0 -jar almond-scala-2.11 --id scala211 --display-name 'Scala (2.11)'" \
--copy-launcher \
--metabrowse
rm -f almond-scala-2.11
# Install required Jupyter/JupyterLab extensions
jupyter labextension install --minimize=False \
jupyterlab-plotly \
@almond-sh/scalafmt \
@almond-sh/jupyterlab_variableinspector
# Set indentation to two spaces
JUPYTER_CONFIG_DIR=$(jupyter --config-dir)
# Classic notebook
mkdir -p $JUPYTER_CONFIG_DIR/nbconfig/
cat > $JUPYTER_CONFIG_DIR/nbconfig/notebook.json <<- EOF
{
"CodeCell": {
"cm_config": {
"indentUnit": 2
}
}
}
EOF
# JupyterLab notebook
mkdir -p $JUPYTER_CONFIG_DIR/lab/user-settings/@jupyterlab/notebook-extension/
cat > $JUPYTER_CONFIG_DIR/lab/user-settings/@jupyterlab/notebook-extension/tracker.jupyterlab-settings <<- EOF
{
"codeCellConfig": {
"tabSize": 2
}
}
EOF
# JupyterLab editor
mkdir -p $JUPYTER_CONFIG_DIR/lab/user-settings/@jupyterlab/fileeditor-extension/
cat > $JUPYTER_CONFIG_DIR/lab/user-settings/@jupyterlab/fileeditor-extension/plugin.jupyterlab-settings <<- EOF
{
"editorConfig": {
"tabSize": 2,
}
}
EOF