Skip to content

Commit 4db7cb2

Browse files
authored
[bazel] Add support for new libraries (#1760)
1 parent d854fe3 commit 4db7cb2

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

BUILD.bazel

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ swift_syntax_library(
3535
":SwiftDiagnostics",
3636
":SwiftOperators",
3737
":SwiftParser",
38+
],
39+
)
40+
41+
swift_syntax_library(
42+
name = "SwiftSyntaxMacroExpansion",
43+
deps = [
3844
":SwiftSyntax",
3945
":SwiftSyntaxMacros",
4046
],
@@ -102,3 +108,24 @@ swift_syntax_library(
102108
":SwiftSyntax",
103109
],
104110
)
111+
112+
swift_syntax_library(
113+
name = "SwiftSyntaxMacrosTestSupport",
114+
testonly = True,
115+
deps = [
116+
":SwiftDiagnostics",
117+
":SwiftParser",
118+
":SwiftSyntaxMacros",
119+
":_SwiftSyntaxTestSupport",
120+
],
121+
)
122+
123+
swift_syntax_library(
124+
name = "_SwiftSyntaxTestSupport",
125+
testonly = True,
126+
deps = [
127+
":SwiftBasicFormat",
128+
":SwiftSyntax",
129+
":SwiftSyntaxBuilder",
130+
],
131+
)

utils/bazel/swift_syntax_library.bzl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
44
load(":opt_wrapper.bzl", "opt_wrapper")
55

6-
def swift_syntax_library(name, deps):
6+
def swift_syntax_library(name, deps, testonly = False):
77
swift_library(
88
name = name,
99
srcs = native.glob(
@@ -13,9 +13,11 @@ def swift_syntax_library(name, deps):
1313
),
1414
module_name = name,
1515
deps = deps,
16+
testonly = testonly,
1617
)
1718

1819
opt_wrapper(
1920
name = name + "_opt",
2021
dep = name,
22+
testonly = testonly,
2123
)

0 commit comments

Comments
 (0)