Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xujintao/bazel-demo
A bazel demo.
https://github.com/xujintao/bazel-demo
Last synced: about 2 months ago
JSON representation
A bazel demo.
- Host: GitHub
- URL: https://github.com/xujintao/bazel-demo
- Owner: xujintao
- License: apache-2.0
- Created: 2021-08-30T00:00:13.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-30T02:40:27.000Z (over 3 years ago)
- Last Synced: 2024-05-01T07:53:20.301Z (8 months ago)
- Language: Starlark
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Bazel Container
[Getting started with Bazel.](https://docs.bazel.build/versions/4.2.0/getting-started.html#bazel-container)
#### 1, A google account
You need a google account!
#### 2, Install Command line tool which contains gcloud
[Install Google Cloud SDK from Google.](https://cloud.google.com/sdk/docs/install)
#### 3, Pull image from Google Cloud Marketplace.
```
gcloud auth configure-docker && docker pull l.gcr.io/google/bazel:latest
```## Build monorepo with Bazel Container
#### Generate BUILD.bazel for every Golang Package
[Scans sources files, then generates and updates build files.](https://github.com/bazelbuild/bazel-gazelle#command-line)
```
./gazelle.sh
```#### Import repositories
[Import repositories from go.mod.](https://github.com/bazelbuild/bazel-gazelle#update-repos)
```
./gazelle-update-repos.sh
```#### Build
```
./build.sh
```## Conclusion
Bazel 设计思想跟 cmake 差不多,用下来的整体感觉就是非常蠢,现代构建工具应该通过分析源码自动识别出包以及包的依赖关系,而不是让用户去背诵一堆屎一样的规则然后侵入每个包手写(或者用工具生成) BUILD 文件。