Skip to content

Commit

Permalink
feat (ide): Support & document Codespaces as IDE
Browse files Browse the repository at this point in the history
  • Loading branch information
vorburger committed Jan 12, 2024
1 parent 5383cf9 commit 305cc5c
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .bazelproject
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ derive_targets_from_directories: true
# https://github.com/salesforce/bazel-eclipse/issues/475
# https://github.com/salesforce/bazel-eclipse/blob/main/docs/common/projectviews.md#project-per-package
target_provisioning_strategy: project-per-package

# https://github.com/salesforce/bazel-eclipse/issues/477
bazel_binary: bazelisk
28 changes: 28 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
{
"name": "Debian",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:bookworm",
// ? "initializeCommand": "./test.bash",
"features": {
"ghcr.io/devcontainers-contrib/features/bash-command:1": {
"command": "./test.bash"
} // ,
// "ghcr.io/balazs23/devcontainers-features/bazel:1": {
// "bazelisk": "v1.15.0"
// }
}

// 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": [],

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
19 changes: 17 additions & 2 deletions docs/dev/ide.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

# IDE

<!-- TODO Reorder! Simplify. -->

## Eclipse

Eclipse is not actively supported by this project as an IDE.
Expand Down Expand Up @@ -61,8 +63,21 @@ $ sudo apt get install clang-format

## Web IDE

In order to work on this project with a purely Web-based IDE, which is great to hack from e.g. a Tablet or Work Computer or some such setup,
we recommend you use [Visual Studio Code for the Web](https://code.visualstudio.com/docs/editor/vscode-web) at <https://vscode.dev>
Web-based IDEs are great to easily work from any computer.

We therefore recommend you use GitHub Codespaces to contribute to this project.

Just go to <https://github.com/enola-dev/enola> and click on the green **Code** button, switch from the _Local_ to the _Codespaces_ tab, and click on the green **Create codespace on main** button.

This project is configured to automatically configure your Codespace with all required tools. If anything doesn't just work "out of the box", please [create an issue](https://github.com/enola-dev/enola/issues).

While the 32 GB disk space of the Codespace default _Machine Type_ is sufficient, its _2-core • 8 GB RAM_ is too limited for sufficiently efficient building, and at very least the _4-core • 16GB RAM_ (or bigger) is recommended.

If you are missing your fancy custom Shell configuration that you have built over the last 100 years,
you should [set up your dotfiles for Codespaces](https://docs.github.com/en/codespaces/setting-your-user-preferences/personalizing-github-codespaces-for-your-account#dotfiles)
such as [e.g. this dude did in his dotfiles](https://github.com/vorburger/vorburger-dotfiles-bin-etc#github-codespaces).

Alternatively, you can use [Visual Studio Code for the Web](https://code.visualstudio.com/docs/editor/vscode-web) at <https://vscode.dev>
together with a [Remote Tunnel](https://code.visualstudio.com/docs/editor/vscode-web#_use-your-own-compute-with-remote-tunnels)
e.g. to a computer at home, or a VM in the Cloud.

Expand Down
8 changes: 7 additions & 1 deletion test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ set -euo pipefail

# Same also in the ./enola script:
if ! [ -x "$(command -v bazelisk)" ]; then
echo "bazelisk is not installed, please run e.g. 'go install github.com/bazelbuild/bazelisk@latest' "
if [ -x "$(command -v go)" ]; then
go install github.com/bazelbuild/bazelisk@latest
go install github.com/bazelbuild/buildtools/buildifier@latest
go install github.com/bazelbuild/buildtools/buildozer@latest
else
echo "bazelisk is not installed, please either install Go https://go.dev/doc/install and then run e.g. 'go install github.com/bazelbuild/bazelisk@latest' "
echo "or an equivalent from https://github.com/bazelbuild/bazelisk#installation or see docs/dev/setup.md"
exit 255
fi
fi

# Check if https://pre-commit.com is available (and try to install it not)
Expand Down

0 comments on commit 305cc5c

Please sign in to comment.