{"id":19532410,"url":"https://github.com/rain1024/mono-bazel","last_synced_at":"2026-03-19T10:19:25.575Z","repository":{"id":246887988,"uuid":"823585112","full_name":"rain1024/mono-bazel","owner":"rain1024","description":"Mono Repository with Bazel","archived":false,"fork":false,"pushed_at":"2024-07-17T20:44:51.000Z","size":8692,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-08T17:07:47.880Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Starlark","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rain1024.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-07-03T10:05:04.000Z","updated_at":"2024-08-08T16:20:21.000Z","dependencies_parsed_at":"2024-07-05T19:14:22.546Z","dependency_job_id":"aeeaec43-d800-4869-b6d8-dd89bc93b930","html_url":"https://github.com/rain1024/mono-bazel","commit_stats":null,"previous_names":["rain1024/mono-bazel"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rain1024%2Fmono-bazel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rain1024%2Fmono-bazel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rain1024%2Fmono-bazel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rain1024%2Fmono-bazel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rain1024","download_url":"https://codeload.github.com/rain1024/mono-bazel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240784237,"owners_count":19856980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-11T01:50:50.905Z","updated_at":"2026-03-03T19:02:14.083Z","avatar_url":"https://github.com/rain1024.png","language":"Starlark","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mono Bazel\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/rain1024/mono-bazel/\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/rain1024/mono-bazel/main/images/system-design.png\" height=\"300\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n[Bazel](https://bazel.build/) is an excellent build and test tool. It is designed to handle projects of any size, supporting multiple languages and platforms. Bazel helps developers to automate the build process, ensuring high performance, reliability, and scalability.\n\nThis repository is dedicated to providing useful instructions on how to use Bazel in real projects across different programming languages. It includes:\n\n- **Setup guides** for installing and configuring Bazel.\n- **Sample projects** in Kotlin, Python, Java, and Rust to demonstrate practical use cases.\n- **Best practices** for structuring Bazel projects and managing dependencies.\n- **Troubleshooting tips** to help resolve common issues encountered during the build process.\n\n## Getting Started\n\nTo quickly get started with Bazel, use [Bazelisk](https://github.com/bazelbuild/bazelisk). Bazelisk is a wrapper for Bazel that automatically downloads and installs the correct Bazel version specified in your project.\n\n```\n$ curl -Lo bazelisk https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64\n$ chmod u+x bazelisk\n$ sudo mv bazelisk /usr/local/bin/bazel\n$ bazel version\n\nBazelisk version: v1.20.0\nWARNING: Invoking Bazel in batch mode since it is not invoked from within a workspace (below a directory having a WORKSPACE file).\nOpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.\nBuild label: 7.2.1\nBuild target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer\nBuild time: Tue Jun 25 15:53:05 2024 (1719330785)\nBuild timestamp: 1719330785\nBuild timestamp as int: 1719330785\n```\n\n**Creating a `Cute` application with Bazel**\n\nIn this section, we’ll build a simple Bazel project named [`cute`](https://github.com/rain1024/mono-bazel/tree/main/projects/cute). Every project in Bazel includes a `BUILD` file that provides instructions for compiling, testing, and packaging code. In this project, we use a [`genrule`](https://bazel.build/reference/be/general#genrule) to execute custom shell commands and generate files from specified inputs.\n\n```\ngenrule(\n    name = \"cute\",\n    srcs = [\"input.txt\"],\n    outs = [\"output.txt\"],\n    cmd = \"\"\"\n        cat $(SRCS) \u003e $(OUTS) \u0026\u0026 \\\n        echo 'Look at you, all cute and ready to build! 💖' \u003e\u003e $(OUTS)\n    \"\"\"\n)\n```\n\nThis rule concatenates the contents of `input.txt` into `output.txt` and appends a charming message, ensuring your build process is both efficient and adorable.\n\nTo build the project, use the following Bazel command:\n\n```sh\n$ bazel build //projects/cute\n\nINFO: Analyzed target //projects/cute:cute (1 packages loaded, 2 targets configured).\nINFO: Found 1 target...\nTarget //projects/cute:cute up-to-date:\n  bazel-bin/projects/cute/output.txt\nINFO: Elapsed time: 0.066s, Critical Path: 0.00s\nINFO: 1 process: 1 internal.\nINFO: Build completed successfully, 1 total action\n```\n\nAfter building, you can view the content of the generated output file with:\n\n```sh\n$ cat bazel-bin/projects/cute/output.txt\nHey Bazel! 🛠️\nLook at you, all cute and ready to build! 💖\n```\n\n**Congratulations!** You’ve successfully built and run your first Bazel application. 🎉\n\n## Build more awesome applications with Bazel\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\n        \u003cimg\n          src=\"https://raw.githubusercontent.com/rain1024/mono-bazel/main/images/python.png\"\n          alt=\"Python Example\"\n          height=\"150\"/\u003e\n        \u003cbr/\u003e\n        \u003ca href=\"https://github.com/rain1024/mono-bazel/tree/python\"\u003ePython Example\u003c/a\u003e\n        \u003cbr/\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\n        \u003cimg\n          src=\"https://raw.githubusercontent.com/rain1024/mono-bazel/main/images/kotlin.png\"\n          alt=\"Kotlin Example\"\n          height=\"150\"/\u003e\n        \u003cbr/\u003e\n        \u003ca href=\"https://github.com/rain1024/mono-bazel/tree/kotlin\"\u003eKotlin Example\u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\n        \u003cimg\n          src=\"https://raw.githubusercontent.com/rain1024/mono-bazel/main/images/java.png\"\n          alt=\"Java Example\"\n          height=\"150\"/\u003e\n        \u003cbr/\u003e\n        \u003ca href=\"https://github.com/rain1024/mono-bazel/tree/java\"\u003eJava Example\u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frain1024%2Fmono-bazel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frain1024%2Fmono-bazel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frain1024%2Fmono-bazel/lists"}