diff --git a/.devcontainer/devcontainer.bashrc b/.devcontainer/devcontainer.bashrc index 1bd9398..2812baa 100644 --- a/.devcontainer/devcontainer.bashrc +++ b/.devcontainer/devcontainer.bashrc @@ -4,6 +4,7 @@ source /opt/conda/etc/profile.d/conda.sh conda activate prd source <(yardl completion bash) +source <(just --completions bash) if [[ "${BASH_ENV:-}" == "$(readlink -f "${BASH_SOURCE[0]:-}")" ]]; then # We don't want subshells to unnecessarily source this again. diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6a0e73f..cc2ee7d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -109,6 +109,7 @@ "ms-python.python", "ms-vscode.cmake-tools", "ms-vscode.cpptools", + "sclu1034.justfile", "timonwong.shellcheck", "twxs.cmake" ] diff --git a/data/download-data.sh b/data/download-data.sh index 83a7210..da5ea84 100755 --- a/data/download-data.sh +++ b/data/download-data.sh @@ -1,6 +1,10 @@ #!/bin/bash +set -euo pipefail + # Check if azcopy is installed +cd "$(dirname "$0")" + if ! command -v azcopy &> /dev/null then wget -O azcopy.tar.gz https://aka.ms/downloadazcopy-v10-linux diff --git a/environment.yml b/environment.yml index c9bea3a..15cde55 100644 --- a/environment.yml +++ b/environment.yml @@ -5,13 +5,14 @@ channels: dependencies: - bash-completion>=2.11 - cmake>=3.21.3 - - fmt>=8.1.1 - compilers + - fmt>=8.1.1 + - gh=2.38.0 - h5py>=3.7.0 - hdf5>=1.12.1 - howardhinnant_date>=3.0.1 - ipykernel>=6.19.2 - - gh=2.38.0 + - just=1.16.0 - ninja>=1.11.0 - nlohmann_json>=3.11.2 - numpy>=1.24.3 diff --git a/justfile b/justfile new file mode 100644 index 0000000..aa42d36 --- /dev/null +++ b/justfile @@ -0,0 +1,21 @@ +set shell := ['bash', '-ceuo', 'pipefail'] + +default: build + +@download-test-data: + data/download-data.sh + +@ensure-build-dir: + mkdir -p cpp/build + +@generate: + cd PETSIRD/model; \ + yardl generate + +@configure: generate ensure-build-dir + cd cpp/build; \ + cmake -GNinja .. + +@build: configure + cd cpp/build; \ + ninja