Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rabbitmq/rules_erlang
Bazel rules for building Erlang applications and libraries
https://github.com/rabbitmq/rules_erlang
bazel bazel-rules erlang
Last synced: about 7 hours ago
JSON representation
Bazel rules for building Erlang applications and libraries
- Host: GitHub
- URL: https://github.com/rabbitmq/rules_erlang
- Owner: rabbitmq
- License: other
- Created: 2020-12-07T14:37:53.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-16T16:03:05.000Z (2 months ago)
- Last Synced: 2024-09-16T19:29:53.073Z (2 months ago)
- Topics: bazel, bazel-rules, erlang
- Language: Starlark
- Homepage:
- Size: 1.34 MB
- Stars: 37
- Watchers: 12
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# rules_erlang
Bazel rules for Erlang sources
## Examples
See [basic](examples/basic/)
## Typical rules
### Compile and run all tests
```shell
bazel test //...
```### Run the unit suite only
```shell
bazel test //:unit_SUITE
```### Run a single test case
```shell
bazel test //:unit_SUITE \
--test_env FOCUS="-group my_group -case my_case"
```## Assumptions
`erlang_app` and `ct_suite` macros require the standard otp layout, relative to the bazel package (to some degree abitrary layout can be handled with with the `erlang_bytecode`, `app_file`, `erlang_app_info` & `ct_test` rules which those macros utilize). For an erlang application named `my_erlang_app` this means:
```
my_erlang_app
├── BUILD.bazel
├── include
│ ├── ...
│ └── my_header.hrl
├── priv
│ └── schema
├── src
│ ├── ...
│ └── my_erlang_app.erl
└── test
├── ...
└── unit_SUITE.erl
```And that the convention is followed where, using the `dest` attribute of the `erlang_bytecode` rule:
1. Compiled production bytecode is placed in `ebin`
2. Compiled test bytecode is placed in `src`
3. Compiled test suite and test helper bytecode is placed in `test`The example above follows these conventions.
## Additional examples
- https://github.com/rabbitmq/lz4-erlang uses rules_erlang with bzlmod and compiles native extensions
- https://github.com/rabbitmq/rabbitmq-server provides a complex example of usage## Copyright and License
(c) 2020-2023 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. All rights reserved.
Dual licensed under the Apache License Version 2.0 and
Mozilla Public License Version 2.0.This means that the user can consider the library to be licensed under
**any of the licenses from the list** above. For example, you may
choose the Apache Public License 2.0 and include this library into a
commercial product.See [LICENSE](./LICENSE) for details.