{"id":15674155,"url":"https://github.com/chenrui333/rules_avro","last_synced_at":"2025-10-29T02:49:47.426Z","repository":{"id":40492741,"uuid":"91302940","full_name":"chenrui333/rules_avro","owner":"chenrui333","description":"🍃 bazel rules for generating code from avro schemas","archived":false,"fork":false,"pushed_at":"2025-10-17T18:57:03.000Z","size":78,"stargazers_count":14,"open_issues_count":16,"forks_count":32,"subscribers_count":68,"default_branch":"master","last_synced_at":"2025-10-19T11:19:50.415Z","etag":null,"topics":["avro","bazel","bazel-rules"],"latest_commit_sha":null,"homepage":"","language":"Starlark","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chenrui333.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-05-15T06:33:29.000Z","updated_at":"2025-09-08T00:15:07.000Z","dependencies_parsed_at":"2024-01-19T01:38:40.516Z","dependency_job_id":"f8805ea9-81e0-4713-9ff7-da5ec2467310","html_url":"https://github.com/chenrui333/rules_avro","commit_stats":{"total_commits":57,"total_committers":16,"mean_commits":3.5625,"dds":0.7543859649122807,"last_synced_commit":"2a21424112d8632bf6c0a4c6957506e073a1dd87"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chenrui333/rules_avro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenrui333%2Frules_avro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenrui333%2Frules_avro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenrui333%2Frules_avro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenrui333%2Frules_avro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chenrui333","download_url":"https://codeload.github.com/chenrui333/rules_avro/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenrui333%2Frules_avro/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281549790,"owners_count":26520515,"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","status":"online","status_checked_at":"2025-10-29T02:00:06.901Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["avro","bazel","bazel-rules"],"created_at":"2024-10-03T15:43:43.576Z","updated_at":"2025-10-29T02:49:47.394Z","avatar_url":"https://github.com/chenrui333.png","language":"Starlark","funding_links":[],"categories":["Starlark"],"sub_categories":[],"readme":"# bazel avro rules \u003c!-- omit in toc --\u003e\n\n[![Build Status](https://travis-ci.org/chenrui333/rules_avro.svg?branch=master)](https://travis-ci.org/chenrui333/rules_avro)\n\n\u003e [Bazel](https://bazel.build/) rules for generating java sources and libraries from [avro](https://avro.apache.org/) schemas\n\n## Rules\n\n- [Rules](#rules)\n- [Getting started](#getting-started)\n- [avro_gen](#avro_gen)\n- [avro_java_library](#avro_java_library)\n\n## Getting started\n\nTo use the Avro rules, add the following to your projects `WORKSPACE` file\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# rules_avro depends on aspect_bazel_lib: https://github.com/bazel-contrib/bazel-lib\nhttp_archive(\n    name = \"aspect_bazel_lib\",\n    sha256 = \"63ae96db9b9ea3821320e4274352980387dc3218baeea0387f7cf738755d0f16\",\n    strip_prefix = \"bazel-lib-2.19.1\",\n    url = \"https://github.com/bazel-contrib/bazel-lib/releases/download/v2.19.1/bazel-lib-v2.19.1.tar.gz\",\n)\n\nload(\"@aspect_bazel_lib//lib:repositories.bzl\", \"aspect_bazel_lib_dependencies\", \"aspect_bazel_lib_register_toolchains\")\n\n# Required bazel-lib dependencies\n\naspect_bazel_lib_dependencies()\n\n# Required rules_shell dependencies\nload(\"@rules_shell//shell:repositories.bzl\", \"rules_shell_dependencies\", \"rules_shell_toolchains\")\n\nrules_shell_dependencies()\n\nrules_shell_toolchains()\n\n# Register bazel-lib toolchains\n\naspect_bazel_lib_register_toolchains()\n\n# Create the host platform repository transitively required by bazel-lib\n\nload(\"@bazel_tools//tools/build_defs/repo:utils.bzl\", \"maybe\")\nload(\"@platforms//host:extension.bzl\", \"host_platform_repo\")\n\nmaybe(\n    host_platform_repo,\n    name = \"host_platform\",\n)\n\n# rules_avro depends on rules_jvm_external: https://github.com/bazelbuild/rules_jvm_external\nRULES_JVM_EXTERNAL_TAG = \"4.1\"\nRULES_JVM_EXTERNAL_SHA = \"f36441aa876c4f6427bfb2d1f2d723b48e9d930b62662bf723ddfb8fc80f0140\"\n\nhttp_archive(\n    name = \"rules_jvm_external\",\n    sha256 = RULES_JVM_EXTERNAL_SHA,\n    strip_prefix = \"rules_jvm_external-%s\" % RULES_JVM_EXTERNAL_TAG,\n    url = \"https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip\" % RULES_JVM_EXTERNAL_TAG,\n)\n\n\nRULES_AVRO_VERSION = \"96670d5c4a0a3e0f25f4177336e1fa94eba8be5a\"\nRULES_AVRO_SHA256 = \"3bd69872ec72904e843762f7b3532fd1125215503a635a24f6c8037c75b299bc\"\n\nhttp_archive(\n    name = \"io_bazel_rules_avro\",\n    strip_prefix = \"rules_avro-%s\" % RULES_AVRO_VERSION,\n    url = \"https://github.com/chenrui333/rules_avro/archive/%s.tar.gz\" % RULES_AVRO_VERSION,\n    sha256 = RULES_AVRO_SHA256\n)\n\nload(\"@io_bazel_rules_avro//avro:avro.bzl\", \"avro_repositories\")\navro_repositories()\n# or specify a version\navro_repositories(version = \"1.9.1\")\n```\n\nThen in your `BUILD` file, just add the following so the rules will be available:\n\n```python\nload(\"@io_bazel_rules_avro//avro:avro.bzl\", \"avro_gen\", \"avro_java_library\")\n```\n\n## avro_gen\n\n```python\navro_gen(name, srcs, strings, encoding)\n```\n\nGenerates `.srcjar` containing generated `.java` source files from a collection of `.avsc` schemas\n\n\u003ctable class=\"table table-condensed table-bordered table-params\"\u003e\n  \u003ccolgroup\u003e\n    \u003ccol class=\"col-param\" /\u003e\n    \u003ccol class=\"param-description\" /\u003e\n  \u003c/colgroup\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth colspan=\"2\"\u003eAttributes\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003ccode\u003eName, required\u003c/code\u003e\n        \u003cp\u003eA unique name for this rule.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003esrcs\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003ccode\u003eList of labels, required\u003c/code\u003e\n        \u003cp\u003e\n          List of \u003ccode\u003e.avsc\u003c/code\u003e files used as inputs for code generation\n        \u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003estrings\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003ccode\u003eBoolean, optional\u003c/code\u003e\n        \u003cp\u003euse \u003ccode\u003ejava.lang.String\u003c/code\u003e instead of \u003ccode\u003eUtf8\u003c/code\u003e.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eencoding\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003ccode\u003eString, optional\u003c/code\u003e\n        \u003cp\u003eset the encoding of output files.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eavro_tools\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003ccode\u003eLabel, optional\u003c/code\u003e\n        \u003cp\u003eLabel to the runnable Avro tools jar. Default, uses the tools jar associated with the downloaded avro\n        version via `avro_repository`\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n## avro_java_library\n\n```python\navro_java_library(name, srcs, strings, encoding)\n```\n\nSame as above except\n  * instead of `avro_tools`, provide `avro_libs` as a dict(core, tools) of Labels for the avro libraries.\n    * See tests for an example the re-uses the downloaded library explicitly\n  * the outputs include those provided by `java_library` rules.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenrui333%2Frules_avro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchenrui333%2Frules_avro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenrui333%2Frules_avro/lists"}