An implementation of the Build Server Protocol for Bazel.
Below is a list of languages supported over Bazel BSP and their implementation status.
- Language: name of the Language
- Import: Ability to import a project's targets, sources, dependencies, and resources.
- Compilation: Ability to compile
- Run: Ability to run
- Test: Ability to test
Language | Import | Compilation | Run | Test | Diagnostics |
---|---|---|---|---|---|
Scala | ✅ | ✅ | ✅ | ✅ | ✅ |
Java | ✅ | ✅ | ✅ | ✅ | ✅ |
Kotlin | ✅ | ✅ | ✅ | ✅ | ✅ |
- Have coursier installed
- Run in the directory where Bazel BSP should be installed:
cs launch org.jetbrains.bsp:bazel-bsp:2.1.0 -M org.jetbrains.bsp.bazel.install.Install
- Add bsp generated folders to your
.gitignore
:.bsp
and.bazelbsp
Might be useful during development
- Be inside this project
- Run
./install.sh <installer flags>
(--help
is available)
- Have coursier installed
- Be inside this project
- Change the project version -
maven_coordinates
attribute in theserver/src/main/java/org/jetbrains/bsp/bazel/BUILD
file - Publish a new version:
bazel run --stamp --define "maven_repo=file://$HOME/.m2/repository" //server/src/main/java/org/jetbrains/bsp/bazel:bsp.publish
- Enter directory where Bazel BSP should be installed
- Install your version:
cs launch -r m2Local org.jetbrains.bsp:bazel-bsp:<your version> -M org.jetbrains.bsp.bazel.install.Install
In order to work on huge monorepos you might want to specify directories and targets to work on. To address this issue, Bazel BSP supports (partly) the Project Views introduced by Google.
Check project view readme for more info.
e2e
directory contains end-2-end tests that check various scenarios of server usage.
bazel run //e2e:all
- to run all testsbazel run //e2e:<specific test>
- to run a specific test (to see all possible tests, check thee2e/BUILD
file)
Most modules also have unit tests that can be run using bazel test //<module>/...
or just bazel test //...
to run
all tests in the project.
Want to contribute? Great! Follow these rules.