Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 98f2e00

Browse files
test
1 parent 4bdf33a commit 98f2e00

File tree

13 files changed

+134
-4
lines changed

13 files changed

+134
-4
lines changed

‎README.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ http_archive(
4747
],
4848
)
4949

50+
http_archive(
51+
name = "bazel_features",
52+
sha256 = "d7787da289a7fb497352211ad200ec9f698822a9e0757a4976fd9f713ff372b3",
53+
strip_prefix = "bazel_features-1.9.1",
54+
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.9.1/bazel_features-v1.9.1.tar.gz",
55+
)
56+
5057
# See https://github.com/bazelbuild/rules_scala/releases for up to date version information.
5158
http_archive(
5259
name = "io_bazel_rules_scala",
@@ -74,6 +81,9 @@ rules_scala_setup()
7481
# defining a custom deps toolchains to use your project libs instead
7582
rules_scala_toolchain_deps_repositories(fetch_sources = True)
7683

84+
load("@bazel_features//:deps.bzl", "bazel_features_deps")
85+
bazel_features_deps()
86+
7787
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
7888
rules_proto_dependencies()
7989
rules_proto_toolchains()
@@ -151,6 +161,9 @@ dependency providers configured for `2.11.12`, `2.12.18` and `2.13.12` versions.
151161
load("@io_bazel_rules_scala//:scala_config.bzl", "scala_config")
152162
scala_config(scala_version = "2.13.12")
153163

164+
load("@bazel_features//:deps.bzl", "bazel_features_deps")
165+
bazel_features_deps()
166+
154167
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
155168
rules_proto_dependencies()
156169
rules_proto_toolchains()

‎WORKSPACE‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
1515

1616
bazel_skylib_workspace()
1717

18+
http_archive(
19+
name = "bazel_features",
20+
sha256 = "d7787da289a7fb497352211ad200ec9f698822a9e0757a4976fd9f713ff372b3",
21+
strip_prefix = "bazel_features-1.9.1",
22+
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.9.1/bazel_features-v1.9.1.tar.gz",
23+
)
24+
25+
load("@bazel_features//:deps.bzl", "bazel_features_deps")
26+
27+
bazel_features_deps()
28+
1829
_build_tools_release = "5.1.0"
1930

2031
http_archive(

‎examples/scala3/WORKSPACE‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ http_archive(
1111
],
1212
)
1313

14+
http_archive(
15+
name = "bazel_features",
16+
sha256 = "d7787da289a7fb497352211ad200ec9f698822a9e0757a4976fd9f713ff372b3",
17+
strip_prefix = "bazel_features-1.9.1",
18+
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.9.1/bazel_features-v1.9.1.tar.gz",
19+
)
20+
21+
load("@bazel_features//:deps.bzl", "bazel_features_deps")
22+
23+
bazel_features_deps()
24+
1425
local_repository(
1526
name = "io_bazel_rules_scala",
1627
path = "../..",

‎examples/semanticdb/WORKSPACE‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ http_archive(
1414
],
1515
)
1616

17+
http_archive(
18+
name = "bazel_features",
19+
sha256 = "d7787da289a7fb497352211ad200ec9f698822a9e0757a4976fd9f713ff372b3",
20+
strip_prefix = "bazel_features-1.9.1",
21+
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.9.1/bazel_features-v1.9.1.tar.gz",
22+
)
23+
24+
load("@bazel_features//:deps.bzl", "bazel_features_deps")
25+
26+
bazel_features_deps()
27+
1728
local_repository(
1829
name = "io_bazel_rules_scala",
1930
path = "../..",

‎examples/testing/multi_frameworks_toolchain/WORKSPACE‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ http_archive(
1111
],
1212
)
1313

14+
http_archive(
15+
name = "bazel_features",
16+
sha256 = "d7787da289a7fb497352211ad200ec9f698822a9e0757a4976fd9f713ff372b3",
17+
strip_prefix = "bazel_features-1.9.1",
18+
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.9.1/bazel_features-v1.9.1.tar.gz",
19+
)
20+
21+
load("@bazel_features//:deps.bzl", "bazel_features_deps")
22+
23+
bazel_features_deps()
24+
1425
local_repository(
1526
name = "io_bazel_rules_scala",
1627
path = "../../..",

‎examples/testing/scalatest_repositories/WORKSPACE‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ http_archive(
1111
],
1212
)
1313

14+
http_archive(
15+
name = "bazel_features",
16+
sha256 = "d7787da289a7fb497352211ad200ec9f698822a9e0757a4976fd9f713ff372b3",
17+
strip_prefix = "bazel_features-1.9.1",
18+
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.9.1/bazel_features-v1.9.1.tar.gz",
19+
)
20+
21+
load("@bazel_features//:deps.bzl", "bazel_features_deps")
22+
23+
bazel_features_deps()
24+
1425
local_repository(
1526
name = "io_bazel_rules_scala",
1627
path = "../../..",

‎examples/testing/specs2_junit_repositories/WORKSPACE‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ http_archive(
1111
],
1212
)
1313

14+
http_archive(
15+
name = "bazel_features",
16+
sha256 = "d7787da289a7fb497352211ad200ec9f698822a9e0757a4976fd9f713ff372b3",
17+
strip_prefix = "bazel_features-1.9.1",
18+
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.9.1/bazel_features-v1.9.1.tar.gz",
19+
)
20+
21+
load("@bazel_features//:deps.bzl", "bazel_features_deps")
22+
23+
bazel_features_deps()
24+
1425
local_repository(
1526
name = "io_bazel_rules_scala",
1627
path = "../../..",

‎scala/private/common_attributes.bzl‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Shared attributes for rules"""
22

3+
load("@bazel_features//:features.bzl", "bazel_features")
34
load(
45
"@io_bazel_rules_scala//scala/private:coverage_replacements_provider.bzl",
56
_coverage_replacements_provider = "coverage_replacements_provider",
@@ -48,7 +49,10 @@ common_attrs_for_plugin_bootstrapping = {
4849
default = False,
4950
mandatory = False,
5051
),
51-
}
52+
} | ({
53+
"add_exports": attr.string_list(),
54+
"add_opens": attr.string_list(),
55+
} if bazel_features.java.java_info_constructor_module_flags else {})
5256

5357
common_attrs = {}
5458

‎scala/private/macros/scala_repositories.bzl‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@ def rules_scala_setup(scala_compiler_srcjar = None):
9292
],
9393
)
9494

95+
if not native.existing_rule("bazel_features"):
96+
http_archive(
97+
name = "bazel_features",
98+
sha256 = "d7787da289a7fb497352211ad200ec9f698822a9e0757a4976fd9f713ff372b3",
99+
strip_prefix = "bazel_features-1.9.1",
100+
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.9.1/bazel_features-v1.9.1.tar.gz",
101+
)
102+
95103
if not native.existing_rule("rules_cc"):
96104
http_archive(
97105
name = "rules_cc",

‎scala/private/phases/phase_compile.bzl‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#
44
# DOCUMENT THIS
55
#
6+
load("@bazel_features//:features.bzl", "bazel_features")
67
load(
78
"@io_bazel_rules_scala//scala/private:paths.bzl",
89
_get_files_with_extension = "get_files_with_extension",
@@ -298,7 +299,7 @@ def _create_scala_compilation_provider(ctx, ijar, source_jar, deps_providers):
298299
runtime_deps = []
299300
if hasattr(ctx.attr, "runtime_deps"):
300301
runtime_deps = [dep[JavaInfo] for dep in ctx.attr.runtime_deps]
301-
returnJavaInfo(
302+
kwargs=dict(
302303
output_jar = ctx.outputs.jar,
303304
compile_jar = ijar,
304305
source_jar = source_jar,
@@ -308,6 +309,13 @@ def _create_scala_compilation_provider(ctx, ijar, source_jar, deps_providers):
308309
neverlink = ctx.attr.neverlink,
309310
)
310311

312+
# The JavaInfo constructor's add_exports and add_opens flags were added in Bazel 7:
313+
# https://github.com/bazelbuild/bazel/issues/20033
314+
if bazel_features.java.java_info_constructor_module_flags:
315+
kwargs["add_exports"] = getattr(ctx.attr, "add_exports", [])
316+
kwargs["add_opens"] = getattr(ctx.attr, "add_opens", [])
317+
return JavaInfo(**kwargs)
318+
311319
def _pack_source_jar(ctx, scala_srcs, input_srcjars):
312320
# https://github.com/bazelbuild/bazel/blob/ff6c0333e4f957bb9f7ab5401b01dbf3e9b515b1/src/main/java/com/google/devtools/build/lib/rules/java/JavaInfoBuildHelper.java#L180-L183
313321
# java_common.pack_sources checks for no srcs and only a single input jar

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /