From 75dfa71275a77f23f83feeeb135404ae49b5e174 Mon Sep 17 00:00:00 2001 From: Merith Date: Sat, 12 Jun 2021 13:33:08 -0700 Subject: [PATCH] Gitpod Support (#817) --- .gitpod.yml | 22 ++++++++++++++++++++++ CONTRIBUTING.md | 4 ++++ config/gitpod/Dockerfile | 8 ++++++++ 3 files changed, 34 insertions(+) create mode 100644 .gitpod.yml create mode 100644 config/gitpod/Dockerfile diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 000000000..c83ce9f6c --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,22 @@ +image: + file: config/gitpod/Dockerfile + +ports: + - port: 25565 + onOpen: notify + +vscode: + extensions: + - eamodio.gitlens + - github.vscode-pull-request-github + - ms-azuretools.vscode-docker + - redhat.java + - richardwillis.vscode-gradle + - vscjava.vscode-java-debug + - vscode.github + +tasks: + - name: Setup pre-commit hool + init: pre-commit install --config config/pre-commit/config.yml --allow-missing-config + - name: Install npm packages + init: npm ci diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7c250e89c..e257fb992 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,6 +19,10 @@ ## Developing - **Clone the repository:** `git clone https://github.com/SquidDev-CC/CC-Tweaked.git && cd CC-Tweaked` - **Setup Forge:** `./gradlew build` - **Run Minecraft:** `./gradlew runClient` (or run the `GradleStart` class from your IDE). + - **Optionally:** For small PRs (especially those only touching Lua code), it may be easier to use GitPod, which + provides a pre-configured environment: [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-2b2b2b?logo=gitpod)](https://gitpod.io/#https://github.com/SquidDev-CC/CC-Tweaked/) + + Do note you will need to download the mod after compiling to test. If you want to run CC:T in a normal Minecraft instance, run `./gradlew build` and copy the `.jar` from `build/libs`. These commands may take a few minutes to run the first time, as the environment is set up, but should be much faster diff --git a/config/gitpod/Dockerfile b/config/gitpod/Dockerfile new file mode 100644 index 000000000..5a9bd4320 --- /dev/null +++ b/config/gitpod/Dockerfile @@ -0,0 +1,8 @@ +FROM gitpod/workspace-base + +USER gitpod + +RUN sudo apt-get -q update \ + && sudo apt install -yq openjdk-8-jdk openjdk-16-jdk python3-pip \ + && sudo pip3 install pre-commit \ + && sudo update-java-alternatives --set java-1.8.0-openjdk-amd64