Skip to content

Commit af1ba18

Browse files
authored
Add Github Codespaces configuration.
[Build]
1 parent 70601cc commit af1ba18

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "TLA+ CommunityModules",
3+
4+
// Install optional extension. If this fails, it just degrades the convenience factor.
5+
"extensions": [
6+
"alygin.vscode-tlaplus-nightly",
7+
"mhutchie.git-graph",
8+
"vscjava.vscode-java-pack"
9+
],
10+
11+
// - Do not automatically update extensions (E.g. better-code ext is patched for TLA+)
12+
// - Use Java GC that works best with TLC.
13+
// - https://github.com/alygin/vscode-tlaplus/wiki/Automatic-Module-Parsing
14+
"settings": {
15+
"tlaplus.tlc.statisticsSharing": "share",
16+
"tlaplus.java.options": "-XX:+UseParallelGC",
17+
"tlaplus.java.home": "/home/codespace/.java/current/",
18+
"[tlaplus]": {"editor.codeActionsOnSave": {"source": true} }
19+
},
20+
21+
"postCreateCommand": "bash -i .devcontainer/install.sh",
22+
}

.devcontainer/install.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash -i
2+
3+
## Place to install TLC, TLAPS, Apalache, ...
4+
mkdir -p tools
5+
6+
## PATH below has two locations because of inconsistencies between Gitpod and Codespaces.
7+
## Gitpod: /workspace/...
8+
## Codespaces: /workspaces/...
9+
10+
## Install TLA+ Tools (download from github instead of nightly.tlapl.us (inria) to only rely on github)
11+
wget -qN https://github.com/tlaplus/tlaplus/releases/download/v1.8.0/tla2tools.jar -P tools/
12+
echo "alias tlcrepl='java -cp /workspace/ewd998/tools/tla2tools.jar:/workspaces/ewd998/tools/tla2tools.jar tlc2.REPL'" >> $HOME/.bashrc
13+
echo "alias tlc='java -cp /workspace/ewd998/tools/tla2tools.jar:/workspaces/ewd998/tools/tla2tools.jar tlc2.TLC'" >> $HOME/.bashrc
14+
15+
## Install TLAPS (proof system)
16+
wget -N https://github.com/tlaplus/tlapm/releases/download/v1.4.5/tlaps-1.4.5-x86_64-linux-gnu-inst.bin -P /tmp
17+
chmod +x /tmp/tlaps-1.4.5-x86_64-linux-gnu-inst.bin
18+
/tmp/tlaps-1.4.5-x86_64-linux-gnu-inst.bin -d tools/tlaps
19+
echo 'export PATH=$PATH:/workspace/ewd998/tools/tlaps/bin:/workspaces/ewd998/tools/tlaps/bin' >> $HOME/.bashrc
20+
21+
## Install Apalache
22+
wget -qN https://github.com/informalsystems/apalache/releases/latest/download/apalache.tgz -P /tmp
23+
mkdir -p tools/apalache
24+
tar xvfz /tmp/apalache.tgz --directory tools/apalache/
25+
echo 'export PATH=$PATH:/workspace/ewd998/tools/apalache/bin:/workspaces/ewd998/tools/apalache/bin' >> $HOME/.bashrc
26+
tools/apalache/bin/apalache-mc config --enable-stats=true
27+
28+
## Install Apache Ant that builds CommunityModules (see build.xml)
29+
sudo apt-get install -y ant
30+
31+
## Do initial build
32+
ant -f build.xml

0 commit comments

Comments
 (0)