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 Dec 9, 2023
1 parent 62188e7 commit 5022ec0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 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
22 changes: 19 additions & 3 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. We recommend using VSC.
Expand All @@ -32,7 +34,8 @@ Eclipse is not actively supported by this project as an IDE. We recommend using

* [VSC Bazel](https://marketplace.visualstudio.com/items?itemName=BazelBuild.vscode-bazel) for syntax highlighting, linting and formatting `BUILD` files

* [VSC Bazel for Java, by Salesforce](https://marketplace.visualstudio.com/items?itemName=sfdc.bazel-vscode-java) for Java support (it's **awesome,** and much better than [alternatives](https://github.com/vorburger/LearningBazel/blob/85aee3c956cbb84c8cd7d4f317be8ac36b62bad8/ToDo.md)). You may have to right-click on (the right "level" of) some folders to _Synchronize Projects with Bazel View_ to resolve weird initial problems like e.g. _Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor._ or _The import cannot be resolved._ or _cannot be resolved to a type_ or _The method is undefined for the type_ etc.
* [VSC Bazel for Java, by Salesforce](https://marketplace.visualstudio.com/items?itemName=sfdc.bazel-vscode-java) for Java support (it's **awesome,** and much better than [alternatives](https://github.com/vorburger/LearningBazel/blob/85aee3c956cbb84c8cd7d4f317be8ac36b62bad8/ToDo.md)). You may have to right-click on (the right "level" of) some folders to _Synchronize Projects with Bazel View_ to resolve weird initial problems (like e.g. _Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor._ or _The import cannot be resolved._ or _cannot be resolved to a type_ or _The method is undefined for the type_ etc.). If that menu is not
available (yet), then first click _Import Projects_ in the _Java Projects_ view (tab) of the VSC _Explorer._

* [google-java-format](https://marketplace.visualstudio.com/search?term=google-java-format&target=VSCode&category=All%20categories&sortBy=Relevance) TODO pick which one of the 8 to use 😸

Expand All @@ -55,8 +58,21 @@ Eclipse is not actively supported by this project as an IDE. We recommend using

## 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
7 changes: 6 additions & 1 deletion test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ 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
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

# https://github.com/bazelbuild/bazel/issues/4257
Expand Down

0 comments on commit 5022ec0

Please sign in to comment.