Hello every this is real-life example of monorepository with Bazel and go-modules
- Install Bazel - https://docs.bazel.build/versions/master/install.html
- Install Go Modules
go mod download
All applications inside packages folder:
- Main App
- Second app
Build:
bazel build //packages/main_app:main_app
Bin will be here:
bazel-bin/packages/main_app/darwin_amd64_stripped/main_app
Test:
bazel test //packages/main_app/...:all
Build:
bazel build //packages/second_app:second_app
Bin will be here:
bazel-bin/packages/second_app/darwin_amd64_stripped/second_app
Test:
bazel test //packages/second_app/...:all
Test:
bazel test //packages/...:all