#! /usr/bin/env bash
#
# Install system packages required to build and test atd (Ubuntu)
#
# This is used by the Dockerfile and by the CI build.
#
set -eu

sudo apt-get update

# This includes compilers and libraries to support the various target
# languages of atd.
#
sudo apt-get install -y \
  default-jdk \
  nodejs \
  npm \
  python3 \
  python3-pip \
  python-is-python3 \
  scala

# For JSON Schema and atdpy testing
pip install jsonschema pytest mypy flake8

###### Sanity checks ######

echo 'check opam'
opam --version

echo 'check ocamlopt'
opam exec -- ocamlopt -version

echo 'check javac'
javac --version

echo 'check scalac'
scalac -version

echo 'check python3'
python3 --version

echo 'check jsonschema'
python3 -m jsonschema --version

echo 'check pytest'
python3 -m pytest --version

echo 'check mypy'
python3 -m mypy --version

echo 'check js'
js --version
