We welcome any contributions. Please review our code of conduct.
The Bazel Eclipse Feature as well as the Bazel Java Language Server are developed as a set of Eclipse plug-ins. We recommend you to learn about Eclipse feature and plug-in development in general. Start with something simple before trying to tackle BEF or BJLS.
Recommended resources
You need:
- latest version of Eclipse IDE for Eclipse Committers
- JDK 17
- Bazelisk available as
bazel
binary inPATH
environment
- AnyEdit Tools
- Yaml Editor
- Bash Editor
- MoreUnit
- Eclipse Zip Editor
- Target Platform Definition Generator
- Optional: macOS Eclipse Launcher
You must always import all projects for both BEF and BJLS. Most code is in a core plug-in shared by both. As a result, modifications in the core plug-in may need adaption in BEF as well as BJLS.
After cloning the repository, follow these steps:
- Launch the Eclipse IDE for Committers with a new workspace
- Ensure JDK 17 is configured (Preferences > Java > Installed JREs)
- Click File > Import > General > Existing Projects into Workspace
- Select the
bazel-eclipse
folder as the root directory - Select Search for nested projects (critical step)
- Eclipse should detect that the projects are there, and offer to import them all (checked by default).
- Click Finish and wait
There will be errors. This is expected at this point. You need to setup the target platform next.
- Open file
bazel-eclipse/releng/target-platform/target-platform-dev.target
- Click the Set as Active Target Platform link in the upper right (or Reload Target Platform)
This will run for a long time and download any necessary plug-ins/jars. Once done everything should build.
🔥 If you see errors at this point, please search/see discussions for help.
Import IntelliJ Aspects
- In Eclipse main meny select to Run > External Tools > Import InteliJ Aspects
This will download the IntelliJ Aspects and puts them into a ZIP file for use.
We don't distribute them in our source control.
Note, the shell script requires a working Git and Bazel binary in the PATH
.
On MacOS, GNU Tar (gtar
) is needed as well.
A common development task is debugging the Bazel Eclipse Feature code. In Eclipse this is done using Debug configurations. For creating a new Debug configuration use the following steps.
- Go to Run > Debug Configurations... (top level menu or toolbar icon)
- Right click on Eclipse Application and select New Configuration
- Give it a name: Bazel Eclipse
- Leave everything as default and click Debug
This should open a second window of Eclipse. Use the second instance to import a Bazel workspace and test the Bazel Eclipse Feature. Continue using the first instance with the Bazel Eclipse Feature code for setting breakpoints, etc. This is called self-hosting.
We use GitHub Actions for our CI system.
This is explained in more detail in the build guide.