@@ -6,9 +6,8 @@ especially for toolchain and rule developers.
6
6
7
7
## Quick start
8
8
9
- The ` scala_config ` module extension (or` WORKSPACE ` macro) creates the
10
- ` @io_bazel_rules_scala_config ` repository. It accepts two parameters that
11
- specify the the Scala versions supported within the project:
9
+ The ` scala_config ` module extension (or` WORKSPACE ` macro) accepts two parameters
10
+ that specify the the Scala versions supported within the project:
12
11
13
12
- ` scala_version ` – a single default version
14
13
- ` scala_versions ` – a list of versions supported or required by the project
@@ -54,8 +53,6 @@ scala_config(
54
53
)
55
54
```
56
55
57
-
58
-
59
56
The first parameter, ` scala_version ` , defines the default version of Scala to
60
57
use when building the project. Values from ` scala_versions ` can override the
61
58
default in one of two ways:
90
87
## Version configuration
91
88
92
89
The ` scala_config ` module extension (or ` WORKSPACE ` macro) creates the
93
- ` @io_bazel_rules_scala_config ` repository. Its generated ` config.bzl ` file
94
- contains several variables, including:
90
+ ` @rules_scala_config ` repository. Its generated ` config.bzl ` file contains
91
+ several variables, including:
95
92
96
93
- ` SCALA_VERSION ` – representing the default Scala version, e.g., ` "3.3.1" `
97
94
- ` SCALA_VERSIONS ` – representing all configured Scala versions, e.g.,
@@ -105,8 +102,8 @@ value.
105
102
106
103
### ` scala_version `
107
104
108
- The root package of ` @io_bazel_rules_scala_config ` defines the following build
109
- setting (specifically, a [ 'string_setting()' from '@bazel_skylib'] (
105
+ The root package of ` @rules_scala_config ` defines the following build setting
106
+ (specifically, a [ 'string_setting()' from '@bazel_skylib'] (
110
107
https://github.com/bazelbuild/bazel-skylib/blob/1.7.1/docs/common_settings_doc.md#string_setting )):
111
108
112
109
``` py
@@ -199,7 +196,7 @@ See the complete documentation in the [scala_cross_version_select.bzl](
199
196
200
197
``` py
201
198
deps = select({
202
- " @io_bazel_rules_scala_config //:scala_version_3_3_1" : [... ],
199
+ " @rules_scala_config //:scala_version_3_3_1" : [... ],
203
200
...
204
201
})
205
202
```
@@ -218,15 +215,13 @@ and then `load()` the macro in a `BUILD` file:
218
215
219
216
``` py
220
217
load(" :my_macros.bzl" , " srcs" )
221
- load(" @io_bazel_rules_scala_config//:config.bzl" , " SCALA_VERSIONS" )
222
218
load(" @rules_scala//:scala_cross_version.bzl" , " version_suffix" )
223
-
224
- _SCALA_VERSION_SETTING_PREFIX = " @io_bazel_rules_scala_config//:scala_version"
219
+ load(" @rules_scala_config//:config.bzl" , " SCALA_VERSIONS" )
225
220
226
221
scala_library(
227
222
...
228
223
srcs = select({
229
- SCALA_VERSION_SETTING_PREFIX + version_suffix(v): srcs(v)
224
+ " @rules_scala_config//:scala_version " + version_suffix(v): srcs(v)
230
225
for v in SCALA_VERSIONS
231
226
}),
232
227
...
@@ -244,14 +239,14 @@ configured.
244
239
``` py
245
240
def _scala_version_transition_impl (settings , attr ):
246
241
if attr.scala_version:
247
- return {" @io_bazel_rules_scala_config //:scala_version" : attr.scala_version}
242
+ return {" @rules_scala_config //:scala_version" : attr.scala_version}
248
243
else :
249
244
return {}
250
245
251
246
scala_version_transition = transition(
252
247
implementation = _scala_version_transition_impl,
253
248
inputs = [],
254
- outputs = [" @io_bazel_rules_scala_config //:scala_version" ],
249
+ outputs = [" @rules_scala_config //:scala_version" ],
255
250
)
256
251
```
257
252
@@ -328,7 +323,7 @@ https://bazel.build/reference/be/platforms-and-toolchains#toolchain) rule:
328
323
``` py
329
324
toolchain(
330
325
...
331
- target_settings = [" @io_bazel_rules_scala_config //:scala_version_3_3_1" ],
326
+ target_settings = [" @rules_scala_config //:scala_version_3_3_1" ],
332
327
...
333
328
)
334
329
```
0 commit comments