diff --git a/containers/julia/.devcontainer/devcontainer.json b/containers/julia/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..ba577bea7e --- /dev/null +++ b/containers/julia/.devcontainer/devcontainer.json @@ -0,0 +1,6 @@ +{ + "name": "Julia", + "image": "ghcr.io/julia-vscode/julia-devcontainer", + "extensions": ["julialang.language-julia"], + "postCreateCommand": "julia --project=. -e 'using Pkg; if (isfile(joinpath(pwd(),\"Manifest.toml\")) || isfile(joinpath(pwd(),\"JuliaManifest.toml\"))) && (isfile(joinpath(pwd(),\"Project.toml\")) || isfile(joinpath(pwd(),\"JuliaProject.toml\"))); Pkg.instantiate(); end'" +} diff --git a/containers/julia/.npmignore b/containers/julia/.npmignore new file mode 100644 index 0000000000..7f19386cd9 --- /dev/null +++ b/containers/julia/.npmignore @@ -0,0 +1,6 @@ +../README.md +../test-project +../.vscode/launch.json +../.vscode/launch.test.json +../.vscode/settings.json +../.vscode/tasks.json diff --git a/containers/julia/README.md b/containers/julia/README.md new file mode 100644 index 0000000000..fb848cfccb --- /dev/null +++ b/containers/julia/README.md @@ -0,0 +1,39 @@ +# Julia + +## Summary + +*Develop Julia applications.* + +| Metadata | Value | +|----------|-------| +| *Contributors* | David Anthoff, github.com/davidanthoff | +| *Definition type* | Image | +| *Works in Codespaces* | Yes | +| *Container host OS support* | Linux | +| *Languages, platforms* | Julia | + +## Using this definition with an existing folder + +Just follow these steps: + +1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine. + +2. To use VS Code's copy of this definition: + 1. Start VS Code and open your project folder. + 2. Press F1 select and **Remote-Containers: Add Development Container Configuration Files...** from the command palette. + 3. Select the Dart definition. + +3. To use latest-and-greatest copy of this definition from the repository: + 1. Clone this repository. + 2. Copy the contents of this folder in the cloned repository to the root of your project folder. + 3. Start VS Code and open your project folder. + +4. After following step 2 or 3, the contents of the `.devcontainer` folder in your project can be adapted to meet your needs. + +5. Finally, press F1 and run **Remote-Containers: Reopen Folder in Container** to start using the definition. + +## License + +Copyright (c) Microsoft Corporation. All rights reserved. + +Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE). \ No newline at end of file diff --git a/containers/julia/test-project/test.sh b/containers/julia/test-project/test.sh new file mode 100644 index 0000000000..83b42345eb --- /dev/null +++ b/containers/julia/test-project/test.sh @@ -0,0 +1,50 @@ +#!/bin/bash -i +cd $(dirname "$0") + +# -- Utility functions -- +if [ -z $HOME ]; then + HOME="/root" +fi + +FAILED=() + +check() { + LABEL=$1 + shift + echo -e "\n๐Ÿงช Testing $LABEL: $@" + if $@; then + echo "๐Ÿ† Passed!" + else + echo "๐Ÿ’ฅ $LABEL check failed." + FAILED+=("$LABEL") + fi +} + +checkMultiple() { + PASSED=0 + LABEL="$1" + shift; MINIMUMPASSED=$1 + shift; EXPRESSION="$1" + while [ "$EXPRESSION" != "" ]; do + if $EXPRESSION; then ((PASSED++)); fi + shift; EXPRESSION=$1 + done + check "$LABEL" [ $PASSED -ge $MINIMUMPASSED ] +} + +checkExtension() { + checkMultiple "$1" 1 "[ -d ""$HOME/.vscode-server/extensions/$1*"" ]" "[ -d ""$HOME/.vscode-server-insiders/extensions/$1*"" ]" "[ -d ""$HOME/.vscode-test-server/extensions/$1*"" ]" +} + +# -- Actual tests -- +checkMultiple "vscode-server" 1 "[ -d ""$HOME/.vscode-server/bin"" ]" "[ -d ""$HOME/.vscode-server-insiders/bin"" ]" "[ -d ""$HOME/.vscode-test-server/bin"" ]" +check "julia" julia --version + +# -- Report results -- +if [ ${#FAILED[@]} -ne 0 ]; then + echo -e "\n๐Ÿ’ฅ Failed tests: ${FAILED[@]}" + exit 1 +else + echo -e "\n๐Ÿ’ฏ All passed!" + exit 0 +fi