Skip to content

Commit 9963417

Browse files
committed
Update README for v3
1 parent 2c0ced9 commit 9963417

File tree

1 file changed

+32
-9
lines changed

1 file changed

+32
-9
lines changed

README.md

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@ Bazel rules for Erlang sources
77
### `WORKSPACE` file
88

99
```starlark
10+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
11+
12+
http_archive(
13+
name = "bazel_skylib",
14+
sha256 = "af87959afe497dc8dfd4c6cb66e1279cb98ccc84284619ebfec27d9c09a903de",
15+
urls = [
16+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.2.0/bazel-skylib-1.2.0.tar.gz",
17+
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.2.0/bazel-skylib-1.2.0.tar.gz",
18+
],
19+
)
20+
21+
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
22+
23+
bazel_skylib_workspace()
24+
1025
http_archive(
1126
name = "rules_erlang",
1227
sha256 = "ce4b3b028c8d77e2175767c19d69636d78fa13fdb11279d70f3c2ab01bc32953",
@@ -17,6 +32,10 @@ http_archive(
1732
load("@rules_erlang//:rules_erlang.bzl", "rules_erlang_dependencies")
1833

1934
rules_erlang_dependencies()
35+
36+
register_toolchains(
37+
"@rules_erlang//:erlang_toolchain_external",
38+
)
2039
```
2140

2241
### `BUILD` file
@@ -51,34 +70,38 @@ assert_suites([
5170
])
5271
```
5372

73+
### `.bazelrc` file
74+
75+
```shell
76+
build --@rules_erlang//:erlang_home=/path/to/erlang
77+
build --@rules_erlang//:erlang_version=23.2
78+
79+
build --platforms=@rules_erlang//:erlang_external_platform
80+
build --extra_execution_platforms=@rules_erlang//:erlang_external_platform
81+
```
82+
5483
### Compile and run all tests
5584

5685
```shell
57-
bazel test //... \
58-
--@rules_erlang//:erlang_home=/path/to/erlang \
59-
--@rules_erlang//:erlang_version=23.2
86+
bazel test //...
6087
```
6188

6289
### Run the unit suite only
6390

6491
```shell
65-
bazel test //:unit_SUITE \
66-
--@rules_erlang//:erlang_home=/path/to/erlang \
67-
--@rules_erlang//:erlang_version=23.2
92+
bazel test //:unit_SUITE
6893
```
6994

7095
### Run a single test case
7196

7297
```shell
7398
bazel test //:unit_SUITE \
74-
--@rules_erlang//:erlang_home=/path/to/erlang \
75-
--@rules_erlang//:erlang_version=23.2 \
7699
--test_env FOCUS="-group my_group -case my_case"
77100
```
78101

79102
## Assumptions
80103

81-
`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 `erlc`, `app_file`, `erlang_app_info` & `ct_test` rules which those macros utilize). For an erlang application named `my_erlang_app` this means:
104+
`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:
82105

83106
```
84107
my_erlang_app

0 commit comments

Comments
 (0)