diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..a7aeec6f --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,6 @@ +FROM eclipse-temurin:17-jdk-jammy + +USER root + +# set working directory +WORKDIR /workspaces/RPKit \ No newline at end of file diff --git a/.devcontainer/README.md b/.devcontainer/README.md new file mode 100644 index 00000000..520baaf3 --- /dev/null +++ b/.devcontainer/README.md @@ -0,0 +1,33 @@ +# Dev Container +This directory contains files related to the dev container for the project, which is a defined environment with the dependencies for compilation pre-installed. + +## Install Docker +If you do not already have Docker installed, download it [here](https://www.docker.com/get-started/)_. + +## Entering Dev Container Environment via VSCode +To enter the dev container environment using VSCode, follow these steps: +1. Click on the "Open a Remote Window" button in the bottom left of VSCode +1. Click "Reopen in Container" + +## Entering Dev Container Environment via Command Line +### Windows +To enter the dev container environment via the command line on Windows, run the following commands: +``` +cd .\.devcontainer +.\start_dev_container.bat +``` + +### Linux +To enter the dev container environment via the command line on Linux, run the following commands: +``` +cd ./.devcontainer +./start_dev_container.sh +``` + +## Compiling +To compile the project in the provided dev container, follow these steps: +1. Make sure the End of Line (EOF) Sequence for the `gradlew` script is set to LF. If it is set to CRLF, the script will fail to run. +1. Run the following command: +``` +./gradlew clean build +``` \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..99b37e85 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,32 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu +{ + "name": "rpkdevcontainer", + "build": { + // Path is relative to the devcontainer.json file. + "dockerfile": "Dockerfile" + }, + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "uname -a", + + // Configure tool-specific properties. + "customizations": { + "vscode": { + "extensions": [ + "vscjava.vscode-java-pack", + "vscjava.vscode-gradle", + "fwcd.kotlin" + ] + } + }, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + "remoteUser": "root" +} diff --git a/.devcontainer/start_dev_container.bat b/.devcontainer/start_dev_container.bat new file mode 100644 index 00000000..ffac4fd0 --- /dev/null +++ b/.devcontainer/start_dev_container.bat @@ -0,0 +1,4 @@ +REM This script is meant to be run from the .devcontainer directory. + +docker build . -t rpk-dev-container +docker run -it -v %cd%\..\:/workspaces/RPKit rpk-dev-container /bin/bash \ No newline at end of file diff --git a/.devcontainer/start_dev_container.sh b/.devcontainer/start_dev_container.sh new file mode 100644 index 00000000..7f482714 --- /dev/null +++ b/.devcontainer/start_dev_container.sh @@ -0,0 +1,4 @@ +# This script is meant to be run from the .devcontainer directory. + +docker build . -t rpk-dev-container +docker run -it -v %cd%\..\:/workspaces/RPKit rpk-dev-container /bin/bash \ No newline at end of file