From 9ae494d9e33560d78ffe97711629b8b945313ae9 Mon Sep 17 00:00:00 2001 From: Simon Parten Date: Mon, 20 May 2024 10:40:25 +0200 Subject: [PATCH] . --- .devcontainer/devcontainer.json | 3 ++- .devcontainer/features/mill/devcontainer-feature.json | 4 ++-- .devcontainer/features/mill/install.sh | 9 +++++++-- .github/workflows/container.yml | 5 +++-- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c0ad0c6..ee524fd 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -29,7 +29,8 @@ // //, "ghcr.io/devcontainers-contrib/features/scalacli-sdkman:2": {} }, - "onCreateCommand": "mill -j 0 __.prepareOffline && mill -j 0 __.compile && mill mill.bsp.BSP/install" + // Try do do as much as possible in the image, so that the container starts up quickly + "onCreateCommand": "mill -j 0 __.prepareOffline && mill -j 0 __.compile && mill mill.bsp.BSP/install && mill --import ivy:com.lihaoyi::mill-contrib-bloop: mill.contrib.bloop.Bloop/install" // // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], diff --git a/.devcontainer/features/mill/devcontainer-feature.json b/.devcontainer/features/mill/devcontainer-feature.json index 49da92f..aae9cb2 100644 --- a/.devcontainer/features/mill/devcontainer-feature.json +++ b/.devcontainer/features/mill/devcontainer-feature.json @@ -1,8 +1,8 @@ { "id": "mill", "version": "1.0.0", - "name": "Mill Build Tool", - "description": "Installs Mill, a Scala build tool.", + "name": "Mill, Coursier, Metals", + "description": "Some OSS scala utils", "installsAfter": [ "ghcr.io/devcontainers/features/java:1" ], diff --git a/.devcontainer/features/mill/install.sh b/.devcontainer/features/mill/install.sh index f09e4e6..a9e56da 100755 --- a/.devcontainer/features/mill/install.sh +++ b/.devcontainer/features/mill/install.sh @@ -2,6 +2,11 @@ set -e -# Install Mill +# Put millw on the path, so we can call 'mill' from the command line. curl -L -o /usr/local/bin/mill https://raw.githubusercontent.com/lefou/millw/0.4.11/millw && chmod +x /usr/local/bin/mill -curl -fL "https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux.gz" | gzip -d > /usr/local/bin/cs && chmod +x /usr/local/bin/cs \ No newline at end of file + +# Install Coursier - can call cs from command line +curl -fL "https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux.gz" | gzip -d > /usr/local/bin/cs && chmod +x /usr/local/bin/cs + +# Install metals - should prevent dependancy downloads on container start +cs install metals \ No newline at end of file diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index fbb92c6..21f9036 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -36,5 +36,6 @@ jobs: # Change this to be your CI task/script runCmd: | # Add multiple commands to run if needed - ./mill -v - ./mill __.compile + cs version + mill -v + mill __.compile