{"id":21037696,"url":"https://github.com/xujintao/bazel-demo","last_synced_at":"2026-04-02T01:37:26.626Z","repository":{"id":237393348,"uuid":"401167534","full_name":"xujintao/bazel-demo","owner":"xujintao","description":"A bazel demo.","archived":false,"fork":false,"pushed_at":"2021-08-30T02:40:27.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-02T10:54:55.662Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Starlark","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xujintao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-30T00:00:13.000Z","updated_at":"2021-08-30T02:40:30.000Z","dependencies_parsed_at":"2024-05-01T07:53:26.351Z","dependency_job_id":"038d72a1-9f5c-4879-89fc-01a6ccec07d0","html_url":"https://github.com/xujintao/bazel-demo","commit_stats":null,"previous_names":["xujintao/bazel-demo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xujintao/bazel-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xujintao%2Fbazel-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xujintao%2Fbazel-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xujintao%2Fbazel-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xujintao%2Fbazel-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xujintao","download_url":"https://codeload.github.com/xujintao/bazel-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xujintao%2Fbazel-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31293986,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:05:07.454Z","status":"ssl_error","status_checked_at":"2026-04-02T00:56:46.496Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T13:27:35.274Z","updated_at":"2026-04-02T01:37:26.610Z","avatar_url":"https://github.com/xujintao.png","language":"Starlark","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Bazel Container\n\n[Getting started with Bazel.](https://docs.bazel.build/versions/4.2.0/getting-started.html#bazel-container)\n\n#### 1, A google account\n\nYou need a google account!\n\n#### 2, Install Command line tool which contains gcloud\n\n[Install Google Cloud SDK from Google.](https://cloud.google.com/sdk/docs/install)\n\n#### 3, Pull image from Google Cloud Marketplace.\n\n```\ngcloud auth configure-docker \u0026\u0026 docker pull l.gcr.io/google/bazel:latest\n```\n\n## Build monorepo with Bazel Container\n\n#### Generate BUILD.bazel for every Golang Package\n\n[Scans sources files, then generates and updates build files.](https://github.com/bazelbuild/bazel-gazelle#command-line)\n\n```\n./gazelle.sh\n```\n\n#### Import repositories\n\n[Import repositories from go.mod.](https://github.com/bazelbuild/bazel-gazelle#update-repos)\n\n```\n./gazelle-update-repos.sh\n```\n\n#### Build\n\n```\n./build.sh\n```\n\n## Conclusion\n\nBazel 设计思想跟 cmake 差不多，用下来的整体感觉就是非常蠢，现代构建工具应该通过分析源码自动识别出包以及包的依赖关系，而不是让用户去背诵一堆屎一样的规则然后侵入每个包手写（或者用工具生成） BUILD 文件。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxujintao%2Fbazel-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxujintao%2Fbazel-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxujintao%2Fbazel-demo/lists"}