{"id":15285851,"url":"https://github.com/rusterlium/rebar3_cargo","last_synced_at":"2025-04-13T02:42:46.125Z","repository":{"id":47701930,"uuid":"190832725","full_name":"rusterlium/rebar3_cargo","owner":"rusterlium","description":"Rebar3 plugin to build Rust crates","archived":false,"fork":false,"pushed_at":"2023-01-08T12:02:08.000Z","size":5284,"stargazers_count":21,"open_issues_count":2,"forks_count":14,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-13T02:42:42.152Z","etag":null,"topics":["cargo","erlang","rebar3","rust"],"latest_commit_sha":null,"homepage":"","language":"Erlang","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/rusterlium.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-08T01:36:21.000Z","updated_at":"2024-10-09T14:41:49.000Z","dependencies_parsed_at":"2023-02-08T05:45:51.659Z","dependency_job_id":null,"html_url":"https://github.com/rusterlium/rebar3_cargo","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rusterlium%2Frebar3_cargo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rusterlium%2Frebar3_cargo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rusterlium%2Frebar3_cargo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rusterlium%2Frebar3_cargo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rusterlium","download_url":"https://codeload.github.com/rusterlium/rebar3_cargo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248657858,"owners_count":21140843,"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":["cargo","erlang","rebar3","rust"],"created_at":"2024-09-30T15:07:52.405Z","updated_at":"2025-04-13T02:42:46.103Z","avatar_url":"https://github.com/rusterlium.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `rebar3_cargo`\n![CI](https://github.com/rusterlium/rebar3_cargo/workflows/CI/badge.svg)\n\nThis plugin for [`rebar3`](https://www.rebar3.org/) enables the automatic\nbuilding of Rust crates in an Erlang application.  The plugin will build all\ncrates in the `crates` directory and copy all binary outputs to\n`priv/crates/\u003ccratename\u003e/\u003cbinary\u003e`.  See the test application in this repository\nfor an example of a port program and NIF module implemented in Rust.\n\n## Todo list\n\nAs of this writing `rebar3_cargo` will build crates on\nlinux and passes tests, however it is still under construction.\n\nTodo:\n- allow cargo/rust compile flags\n- `--target` flag handling\n- Appveyor CI\n- maybe external crate support using cargo clone\n\n\n# Using the plugin\nUse the plugin by adding the following to `rebar.config`:\n\n``` erlang\n{plugins, [rebar3_cargo]}.\n\n{provider_hooks, [\n    {pre, [\n        {compile, {cargo, build}}\n    ]},\n    {post, [\n        {clean, {cargo, clean}},\n        {eunit, {cargo, test}}\n    ]}\n]}.\n```\n\nThis will automatically download and use `rebar3_cargo`.  Crates will be\ncompiled whenever the containing app is compiled.  The cargo `--release` switch\nwill be used when the `prod` profile is active.  For example:\n\n``` sh\nrebar3 as prod compile\n```\n\n# Application structure with Rust crates\nTo add crates to an Erlang application, place them in a `crates/` folder, and\nreference them in a Cargo Workspace.  All crates found within will be built and\nresulting artifacts will be placed in the `priv/crates/` folder.\n\n# Acknowledgment\nThis plugin is based on earlier work by\n[goertzenator](https://github.com/goertzenator):\n[rebar3_rust](https://github.com/goertzenator/rebar3_rust)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frusterlium%2Frebar3_cargo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frusterlium%2Frebar3_cargo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frusterlium%2Frebar3_cargo/lists"}